public interface CloneBuilder
Modifier and Type | Method and Description |
---|---|
Object |
buildClone(Object original,
Descriptor descriptor)
Builds clone of the given object.
|
Object |
buildClone(Object cloneOwner,
Field clonedField,
Object original,
Descriptor descriptor)
Builds clone of the given object.
|
void |
mergeChanges(ObjectChangeSet changeSet)
Merges the changes on clone into the original object.
|
void |
removeVisited(Object instance,
Descriptor descriptor)
Removes the specified instance from the clone builder's visited entities cache.
|
void |
reset()
Resets the clone builder.
|
Object buildClone(Object original, Descriptor descriptor)
original
- Objectdescriptor
- Entity descriptorNullPointerException
- If original
or repository
is null
Object buildClone(Object cloneOwner, Field clonedField, Object original, Descriptor descriptor)
This method differs from buildClone(Object, cz.cvut.kbss.jopa.model.descriptors.Descriptor)
in that it
accepts another argument which represents the owner of the built clone.
This is useful in situations when we are cloning attributes directly, e.
g. when lazily loading a field value.
cloneOwner
- The owner of the created cloneclonedField
- The field whose value is being clonedoriginal
- The original to clonedescriptor
- Entity descriptorNullPointerException
- If cloneOwner
, original
or contextUri
is null
void reset()
Especially resets the visited objects cache to make sure all the clones are built from scratch and are not affected by the previously built ones.
void removeVisited(Object instance, Descriptor descriptor)
instance
- The instance to remove (original object).descriptor
- Instance descriptorvoid mergeChanges(ObjectChangeSet changeSet)
changeSet
- Contains changes to mergeCopyright © 2017 Czech Technical University in Prague, Knowledge Based and Software Systems Group. All rights reserved.