public class ObjectWriter
extends java.lang.Object
Constructor and Description |
---|
ObjectWriter() |
Modifier and Type | Method and Description |
---|---|
void |
copyTo(java.lang.Object source,
java.lang.Object destination,
java.lang.Class<?> commonType)
Copy every field in object A to object B.
|
protected void |
transformField(StructureModifier<java.lang.Object> modifierSource,
StructureModifier<java.lang.Object> modifierDest,
int fieldIndex)
Called for every non-static field that will be copied.
|
public void copyTo(java.lang.Object source, java.lang.Object destination, java.lang.Class<?> commonType)
The two objects must have the same number of fields of the same type.
source
- - fields to copy.destination
- - fields to copy to.commonType
- - type containing each field to copy.protected void transformField(StructureModifier<java.lang.Object> modifierSource, StructureModifier<java.lang.Object> modifierDest, int fieldIndex)
modifierSource
- - modifier for the original object.modifierDest
- - modifier for the new cloned object.fieldIndex
- - the current field index.