Interface Serializer<T,​U>

    • Method Detail

      • convert

        @Nonnull
        default U convert​(T t)
        Returns a representation of t as an instance of type R.
        Specified by:
        convert in interface Converter<T,​U>
        Parameters:
        t - the instance to convert
        Returns:
        the converted instance
        See Also:
        serialize(Object)
      • revert

        @Nonnull
        default T revert​(U data)
        Returns a representation of r as an instance of type T.
        Specified by:
        revert in interface Converter<T,​U>
        Parameters:
        data - the instance to convert
        Returns:
        the converted instance
        See Also:
        deserialize(Object)
      • serialize

        @Nonnull
        U serialize​(T t)
             throws IOException
        Write an object of type T into its basic representation.
        Parameters:
        t - the object to serialize
        Returns:
        the serialized object
        Throws:
        IOException - if an I/O error occurs during the serialization
      • deserialize

        @Nonnull
        T deserialize​(U data)
               throws IOException
        Reads and assembles an object of type T from the given data.
        Parameters:
        data - the basic representation of the object
        Returns:
        the deserialized object
        Throws:
        IOException - if an I/O error occurs during the deserialization