Interface Cloneable
-
- All Superinterfaces:
Manageable
public interface Cloneable extends Manageable
An entity that can be cloned/copied- Author:
- Shashank Sharma
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
Cloneable.CopiedEntityCallback<E extends Manageable>
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default <E extends Manageable>
Eclone(Cloneable.CopiedEntityCallback<E> callback)
Provides an implementation of cloning a document and saving it inside the database.default <E extends Manageable>
Ecopy()
Copies an entity but does not save it in the database.default <E extends Manageable>
EsimpleClone()
Simple clone with identity callback-
Methods inherited from interface com.alpha.mongodb.entitymanager.entity.Manageable
detach, getEntityInformation, isManaged
-
-
-
-
Method Detail
-
clone
default <E extends Manageable> E clone(Cloneable.CopiedEntityCallback<E> callback) throws ManagedEntityRuntimeException
Provides an implementation of cloning a document and saving it inside the database. A callback can be provided that will be applied after copying the entity- Type Parameters:
E
- type of the entity- Parameters:
callback
- Callback to be applied on the copied entity before saving it to the database- Returns:
- a managed entity that is a clone of this object
- Throws:
ManagedEntityRuntimeException
- Managed Entity Runtime exception
-
simpleClone
default <E extends Manageable> E simpleClone() throws ManagedEntityRuntimeException
Simple clone with identity callback- Type Parameters:
E
- type of the entity- Returns:
- a managed entity that is a clone of this object
- Throws:
ManagedEntityRuntimeException
- Managed Entity Runtime exception
-
copy
default <E extends Manageable> E copy() throws ManagedEntityRuntimeException
Copies an entity but does not save it in the database.- Returns:
- a managed entity that is a copy of this object
- Throws:
ManagedEntityRuntimeException
- Managed Entity Runtime exception
-
-