public class ObjectWriter extends Object
| Constructor and Description |
|---|
ObjectWriter() |
| Modifier and Type | Method and Description |
|---|---|
void |
copyTo(Object source,
Object destination,
Class<?> commonType)
Copy every field in object A to object B.
|
protected void |
transformField(StructureModifier<Object> modifierSource,
StructureModifier<Object> modifierDest,
int fieldIndex)
Called for every non-static field that will be copied.
|
public void copyTo(Object source, Object destination, 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<Object> modifierSource, StructureModifier<Object> modifierDest, int fieldIndex)
modifierSource - - modifier for the original object.modifierDest - - modifier for the new cloned object.fieldIndex - - the current field index.Copyright © 2012–2017 Comphenix and dmulloy2. Licensed under the GNU GPL v2.