类 PojoUtils


  • public class PojoUtils
    extends Object
    PojoUtils. Travel object deeply, and convert complex type to simple type.

    Simple type below will be remained:

    • Primitive Type, also include String, Number(Integer, Long), Date
    • Array of Primitive Type
    • Collection, eg: List, Map, Set etc.

    Other type will be covert to a map which contains the attributes and value pair of object.

    • 构造器详细资料

      • PojoUtils

        public PojoUtils()
    • 方法详细资料

      • generalize

        public static Object[] generalize​(Object[] objs)
      • generalize

        public static Object generalize​(Object pojo)
      • isPojo

        public static boolean isPojo​(Class<?> cls)
      • updatePropertyIfAbsent

        public static <T> void updatePropertyIfAbsent​(Supplier<T> getterMethod,
                                                      Consumer<T> setterMethod,
                                                      T newValue)
        Update the property if absent
        类型参数:
        T - the value type
        参数:
        getterMethod - the getter method
        setterMethod - the setter method
        newValue - the new value
        从以下版本开始:
        2.7.8