Class JacksonDataConverter

  • All Implemented Interfaces:
    DataConverter

    public final class JacksonDataConverter
    extends java.lang.Object
    implements DataConverter
    An implementation of DataConverter that uses Jackson APIs for data serialization.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T> T deserialize​(java.lang.String jsonText, java.lang.Class<T> targetType)
      Deserializes the given text data into an object of the specified type.
      java.lang.String serialize​(java.lang.Object value)
      Serializes the input into a text representation.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JacksonDataConverter

        public JacksonDataConverter()
    • Method Detail

      • serialize

        public java.lang.String serialize​(java.lang.Object value)
        Description copied from interface: DataConverter
        Serializes the input into a text representation.
        Specified by:
        serialize in interface DataConverter
        Parameters:
        value - the value to be serialized
        Returns:
        a serialized text representation of the value or null if the value is null
      • deserialize

        public <T> T deserialize​(java.lang.String jsonText,
                                 java.lang.Class<T> targetType)
        Description copied from interface: DataConverter
        Deserializes the given text data into an object of the specified type.
        Specified by:
        deserialize in interface DataConverter
        Type Parameters:
        T - the generic parameter type representing the target class to deserialize the input into
        Parameters:
        jsonText - the text data to deserialize into an object
        targetType - the target class to deserialize the input into
        Returns:
        a deserialized object of type T