public final class Serializer extends Object
| Constructor and Description |
|---|
Serializer() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
deserialize(Map<String,Object> serialized,
Class<T> clazz)
Deserializes an object from a Dataflow structured encoding (represented in
Java as a map).
|
public static <T> T deserialize(Map<String,Object> serialized, Class<T> clazz)
The standard Dataflow SDK object serialization protocol is based on JSON. Data is typically encoded as a JSON object whose fields represent the object's data.
The actual deserialization is performed by Jackson, which can deserialize
public fields, use JavaBean setters, or use injection annotations to
indicate how to construct the object. The ObjectMapper used is
configured to use the "@type" field as the name of the class to instantiate
(supporting polymorphic types), and may be further configured by
annotations or via #registerModule.
serialized - the object in untyped decoded form (i.e. a nested Map)clazz - the expected object class