Package com.yahoo.processing.request
Class CloneHelper
java.lang.Object
com.yahoo.processing.request.CloneHelper
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
-
Method Summary
Modifier and TypeMethodDescriptionfinal Object
Clones this object if it is clonable, and the clone is public.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)
-
Constructor Details
-
CloneHelper
public CloneHelper()
-
-
Method Details
-
clone
Clones this object if it is clonable, and the clone is public. Returns null if not. -
objectClone
-
cloneMap
Clones a map by deep cloning each value which is cloneable and shallow copying all other values.
-