Class MessageSerializationHelper
java.lang.Object
com.broadleafcommerce.common.messaging.notification.MessageSerializationHelper
Helper class for managing serialized state of message information. Primarily used for working
with
NotificationState.getMessageValue()
(and related fields).- Author:
- Jeff Fischer
-
Constructor Summary
ConstructorsConstructorDescriptionMessageSerializationHelper
(com.fasterxml.jackson.databind.ObjectMapper fieldChangeMapper) -
Method Summary
Modifier and TypeMethodDescription<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.The message information to convert to JSON string.
-
Constructor Details
-
MessageSerializationHelper
public MessageSerializationHelper(com.fasterxml.jackson.databind.ObjectMapper fieldChangeMapper)
-
-
Method Details
-
getObjectRepresentation
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
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:
-
getSerializedRepresentation
The message information to convert to JSON string.- Parameters:
item
- The message information- Returns:
- the JSON representation or null if
item
was null
-