类 CodeMapUtils

java.lang.Object
cloud.opencode.base.util.CodeMapUtils

public final class CodeMapUtils extends Object
版本:
v1.0.0
作者:
Jon So, e-mail: ijonso123@gmail.com url: Jon's blog url: project github
  • 构造器详细资料

    • CodeMapUtils

      private CodeMapUtils()
  • 方法详细资料

    • getMapFromEntity

      public static Map<String,Object> getMapFromEntity(Object entity) throws IllegalAccessException
      Converting entity classes to map
      参数:
      entity - entity
      返回:
      map
      抛出:
      IllegalAccessException
    • getMapFromEntitySimple

      public static Map<String,String> getMapFromEntitySimple(Object entity) throws IllegalAccessException
      Converting entity classes to map (single layer)
      参数:
      entity - object
      返回:
      map
      抛出:
      IllegalAccessException
    • convertMap

      private static void convertMap(Map<String,Object> map, Class clazz, Object target) throws IllegalAccessException
      Convert entity class to map (including parent class)
      参数:
      map - map
      clazz - class
      target - object
      抛出:
      Exception - IllegalAccessException
      IllegalAccessException
    • convertMapSimple

      private static void convertMapSimple(Map<String,String> map, Class clazz, Object target) throws IllegalAccessException
      Convert entity class to map (including parent class) Simple entity
      参数:
      map - map
      clazz - class
      target - object
      抛出:
      IllegalAccessException
    • isBasicType

      private static boolean isBasicType(Object o)
      Convert entity class to map (including parent class)
      参数:
      o - Object
      返回:
      boolean
    • getRequestParam2Map

      public static Map<String,String> getRequestParam2Map(jakarta.servlet.http.HttpServletRequest request)
      Get the requested Map from HttpServletRequest
      参数:
      request - HttpServletRequest
      返回:
      map
    • getRequestParam2Json

      public static String getRequestParam2Json(jakarta.servlet.http.HttpServletRequest request)
      Get the requested Map from HttpServletRequest and convert it to JSON
      参数:
      request - HttpServletRequest
      返回:
      JSON
    • getMap

      public static HashMap<String,Object> getMap(String key, Object value)
      get map
      参数:
      key - key
      value - value
      返回:
      hashmap
    • getBoolValue

      public static Boolean getBoolValue(Map<String,Object> map, String key)
      get boolean value from map
      参数:
      map - map
      key - key
      返回:
      boolean
    • getStringValue

      public static String getStringValue(Map<String,Object> map, String key)
      get string from map
      参数:
      map - map
      key - key
      返回:
      string
    • getIntegerValue

      public static Integer getIntegerValue(Map<String,Object> map, String key)
      get integer value from map
      参数:
      map - map
      key - key
      返回:
      integer
    • getDoubleValue

      public static Double getDoubleValue(Map<String,Object> map, String key)
      get double value from map
      参数:
      map - map
      key - key
      返回:
      double
    • getFloatValue

      public static Float getFloatValue(Map<String,Object> map, String key)
      get float value from map
      参数:
      map - map
      key - key
      返回:
      float
    • getBigDecimalValue

      public static BigDecimal getBigDecimalValue(Map<String,Object> map, String key)
      get bigdecimal value from map
      参数:
      map - map
      key - key
      返回:
      BigDecimal
    • conversionMap

      public static <T> Map<String,Object> conversionMap(T bean)
      object convert to map
      类型参数:
      T - the bean type
      参数:
      bean - bean
      返回:
      map