public interface FieldAdapter
Reads and writes one field of objects, created for the field by a
FieldAdapterFactory. Every accessor
matches the field type: getInt/setInt for an int field, getObject/setObject
for a reference field and so on. Final fields are written too: the cloner sets them on fresh copies only.-
Method Summary
Modifier and TypeMethodDescriptionbooleangetBoolean(Object target) Reads the value of thebooleanfield.byteReads the value of thebytefield.charReads the value of thecharfield.doubleReads the value of thedoublefield.floatReads the value of thefloatfield.intReads the value of theintfield.longReads the value of thelongfield.<T> TReads the value of the reference field.shortReads the value of theshortfield.voidsetBoolean(Object target, boolean value) Writes the value of thebooleanfield.voidWrites the value of thebytefield.voidWrites the value of thecharfield.voidWrites the value of thedoublefield.voidWrites the value of thefloatfield.voidWrites the value of theintfield.voidWrites the value of thelongfield.<T> voidWrites the value of the reference field.voidWrites the value of theshortfield.
-
Method Details
-
getObject
Reads the value of the reference field.- Type Parameters:
T- value type- Parameters:
target- object holding the field- Returns:
- field value
- Throws:
Exception- if the field cannot be accessed
-
setObject
Writes the value of the reference field.- Type Parameters:
T- value type- Parameters:
target- object holding the fieldvalue- new value- Throws:
Exception- if the field cannot be accessed
-
getInt
Reads the value of theintfield.- Parameters:
target- object holding the field- Returns:
- field value
- Throws:
Exception- if the field cannot be accessed
-
setInt
Writes the value of theintfield.- Parameters:
target- object holding the fieldvalue- new value- Throws:
Exception- if the field cannot be accessed
-
getByte
Reads the value of thebytefield.- Parameters:
target- object holding the field- Returns:
- field value
- Throws:
Exception- if the field cannot be accessed
-
setByte
Writes the value of thebytefield.- Parameters:
target- object holding the fieldvalue- new value- Throws:
Exception- if the field cannot be accessed
-
getBoolean
Reads the value of thebooleanfield.- Parameters:
target- object holding the field- Returns:
- field value
- Throws:
Exception- if the field cannot be accessed
-
setBoolean
Writes the value of thebooleanfield.- Parameters:
target- object holding the fieldvalue- new value- Throws:
Exception- if the field cannot be accessed
-
getShort
Reads the value of theshortfield.- Parameters:
target- object holding the field- Returns:
- field value
- Throws:
Exception- if the field cannot be accessed
-
setShort
Writes the value of theshortfield.- Parameters:
target- object holding the fieldvalue- new value- Throws:
Exception- if the field cannot be accessed
-
getChar
Reads the value of thecharfield.- Parameters:
target- object holding the field- Returns:
- field value
- Throws:
Exception- if the field cannot be accessed
-
setChar
Writes the value of thecharfield.- Parameters:
target- object holding the fieldvalue- new value- Throws:
Exception- if the field cannot be accessed
-
getLong
Reads the value of thelongfield.- Parameters:
target- object holding the field- Returns:
- field value
- Throws:
Exception- if the field cannot be accessed
-
setLong
Writes the value of thelongfield.- Parameters:
target- object holding the fieldvalue- new value- Throws:
Exception- if the field cannot be accessed
-
getFloat
Reads the value of thefloatfield.- Parameters:
target- object holding the field- Returns:
- field value
- Throws:
Exception- if the field cannot be accessed
-
setFloat
Writes the value of thefloatfield.- Parameters:
target- object holding the fieldvalue- new value- Throws:
Exception- if the field cannot be accessed
-
getDouble
Reads the value of thedoublefield.- Parameters:
target- object holding the field- Returns:
- field value
- Throws:
Exception- if the field cannot be accessed
-
setDouble
Writes the value of thedoublefield.- Parameters:
target- object holding the fieldvalue- new value- Throws:
Exception- if the field cannot be accessed
-