Class ChangeTransformerHelper
java.lang.Object
com.broadleafcommerce.data.tracking.core.mapping.ChangeTransformerHelper
Helper class for dealing with JSON serialized object state (primarily in
ChangeDetail
).- Author:
- Jeff Fischer
-
Constructor Summary
ConstructorDescriptionChangeTransformerHelper
(com.fasterxml.jackson.databind.ObjectMapper fieldChangeMapper) -
Method Summary
Modifier and TypeMethodDescriptioncom.fasterxml.jackson.databind.JavaType
getJavaType
(String serializedType) Get theJavaType
instance from the serialized canonical type.<T> T
getObjectRepresentation
(String json, com.fasterxml.jackson.core.type.TypeReference<T> typeReference) Get aTypeReference
version of some JSONgetObjectRepresentation
(String json, String type, String serializedType) Get an object version of some JSONgetSerializedType
(Type type) Canonical String version of aJavaType
instance based on aType
instance.The message information to convert to JSON string.
-
Constructor Details
-
ChangeTransformerHelper
public ChangeTransformerHelper(com.fasterxml.jackson.databind.ObjectMapper fieldChangeMapper)
-
-
Method Details
-
getObjectRepresentation
Get an object version of some JSON- Parameters:
json
- The JSON to deserializetype
- The object type used during deserializationserializedType
- Canonical String version of theJavaType
- Returns:
- the deserialized object
-
getObjectRepresentation
public <T> T getObjectRepresentation(String json, com.fasterxml.jackson.core.type.TypeReference<T> typeReference) Get aTypeReference
version of some JSON- Parameters:
json
- The JSON to deserialize- Returns:
- the deserialized type reference object
-
getSerializedType
Canonical String version of aJavaType
instance based on aType
instance.- Parameters:
type
- TheType
instance to convert- Returns:
- Canonical String version of JavaType
-
getStringRepresentation
The message information to convert to JSON string.- Parameters:
item
- The message information- Returns:
- The JSON representation
-
getJavaType
Get theJavaType
instance from the serialized canonical type.- Parameters:
serializedType
- Canonical String version of JavaType- Returns:
- The
JavaType
represented by the String
-