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 Details

    • CloneHelper

      public CloneHelper()
  • Method Details

    • clone

      public final Object clone(Object object)
      Clones this object if it is clonable, and the clone is public. Returns null if not.
    • objectClone

      protected Object objectClone(Object object)
    • 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.