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 withNotificationState.getMessageValue()
(and related fields).- Author:
- Jeff Fischer
-
-
Constructor Summary
Constructors Constructor Description MessageSerializationHelper(com.fasterxml.jackson.databind.ObjectMapper fieldChangeMapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
getObjectRepresentation(String json, Class<T> javaType)
Get an object version of some JSON.<T> T
getObjectRepresentation(String json, String type)
Get an object version of some JSON using a string-based class name.String
getSerializedRepresentation(Object item)
The message information to convert to JSON string.
-
-
-
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 givenjavaType
is a String, the originaljson
is return unmodified.- Parameters:
json
- JSON to deserializetype
- 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 givenjavaType
is a String, the originaljson
is return unmodified.- Parameters:
json
- JSON to deserializejavaType
- the type to deserialize into- Returns:
- the deserialized object or null if
json
was null - See Also:
getObjectRepresentation(String, String)
-
-