Package org.ikasan.flow.event
Class ClonerReplicationFactory<T>
- java.lang.Object
-
- org.ikasan.flow.event.ClonerReplicationFactory<T>
-
- All Implemented Interfaces:
org.ikasan.spec.event.ReplicationFactory<T>
public class ClonerReplicationFactory<T> extends java.lang.Object implements org.ikasan.spec.event.ReplicationFactory<T>Implementation of the replicationFactory contract.- Author:
- Ikasan Development Team
-
-
Constructor Summary
Constructors Constructor Description ClonerReplicationFactory(com.rits.cloning.Cloner cloner)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Treplicate(T object)Return a completely independent deep copy instance of the incoming object.TshallowReplicate(T object)Return a completely independent shallow copy instance of the incoming object.
-
-
-
Method Detail
-
replicate
public T replicate(T object)
Return a completely independent deep copy instance of the incoming object. The returned object can be freely mutated without any consequential changes being made to the originating object.- Specified by:
replicatein interfaceorg.ikasan.spec.event.ReplicationFactory<T>- Parameters:
object- to be replicated- Returns:
- deep replicated object
-
shallowReplicate
public T shallowReplicate(T object)
Return a completely independent shallow copy instance of the incoming object. The returned object CANNOT be freely mutated without any consequential changes being made to the originating object. Use with care - the returned object may share references with the original object.- Specified by:
shallowReplicatein interfaceorg.ikasan.spec.event.ReplicationFactory<T>- Parameters:
object- to be replicated- Returns:
- shallow replicated object
-
-