- All Known Subinterfaces:
TrivialCopier<T>
- All Known Implementing Classes:
NoopCopier,NullCopier,TwoPhaseObjectCopier
public interface ObjectCopier<T>
Copier for the specific object type.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ObjectCopier<?>Singleton instance ofCloneableCopier.static final ObjectCopier<?>Singleton instance ofCopyableCopier.static final ObjectCopier<?>Singleton instance ofNoopCopier.static final ObjectCopier<?>Singleton instance ofNullCopier.static final ObjectCopier<?>Singleton instance ofObjectArrayCopier. -
Method Summary
Modifier and TypeMethodDescriptioncopy(T original, CopyContext context) Creates a copy of the original object.
-
Field Details
-
NULL
Singleton instance ofNullCopier. -
NOOP
Singleton instance ofNoopCopier. -
CLONEABLE
Singleton instance ofCloneableCopier. -
OBJECT_ARRAY
Singleton instance ofObjectArrayCopier. -
COPYABLE
Singleton instance ofCopyableCopier.
-
-
Method Details
-
copy
Creates a copy of the original object. The implementation MUST callCopyContext.register(Object)method.- Parameters:
original- original objectcontext- copying context ornullif the copier is trivial- Returns:
- copy result
- Throws:
Exception- if something went wrong
-