Package com.arangodb.serde
Interface ArangoSerde
- All Known Subinterfaces:
InternalSerde
,JacksonSerde
- All Known Implementing Classes:
JacksonSerdeImpl
,JsonbSerde
public interface ArangoSerde
Contract for serialization/deserialization of user data.
Implementations of this interface could be used for customizing serialization/deserialization of user related data
using serialization/deserialization libraries like:
- serialization libraries for specific JVM languages (e.g. Scala, Kotlin, ...)
- serialization libraries already in use in frameworks (e.g. JSON-B, Micronaut Serialization, ...)
- high performance serialization libraries (e.g. supporting compile-time data binding code generation)
- low-level libraries without support to data binding
-
Method Summary
Modifier and TypeMethodDescription<T> T
deserialize
(byte[] content, Class<T> clazz) Deserializes the content and binds it to the target data type.default <T> T
deserialize
(byte[] content, Class<T> clazz, RequestContext ctx) Deserializes the content and binds it to the target data type.byte[]
Serializes the object into the target data type.
-
Method Details
-
serialize
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.- Parameters:
value
- object to serialize- Returns:
- serialized byte array
-
deserialize
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.- Parameters:
content
- byte array to deserializeclazz
- class of target data type- Returns:
- deserialized object
-
deserialize
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.- Parameters:
content
- byte array to deserializeclazz
- class of target data typectx
- serde context, cannot be null- Returns:
- deserialized object
-