Package io.dapr.serializer
Interface DaprObjectSerializer
- All Known Implementing Classes:
DefaultObjectSerializer
public interface DaprObjectSerializer
Serializes and deserializes application's objects.
-
Method Summary
Modifier and TypeMethodDescription<T> Tdeserialize(byte[] data, TypeRef<T> type)Deserializes the given byte[] into a object.Returns the content type of the request.byte[]Serializes the given object as byte[].
-
Method Details
-
serialize
Serializes the given object as byte[].- Parameters:
o- Object to be serialized.- Returns:
- Serialized object.
- Throws:
IOException- If cannot serialize.
-
deserialize
Deserializes the given byte[] into a object.- Type Parameters:
T- Type of object to be deserialized.- Parameters:
data- Data to be deserialized.type- Type of object to be deserialized.- Returns:
- Deserialized object.
- Throws:
IOException- If cannot deserialize object.
-
getContentType
String getContentType()Returns the content type of the request.- Returns:
- content type of the request
-