Class MessageSerializationHelper

java.lang.Object
com.broadleafcommerce.common.messaging.notification.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 Details

    • MessageSerializationHelper

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

    • 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

      @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:
    • 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