Package com.arangodb.serde
Interface ArangoSerde
-
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> T
deserialize(byte[] content, Class<T> clazz)
Deserializes the content and binds it to the target data type.byte[]
serialize(Object value)
Serializes the object into the target data type.
-
-
-
Method Detail
-
serialize
byte[] serialize(Object value)
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
<T> T deserialize(byte[] content, Class<T> clazz)
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
-
-