Class ReadWriteCopier<T>

java.lang.Object
org.ehcache.impl.copy.ReadWriteCopier<T>
All Implemented Interfaces:
org.ehcache.spi.copy.Copier<T>
Direct Known Subclasses:
IdentityCopier, SerializingCopier

public abstract class ReadWriteCopier<T> extends Object implements org.ehcache.spi.copy.Copier<T>
A helper Copier implementation that can be extended directly if the copying operation is the same irrespective of the action performed (read or write).
  • Constructor Details

    • ReadWriteCopier

      public ReadWriteCopier()
  • Method Details

    • copyForRead

      public T copyForRead(T obj)
      Specified by:
      copyForRead in interface org.ehcache.spi.copy.Copier<T>
    • copyForWrite

      public T copyForWrite(T obj)
      Specified by:
      copyForWrite in interface org.ehcache.spi.copy.Copier<T>
    • copy

      public abstract T copy(T obj)
      Template copy method to be implemented by sub-classes.

      It will be invoked when copyForRead(Object) or copyForWrite(Object) is invoked on Copier.

      Parameters:
      obj - the instance to copy
      Returns:
      a copied instance, depending on the implementation