public final class ReflectionUtil extends Object
| Constructor and Description |
|---|
ReflectionUtil() |
| Modifier and Type | Method and Description |
|---|---|
static <T> Optional<T> |
getFieldValue(Object target,
String fieldName)
Get field value.
|
static <T> T |
getStaticFieldValue(Class<?> target,
String fieldName)
Get static field value.
|
static <T> T |
invokeMethod(Method method,
Object target,
Object... args)
Invoke method.
|
static void |
setStaticFieldValue(Class<?> target,
String fieldName,
Object value)
Set static field value.
|
public static <T> Optional<T> getFieldValue(Object target, String fieldName)
T - type of field valuetarget - targetfieldName - field namepublic static <T> T getStaticFieldValue(Class<?> target, String fieldName)
T - type of field valuetarget - targetfieldName - field namepublic static void setStaticFieldValue(Class<?> target, String fieldName, Object value)
target - targetfieldName - field namevalue - valueCopyright © 2023 The Apache Software Foundation. All rights reserved.