Interface Serializer<T1,T2>

Type Parameters:
T1 - the type of the objects that should be serialized
T2 - the serializable type

public interface Serializer<T1,T2>
Implementations of this interface convert instances of type T1 to a serializable type T2 and vice versa.

Which types T2 are serializable depends on the underlying storage system. Currently, all storage systems support the following target types:

  • Boolean
  • Long
  • Double
  • String
  • (Nested) Lists of the other types
  • (Nested) Maps of the other types

For all custom serializers, T2 must be one of the six types listed above.

  • Method Summary

    Modifier and Type
    Method
    Description
    deserialize(T2 element)
    Deserializes an element of type T2 into an element of type T1.
    serialize(T1 element)
    Serializes an element of type T1 into an element of type T2.
  • Method Details

    • serialize

      T2 serialize(T1 element)
      Serializes an element of type T1 into an element of type T2. Type T2 must be a valid target type.
      Parameters:
      element - the element of type T1 that is serialized
      Returns:
      the serialized element of type T2
    • deserialize

      T1 deserialize(T2 element)
      Deserializes an element of type T2 into an element of type T1.
      Parameters:
      element - the element of type T2 that is deserialized
      Returns:
      the deserialized element of type T1