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 Type
    Method
    Description
    <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

      byte[] serialize(Object value)
      Serializes the object into the target data type. For data type ContentType.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 type ContentType.JSON, the byte array is the JSON string encoded using the UTF-8 charset.
      Parameters:
      content - byte array to deserialize
      clazz - class of target data type
      Returns:
      deserialized object
    • deserialize

      default <T> T deserialize(byte[] content, Class<T> clazz, RequestContext ctx)
      Deserializes the content and binds it to the target data type. For data type ContentType.JSON, the byte array is the JSON string encoded using the UTF-8 charset.
      Parameters:
      content - byte array to deserialize
      clazz - class of target data type
      ctx - serde context, cannot be null
      Returns:
      deserialized object