Class ToStringEncoder

  • All Implemented Interfaces:
    Encoder, Encoder.Text<java.lang.Object>

    public class ToStringEncoder
    extends CoderAdapter
    implements Encoder.Text<java.lang.Object>
    Fall-back encoder - encoders any object to string using Object.toString() method.
    Author:
    Martin Matula (martin.matula at oracle.com)
    • Constructor Detail

      • ToStringEncoder

        public ToStringEncoder()
    • Method Detail

      • encode

        public java.lang.String encode​(java.lang.Object object)
                                throws EncodeException
        Description copied from interface: Encoder.Text
        Encode the given object into a String.
        Specified by:
        encode in interface Encoder.Text<java.lang.Object>
        Parameters:
        object - the object being encoded.
        Returns:
        the encoded object as a string.
        Throws:
        EncodeException - The provided object could not be encoded as a string