public class FieldWrapper
extends java.lang.Object
Field for easy access| Constructor and Description |
|---|
FieldWrapper(FieldStream parent,
java.lang.reflect.Field field) |
| Modifier and Type | Method and Description |
|---|---|
void |
copy(java.lang.Object target)
Copy the value of the
Field to the given target |
void |
copy(java.lang.Object instance,
java.lang.Object target)
Copy the value of the
Field to the given target with the given owner |
<T> T |
get()
Get the value of the
Field |
<T> T |
get(java.lang.Object instance)
Get the value of the
Field with the given owner |
ModifierWrapper |
modifier()
Get the
ModifierWrapper of the field |
java.lang.String |
name()
Get the name of the
Field |
java.lang.Class<?> |
owner()
Get the owner
Class of the Field |
FieldStream |
parent()
Get the parent
FieldStream |
java.lang.reflect.Field |
raw()
Get the raw
Field |
void |
set(java.lang.Object value)
Set the value of the
Field |
void |
set(java.lang.Object instance,
java.lang.Object value)
Set the value of the
Field with the given owner |
java.lang.Class<?> |
type()
Get the type of the
Field |
public FieldWrapper(FieldStream parent, java.lang.reflect.Field field)
public FieldStream parent()
FieldStreampublic java.lang.reflect.Field raw()
Fieldpublic java.lang.String name()
Fieldpublic java.lang.Class<?> type()
Fieldpublic java.lang.Class<?> owner()
Class of the Fieldpublic ModifierWrapper modifier()
ModifierWrapper of the fieldpublic <T> T get()
Fieldjava.lang.IllegalStateException - If trying to get a non-static Field if no instance is providedpublic <T> T get(java.lang.Object instance)
Field with the given ownerinstance - The instance of the ownerFieldpublic void set(java.lang.Object value)
Fieldvalue - The value to set the Field tojava.lang.IllegalStateException - If trying to set a non-static Field if no instance is providedpublic void set(java.lang.Object instance,
java.lang.Object value)
Field with the given ownerinstance - The instance of the ownervalue - The value to set the Field topublic void copy(java.lang.Object target)
Field to the given targettarget - The target to copy the value topublic void copy(java.lang.Object instance,
java.lang.Object target)
Field to the given target with the given ownerinstance - The instance of the ownertarget - The target to copy the value to