Package com.yahoo.processing.request
Class CloneHelper
- java.lang.Object
-
- com.yahoo.processing.request.CloneHelper
-
public class CloneHelper extends Object
Helps to deep clone complex objects The following classes and their subclasses does have a fastpath - com.yahoo.component.provider.FreezableClass - com.yahoo.processing.request.properties.PublicCloneable BTW, this is the one you should implement too if you want the fastpath. - java.util.LinkedList - java.util.ArrayList The rest has the slow path with reflection, though using a fast thread safe method cache for speedup.- Author:
- bratseth, baldersheim
-
-
Constructor Summary
Constructors Constructor Description CloneHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
clone(Object object)
Clones this object if it is clonable, and the clone is public.Map<CompoundName,Object>
cloneMap(Map<CompoundName,Object> map)
Clones a map by deep cloning each value which is cloneable and shallow copying all other values.protected Object
objectClone(Object object)
-
-
-
Method Detail
-
clone
public final Object clone(Object object)
Clones this object if it is clonable, and the clone is public. Returns null if not
-
cloneMap
public Map<CompoundName,Object> cloneMap(Map<CompoundName,Object> map)
Clones a map by deep cloning each value which is cloneable and shallow copying all other values.
-
-