Interface ObjectCopier<T>

All Known Subinterfaces:
TrivialCopier<T>
All Known Implementing Classes:
NoopCopier, NullCopier, TwoPhaseObjectCopier

public interface ObjectCopier<T>
Copier for the specific object type.
  • Field Details

    • NULL

      static final ObjectCopier<?> NULL
      Singleton instance of NullCopier.
    • NOOP

      static final ObjectCopier<?> NOOP
      Singleton instance of NoopCopier.
    • CLONEABLE

      static final ObjectCopier<?> CLONEABLE
      Singleton instance of CloneableCopier.
    • OBJECT_ARRAY

      static final ObjectCopier<?> OBJECT_ARRAY
      Singleton instance of ObjectArrayCopier.
    • COPYABLE

      static final ObjectCopier<?> COPYABLE
      Singleton instance of CopyableCopier.
  • Method Details

    • copy

      T copy(T original, CopyContext context) throws Exception
      Creates a copy of the original object. The implementation MUST call CopyContext.register(Object) method.
      Parameters:
      original - original object
      context - copying context or null if the copier is trivial
      Returns:
      copy result
      Throws:
      Exception - if something went wrong