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.
CodecFactory
Modifier and Type | Method and Description |
---|---|
T |
toObject(String value)
Convert a string form of an object back into the corresponding object.
|
String |
toString(T value)
Convert an object to a string form.
|
String toString(T value) throws IOException
Convert an object to a string form.
value
- the value to convert. This value will never be null
.IOException
- if the object cannot be converted.T toObject(String value) throws IOException
Convert a string form of an object back into the corresponding object.
value
- the value to convert. This value will never be null
.IOException
- if the string value cannot be converted into an object.