Interface Serializer


  • public interface Serializer
    Serializer definition. Serializers convert objects to their JSON representation and vice versa.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      <T> T deserialize​(java.lang.String string, java.lang.reflect.Type type)
      Deserializes a JSON string to an object of the given type
      java.lang.String serialize​(java.lang.Object obj)
      Serializes an objects to it's JSON representation
    • Method Detail

      • serialize

        java.lang.String serialize​(java.lang.Object obj)
        Serializes an objects to it's JSON representation
        Parameters:
        obj - The object to serialize
        Returns:
        The object's JSON representation
      • deserialize

        <T> T deserialize​(java.lang.String string,
                          java.lang.reflect.Type type)
        Deserializes a JSON string to an object of the given type
        Type Parameters:
        T - type of the object to deserialize
        Parameters:
        string - The JSON string
        type - The object's type
        Returns:
        The deserialized object