Class CloneUtils


  • public class CloneUtils
    extends java.lang.Object
    Utilities for cloning.
    • Constructor Summary

      Constructors 
      Constructor Description
      CloneUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Object clone​(java.lang.Object object)
      Returns a clone of the specified object, if it can be cloned, otherwise throws a CloneNotSupportedException.
      static java.util.List<?> cloneList​(java.util.List<?> source)
      Returns a list containing cloned copies of the items in the source list.
      static java.util.Map cloneMapValues​(java.util.Map source)
      Returns a new map that contains the same keys and cloned copied of the values.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CloneUtils

        public CloneUtils()
    • Method Detail

      • clone

        public static java.lang.Object clone​(java.lang.Object object)
                                      throws java.lang.CloneNotSupportedException
        Returns a clone of the specified object, if it can be cloned, otherwise throws a CloneNotSupportedException.
        Parameters:
        object - the object to clone (null not permitted).
        Returns:
        A clone of the specified object.
        Throws:
        java.lang.CloneNotSupportedException - if the object cannot be cloned.
      • cloneList

        public static java.util.List<?> cloneList​(java.util.List<?> source)
        Returns a list containing cloned copies of the items in the source list.
        Parameters:
        source - the source list (null not permitted).
        Returns:
        A new list.
      • cloneMapValues

        public static java.util.Map cloneMapValues​(java.util.Map source)
        Returns a new map that contains the same keys and cloned copied of the values.
        Parameters:
        source - the source map (null not permitted).
        Returns:
        A new map.