public class ReflectionUtils
extends java.lang.Object
| Constructor and Description |
|---|
ReflectionUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <T> java.util.Optional<T> |
getField(java.lang.Class<?> clazz,
java.lang.Object instance,
java.lang.Class<? extends T> wanted,
int index)
Get a value of a
Field in a ClassThe Field is specified by the type and index in the Class |
public static <T> java.util.Optional<T> getField(java.lang.Class<?> clazz,
java.lang.Object instance,
java.lang.Class<? extends T> wanted,
int index)
Field in a ClassField is specified by the type and index in the Classclazz - The Classinstance - The instance of the Class or null if staticwanted - The type of the Fieldindex - The index of the FieldField or Optional.empty() if the Field doesn't exist