Class MessageSerializationHelper


  • public class MessageSerializationHelper
    extends Object
    Helper class for managing serialized state of message information. Primarily used for working with NotificationState.getMessageValue() (and related fields).
    Author:
    Jeff Fischer
    • Constructor Detail

      • MessageSerializationHelper

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

      • getObjectRepresentation

        @Nullable
        public <T> T getObjectRepresentation​(@Nullable
                                             String json,
                                             String type)
        Get an object version of some JSON using a string-based class name. If the given javaType is a String, the original json is return unmodified.
        Parameters:
        json - JSON to deserialize
        type - object type used during deserialization
        Returns:
        the deserialized object or null if json was null
        See Also:
        getObjectRepresentation(String, Class)
      • getObjectRepresentation

        @Nullable
        public <T> T getObjectRepresentation​(@Nullable
                                             String json,
                                             Class<T> javaType)
        Get an object version of some JSON. If the given javaType is a String, the original json is return unmodified.
        Parameters:
        json - JSON to deserialize
        javaType - the type to deserialize into
        Returns:
        the deserialized object or null if json was null
        See Also:
        getObjectRepresentation(String, String)
      • getSerializedRepresentation

        @Nullable
        public String getSerializedRepresentation​(@Nullable
                                                  Object item)
        The message information to convert to JSON string.
        Parameters:
        item - The message information
        Returns:
        the JSON representation or null if item was null