Package io.dapr.actors.runtime
Class ActorObjectSerializer
java.lang.Object
io.dapr.client.ObjectSerializer
io.dapr.actors.runtime.ActorObjectSerializer
Serializes and deserializes internal objects.
-
Field Summary
Fields inherited from class io.dapr.client.ObjectSerializer
OBJECT_MAPPER
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T> T
deserialize
(byte[] content, Class<T> clazz) Deserializes the byte array into the original object.byte[]
Serializes a given state object into byte array.Methods inherited from class io.dapr.client.ObjectSerializer
deserialize, parseNode
-
Constructor Details
-
ActorObjectSerializer
public ActorObjectSerializer()
-
-
Method Details
-
serialize
Serializes a given state object into byte array.- Overrides:
serialize
in classObjectSerializer
- Parameters:
state
- State object to be serialized.- Returns:
- Array of bytes[] with the serialized content.
- Throws:
IOException
- In case state cannot be serialized.
-
deserialize
Deserializes the byte array into the original object.- Overrides:
deserialize
in classObjectSerializer
- Type Parameters:
T
- Generic type of the object being deserialized.- Parameters:
content
- Content to be parsed.clazz
- Type of the object being deserialized.- Returns:
- Object of type T.
- Throws:
IOException
- In case content cannot be deserialized.
-