T
- the type of the instance to copypublic interface Copier<T>
The copied object's class must be preserved in such a way that copying for read that object will return an object of the exact same class as before copy for write, i.e.: the following contract must always be true:
object.getClass().equals( myCopier.copyForRead(myCopier.copyForWrite(object)).getClass() )
Modifier and Type | Method and Description |
---|---|
T |
copyForRead(T obj)
Creates a copy of the instance passed in.
|
T |
copyForWrite(T obj)
Creates a copy of the instance passed in.
|