Class ObjectMapperUtil
java.lang.Object
com.skava.marketplace.orchestration.utils.ObjectMapperUtil
The Class ObjectMapperUtil.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> String
convertObjectToString
(T object) Convert object to string.static <T> List<T>
convertToListOfObjectWithOutException
(String json, Class<T> clazz) Convert to list of object with out exception.static <T> T
convertToObject
(String json, Class<T> clazz) Convert to object.static <T> T
convertToObjectWithOutException
(String json, Class<T> clazz) Convert to object with out exception.static com.fasterxml.jackson.databind.ObjectMapper
Gets the single instance of ObjectMapperUtil.static <T> T
getModelMapper
(Class<T> clazz) Gets the model mapper.
-
Method Details
-
getInstance
public static com.fasterxml.jackson.databind.ObjectMapper getInstance()Gets the single instance of ObjectMapperUtil.- Returns:
- single instance of ObjectMapperUtil
-
convertToObject
Convert to object.- Type Parameters:
T
- the generic type- Parameters:
json
- the jsonclazz
- the clazz- Returns:
- the t
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
convertToObjectWithOutException
Convert to object with out exception.- Type Parameters:
T
- the generic type- Parameters:
json
- the jsonclazz
- the clazz- Returns:
- the t
-
convertToListOfObjectWithOutException
Convert to list of object with out exception.- Type Parameters:
T
- the generic type- Parameters:
json
- the jsonclazz
- the clazz- Returns:
- the list
-
convertObjectToString
Convert object to string.- Type Parameters:
T
- the generic type- Parameters:
object
- the object- Returns:
- the string
-
getModelMapper
Gets the model mapper.- Type Parameters:
T
- the generic type- Parameters:
clazz
- the clazz- Returns:
- the model mapper
-