public class ObjectUtil extends Object
| Constructor and Description |
|---|
ObjectUtil() |
| Modifier and Type | Method and Description |
|---|---|
static Field |
getField(Class<?> cls,
String fieldName)
查询属性
|
static void |
getFields(Class t,
List<Field> fields,
Integer index)
获取Object的属性列表
|
static void |
getMethods(Class t,
List<Method> methods,
Integer index)
获取函数列表
|
static Map |
mapValueToString(Map map)
将map里的值更改为String类型
|
public static void getMethods(Class t, List<Method> methods, Integer index)
t - object classmethods - added listindex - depth indexpublic static Map mapValueToString(Map map)
map - replace mappublic static void getFields(Class t, List<Field> fields, Integer index)
t - 需要获取的Claddfields - 属性集合index - 深度:深入父类一次index则减1,index为0时方法退出。如果获取本身和直系继承的父类属性的话,index为2,只获取自己的属性话 null或者1Copyright © 2018. All rights reserved.