Interface WorkingCopier<T>
- Type Parameters:
T- class of the object that will get copied
- All Known Implementing Classes:
RecursiveWorkingCopier
public interface WorkingCopier<T>
Creates, registers and deregisters Instances of working copies. Working copies are object instances that are a copy
of the objects in the actual datastore.
-
Method Summary
Modifier and TypeMethodDescription<L extends Collection<T>>
Lcopy(L objectCollectionToCopy) Creates new instances of each element of the given collection and registers it in theWorkingCopyRegistry.Creates a new instance of the given object and registers it in theWorkingCopyRegistry.voidderegister(T workingCopy) Unregister the working copy object from theWorkingCopyRegistry.getOriginal(T workingCopy) Merges the values of the given object back into the original object from the date store.<E> EonlyCreateCopy(E objectToCopy, boolean invertRegistry)
-
Method Details
-
copy
Creates a new instance of the given object and registers it in theWorkingCopyRegistry.- Returns:
- new instance of the object
-
copy
Creates new instances of each element of the given collection and registers it in theWorkingCopyRegistry.- Returns:
- new collection with new instances
-
mergeBack
Merges the values of the given object back into the original object from the date store.- Parameters:
workingCopy- to merge back into the original object- Returns:
- all the changed objects that must get stored
-
onlyCreateCopy
<E> E onlyCreateCopy(E objectToCopy, boolean invertRegistry) -
getOriginal
- Returns:
- the original entity that corresponds to the given working copy object.
-
deregister
Unregister the working copy object from theWorkingCopyRegistry.
-