Package vn.payos.util

Class DataConverterUtils

java.lang.Object
vn.payos.util.DataConverterUtils

public class DataConverterUtils extends Object
DataConverterUtils
  • Constructor Details

    • DataConverterUtils

      public DataConverterUtils()
  • Method Details

    • normalize

      public static <T> T normalize(Object obj, Class<T> targetClass)
      Converts an object to a specified target class using Jackson's ObjectMapper. Supports various input types including the target class itself, String (JSON), Map, and JsonNode.
      Type Parameters:
      T - The type parameter representing the target class
      Parameters:
      obj - The object to normalize/convert
      targetClass - The class to convert the object to
      Returns:
      An instance of the target class
      Throws:
      IllegalArgumentException - if the input object type is not supported