Interface TextSerializer<T>

    • Method Detail

      • serialize

        String serialize​(Object value)
        Serialize a value to text in such a way that it can be deserialized with the corresponding deserializer.
        Parameters:
        value - Object; the value to serialize
        Returns:
        String; a string representation of the value that can later be deserialized
      • deserialize

        Object deserialize​(String text)
        Deserialize a value from text that has been created with the corresponding serializer.
        Parameters:
        text - String; the string to deserialize
        Returns:
        T; an instance of the object created with the corresponding serializer
      • resolve

        static TextSerializer<?> resolve​(Class<?> valueClass)
                                  throws TextSerializationException
        Resolve the correct (de)serializer for the given class, and return an instance of the (de)serializer.
        Parameters:
        valueClass - Class<?>; the class to resolve the (de)serializer for
        Returns:
        an instance of the correct (de)serializer
        Throws:
        TextSerializationException - when there is no corresponding (de)serializer for the class