Class ChangeTransformerHelper


  • public class ChangeTransformerHelper
    extends Object
    Helper class for dealing with JSON serialized object state (primarily in ChangeDetail).
    Author:
    Jeff Fischer
    • Constructor Detail

      • ChangeTransformerHelper

        public ChangeTransformerHelper​(com.fasterxml.jackson.databind.ObjectMapper fieldChangeMapper)
    • Method Detail

      • getObjectRepresentation

        public Object getObjectRepresentation​(String json,
                                              String type,
                                              String serializedType)
        Get an object version of some JSON
        Parameters:
        json - The JSON to deserialize
        type - The object type used during deserialization
        serializedType - Canonical String version of the JavaType
        Returns:
        the deserialized object
      • getObjectRepresentation

        public <T> T getObjectRepresentation​(String json,
                                             com.fasterxml.jackson.core.type.TypeReference<T> typeReference)
        Get a TypeReference version of some JSON
        Parameters:
        json - The JSON to deserialize
        Returns:
        the deserialized type reference object
      • getSerializedType

        public String getSerializedType​(Type type)
        Canonical String version of a JavaType instance based on a Type instance.
        Parameters:
        type - The Type instance to convert
        Returns:
        Canonical String version of JavaType
      • getStringRepresentation

        public String getStringRepresentation​(Object item)
        The message information to convert to JSON string.
        Parameters:
        item - The message information
        Returns:
        The JSON representation
      • getJavaType

        public com.fasterxml.jackson.databind.JavaType getJavaType​(String serializedType)
        Get the JavaType instance from the serialized canonical type.
        Parameters:
        serializedType - Canonical String version of JavaType
        Returns:
        The JavaType represented by the String