public interface FieldUtils
Field| Modifier and Type | Method and Description |
|---|---|
static Field |
findField(Class<?> declaredClass,
String fieldName)
Find the
Field by the name in the specified class and its inherited types |
static Field |
findField(Object object,
String fieldName)
Find the
Field by the name in the specified class and its inherited types |
static Field |
getDeclaredField(Class<?> declaredClass,
String fieldName)
Like the
Class.getDeclaredField(String) method without throwing any Exception |
static <T> T |
getFieldValue(Object object,
Field field)
Get the value of the specified
Field |
static Object |
getFieldValue(Object object,
String fieldName)
Get the value of the specified
Field |
static <T> T |
setFieldValue(Object object,
Field field,
T value)
Set the value for the specified
Field |
static <T> T |
setFieldValue(Object object,
String fieldName,
T value)
Set the value for the specified
Field |
static Field getDeclaredField(Class<?> declaredClass, String fieldName)
Class.getDeclaredField(String) method without throwing any ExceptiondeclaredClass - the declared classfieldName - the name of Fieldnullstatic Field findField(Class<?> declaredClass, String fieldName)
Field by the name in the specified class and its inherited typesdeclaredClass - the declared classfieldName - the name of Fieldnullstatic Field findField(Object object, String fieldName)
Field by the name in the specified class and its inherited typesobject - the object whose field should be modifiedfieldName - the name of Fieldnullstatic Object getFieldValue(Object object, String fieldName)
Fieldstatic <T> T getFieldValue(Object object, Field field)
Fieldstatic <T> T setFieldValue(Object object, String fieldName, T value)
FieldCopyright © 2011–2022 The Apache Software Foundation. All rights reserved.