Package com.skava.oms.util
Class MapperUtil
java.lang.Object
com.skava.oms.util.MapperUtil
This class contains common utility functions which are using order process. It's contains only static functions.
- Author:
- Infosys Equinox
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.fasterxml.jackson.databind.ObjectMapper
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> com.skava.core.event.Message<T>
castFromTypeRef
(byte[] bs) Method to convert the given bytes into Message using typeReferencestatic <T> T
castTypeFromBytes
(byte[] content, Class<T> requiredType) Method to convert the given Bytes content to required classstatic <T> T
castTypeFromJsonNode
(com.fasterxml.jackson.databind.JsonNode content, Class<T> requiredType) Method to convert the given JsonNode content to required classstatic <T> T
castTypeFromObj
(Object content, Class<T> requiredType) Method to convert the given JsonNode content to required classstatic <T> T
castTypeFromString
(String content, Class<T> requiredType) Method to convert the given JsonNode content to required classstatic com.fasterxml.jackson.databind.JsonNode
castTypeToJsonNode
(Object content) Method to get the jsonNode for given objectstatic String
getJsonFromObject
(Object content) Method to get the writer for the given contentstatic <T> com.fasterxml.jackson.databind.ObjectReader
Method to get the reader object for the given type
-
Field Details
-
objectMapper
public static final com.fasterxml.jackson.databind.ObjectMapper objectMapper
-
-
Method Details
-
getReader
Method to get the reader object for the given type- Type Parameters:
T
- - any type of class- Parameters:
requiredType
- - new reader instance that is configured to data bind into specified type.- Returns:
- newly configured instance.
-
getJsonFromObject
Method to get the writer for the given content- Parameters:
content
- - write object- Returns:
- string
-
castFromTypeRef
public static <T> com.skava.core.event.Message<T> castFromTypeRef(byte[] bs) Method to convert the given bytes into Message using typeReference- Type Parameters:
T
- - Type reference- Parameters:
bs
- - byte value- Returns:
- message
-
castTypeToJsonNode
Method to get the jsonNode for given object- Parameters:
content
- - message content- Returns:
- - json node
-
castTypeFromJsonNode
public static <T> T castTypeFromJsonNode(com.fasterxml.jackson.databind.JsonNode content, Class<T> requiredType) Method to convert the given JsonNode content to required class- Type Parameters:
T
- - type reference- Parameters:
content
- - json noderequiredType
- Contains the return type- Returns:
- class
-
castTypeFromObj
Method to convert the given JsonNode content to required class- Type Parameters:
T
- - type reference- Parameters:
content
- - json noderequiredType
- Contains the return type- Returns:
- class
-
castTypeFromBytes
Method to convert the given Bytes content to required class- Type Parameters:
T
- - type reference- Parameters:
content
- - json noderequiredType
- Contains the return type- Returns:
- class
-
castTypeFromString
Method to convert the given JsonNode content to required class- Type Parameters:
T
- - type reference- Parameters:
content
- - string datarequiredType
- Contains the return type- Returns:
- class
-