CosmosItemSerializer Class
- java.
lang. Object - com.
azure. cosmos. CosmosItemSerializer
- com.
public abstract class CosmosItemSerializer
The CosmosItemSerializer allows customizing the serialization of Cosmos Items - either to transform payload (for example wrap/unwrap in custom envelopes) or use custom serialization settings or json serializer stacks.
Field Summary
Modifier and Type | Field and Description |
---|---|
static final
Cosmos |
DEFAULT_SERIALIZER
Gets the default Cosmos item serializer. |
Constructor Summary
Modifier | Constructor | Description |
---|---|---|
protected | CosmosItemSerializer() |
Used to instantiate subclasses |
Method Summary
Modifier and Type | Method and Description |
---|---|
abstract T |
deserialize(Map<String,Object> jsonNodeMap, Class<T> classType)
Used to deserialize the json tree stored in the Cosmos DB item as a POJO |
abstract Map<String,Object> |
serialize(T item)
Used to serialize a POJO into a json tree |
Methods inherited from java.lang.Object
Field Details
DEFAULT_SERIALIZER
public static final CosmosItemSerializer DEFAULT_SERIALIZER
Gets the default Cosmos item serializer. This serializer is used by default when no custom serializer is specified on request options or the CosmosClientBuilder
Constructor Details
CosmosItemSerializer
protected CosmosItemSerializer()
Used to instantiate subclasses
Method Details
deserialize
public abstract T
Used to deserialize the json tree stored in the Cosmos DB item as a POJO
Parameters:
Returns:
serialize
public abstract Map
Used to serialize a POJO into a json tree
Parameters:
Returns: