Class ObjectMapperUtil

java.lang.Object
com.skava.marketplace.orchestration.utils.ObjectMapperUtil

public final class ObjectMapperUtil extends Object
The Class ObjectMapperUtil.
  • Method Details

    • getInstance

      public static com.fasterxml.jackson.databind.ObjectMapper getInstance()
      Gets the single instance of ObjectMapperUtil.
      Returns:
      single instance of ObjectMapperUtil
    • convertToObject

      public static <T> T convertToObject(String json, Class<T> clazz) throws IOException
      Convert to object.
      Type Parameters:
      T - the generic type
      Parameters:
      json - the json
      clazz - the clazz
      Returns:
      the t
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • convertToObjectWithOutException

      public static <T> T convertToObjectWithOutException(String json, Class<T> clazz)
      Convert to object with out exception.
      Type Parameters:
      T - the generic type
      Parameters:
      json - the json
      clazz - the clazz
      Returns:
      the t
    • convertToListOfObjectWithOutException

      public static <T> List<T> convertToListOfObjectWithOutException(String json, Class<T> clazz)
      Convert to list of object with out exception.
      Type Parameters:
      T - the generic type
      Parameters:
      json - the json
      clazz - the clazz
      Returns:
      the list
    • convertObjectToString

      public static <T> String convertObjectToString(T object)
      Convert object to string.
      Type Parameters:
      T - the generic type
      Parameters:
      object - the object
      Returns:
      the string
    • getModelMapper

      public static <T> T getModelMapper(Class<T> clazz)
      Gets the model mapper.
      Type Parameters:
      T - the generic type
      Parameters:
      clazz - the clazz
      Returns:
      the model mapper