Class JacksonSerdeImpl
java.lang.Object
com.arangodb.serde.jackson.internal.JacksonSerdeImpl
- All Implemented Interfaces:
ArangoSerde
,JacksonSerde
Not shaded in arangodb-java-driver-shaded.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAllows configuring the underlying Jackson ObjectMapper<T> T
deserialize
(byte[] content, Class<T> type) Deserializes the content and binds it to the target data type.<T> T
deserialize
(byte[] content, Class<T> type, RequestContext ctx) Deserializes the content and binds it to the target data type.byte[]
Serializes the object into the target data type.
-
Field Details
-
SERDE_CONTEXT_ATTRIBUTE_NAME
- See Also:
-
-
Constructor Details
-
JacksonSerdeImpl
public JacksonSerdeImpl(com.fasterxml.jackson.databind.ObjectMapper mapper)
-
-
Method Details
-
serialize
Description copied from interface:ArangoSerde
Serializes the object into the target data type. For data typeContentType.JSON
, the serialized JSON string must be encoded into a byte array using the UTF-8 charset.- Specified by:
serialize
in interfaceArangoSerde
- Parameters:
value
- object to serialize- Returns:
- serialized byte array
-
deserialize
Description copied from interface:ArangoSerde
Deserializes the content and binds it to the target data type. For data typeContentType.JSON
, the byte array is the JSON string encoded using the UTF-8 charset.- Specified by:
deserialize
in interfaceArangoSerde
- Parameters:
content
- byte array to deserializetype
- class of target data type- Returns:
- deserialized object
-
deserialize
Description copied from interface:ArangoSerde
Deserializes the content and binds it to the target data type. For data typeContentType.JSON
, the byte array is the JSON string encoded using the UTF-8 charset.- Specified by:
deserialize
in interfaceArangoSerde
- Parameters:
content
- byte array to deserializetype
- class of target data typectx
- serde context, cannot be null- Returns:
- deserialized object
-
configure
public JacksonSerde configure(Consumer<com.fasterxml.jackson.databind.ObjectMapper> configureFunction) Description copied from interface:JacksonSerde
Allows configuring the underlying Jackson ObjectMapper- Specified by:
configure
in interfaceJacksonSerde
- Parameters:
configureFunction
- function to configure the Jackson ObjectMapper
-