Package com.acanx.utils.incubator
Class ReflectionUtil
java.lang.Object
com.acanx.utils.incubator.ReflectionUtil
ReflectionUtil
- Since:
- 0.0.1.10
-
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectgetFieldValue(Object obj, String fieldName) 利用反射获取指定对象的指定属性static booleanisPrimitive(Class<?> cls) isPrimitivestatic booleanisPrimitives(Class<?> cls) isPrimitivestatic voidsetFieldValue(Object obj, String fieldName, String fieldValue) 利用反射设置指定对象的指定属性为指定的值
-
Method Details
-
isPrimitives
isPrimitive- Parameters:
cls- class- Returns:
- 判断结果
-
isPrimitive
isPrimitive- Parameters:
cls- class- Returns:
- 判断结果
-
getFieldValue
利用反射获取指定对象的指定属性- Parameters:
obj- 目标对象fieldName- 目标属性- Returns:
- 目标属性的值
-
setFieldValue
利用反射设置指定对象的指定属性为指定的值- Parameters:
obj- 目标对象fieldName- 目标属性fieldValue- 目标值
-