public interface FieldAccess
| Modifier and Type | Method and Description |
|---|---|
default <T> T |
castValue(java.lang.Object instance)
Get the value of the field from the given instance and cast it to the wanted type.
|
<T extends java.lang.annotation.Annotation> |
getAnnotation(java.lang.Class<T> annotationClass)
Get an annotation of the field.
|
int |
getModifiers() |
java.lang.String |
getName() |
java.lang.Class<?> |
getType() |
java.lang.Object |
getValue(java.lang.Object instance)
Get the value of the field from the given instance.
|
void |
setValue(java.lang.Object instance,
java.lang.Object value)
Set the value of the field for the given instance.
|
java.lang.String getName()
Field.getName()java.lang.Class<?> getType()
Field.getType()int getModifiers()
Field.getModifiers()java.lang.Object getValue(java.lang.Object instance)
instance - The instance to get the value fromField.get(Object)default <T> T castValue(java.lang.Object instance)
T - The type to cast the value toinstance - The instance to get the value fromjava.lang.ClassCastException - If the value cannot be casted to the wanted typevoid setValue(java.lang.Object instance,
java.lang.Object value)
instance - The instance to set the value forvalue - The value to setField.set(Object, Object)<T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> annotationClass)
T - The type of the annotationannotationClass - The class of the annotationAccessibleObject.getDeclaredAnnotation(Class)