public class FieldInstance extends Object
Modifier and Type | Field and Description |
---|---|
protected Field |
field
Field
|
protected Object |
instance
Instance
|
Constructor and Description |
---|
FieldInstance(Object instance,
String fieldName)
Construct a new field instance.
|
Modifier and Type | Method and Description |
---|---|
Object |
get()
Get the value of the field instance.
|
Field |
getField()
Get the field.
|
Object |
getInstance()
Get the instance.
|
void |
set(Object value)
Set the value of the field instance
|
protected final Field field
protected final Object instance
public FieldInstance(Object instance, String fieldName) throws NoSuchFieldException
instance
- The instance object the given field belongs to.fieldName
- The name of the field to find in the instance.NullArgumentException
- Instance or fieldName is null.NoSuchFieldException
public final Field getField()
public final Object getInstance()
public final Object get() throws IllegalAccessException
IllegalAccessException
- Failed to get field value.public final void set(Object value) throws IllegalAccessException
value
- Field value.IllegalAccessException
- Failed to set field value.Copyright © 2018 JBoss by Red Hat. All rights reserved.