Package org.ehcache.spi.copy
Interface Copier<T>
- Type Parameters:
T- the type of the instance to copy
public interface Copier<T>
Defines the contract used to copy type instances.
The copied object's class must be preserved. The following must always be true:
object.getClass().equals( myCopier.copyForRead(object).getClass() )
object.getClass().equals( myCopier.copyForWrite(object).getClass() )
-
Method Summary
Modifier and TypeMethodDescriptioncopyForRead(T obj) Creates a copy of the instance passed in.copyForWrite(T obj) Creates a copy of the instance passed in.
-
Method Details
-
copyForRead
Creates a copy of the instance passed in.This method is invoked as a value is read from the cache.
- Parameters:
obj- the instance to copy- Returns:
- the copy of the
objinstance
-
copyForWrite
Creates a copy of the instance passed in.This method is invoked as a value is written to the cache.
- Parameters:
obj- the instance to copy- Returns:
- the copy of the
objinstance
-