Interface Codec<T>


  • public interface Codec<T>

    Codecs convert objects to a suitable string form and vice versa. Codecs are only expected to deal with objects of their basic defined type. Arrays of the type supported by the codec are seperated into individual array element components before being passed to a codec for conversion.

    See Also:
    CodecFactory
    • Method Detail

      • toString

        String toString​(T value)
                 throws IOException

        Convert an object to a string form.

        Parameters:
        value - the value to convert. This value will never be null.
        Returns:
        a string form of the object.
        Throws:
        IOException - if the object cannot be converted.
      • toObject

        T toObject​(String value)
            throws IOException

        Convert a string form of an object back into the corresponding object.

        Parameters:
        value - the value to convert. This value will never be null.
        Returns:
        an object form of the string value.
        Throws:
        IOException - if the string value cannot be converted into an object.