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 types:

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

That means that if you want to support all currently available configuration store formats, your Serializer implementation should convert an object of type T1 into one of the seven 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.
      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