Class ObjectUtils

java.lang.Object
org.jfree.chart.util.ObjectUtils

public final class ObjectUtils extends Object
A collection of useful static utility methods for handling classes and object instantiation.
  • Method Details

    • equal

      public static boolean equal(Object o1, Object o2)
      Deprecated.
      Use Objects.equals() from the JDK.
      Returns true if the two objects are equal OR both null.
      Parameters:
      o1 - object 1 (null permitted).
      o2 - object 2 (null permitted).
      Returns:
      true or false.
    • hashCode

      public static int hashCode(Object object)
      Returns a hash code for an object, or zero if the object is null.
      Parameters:
      object - the object (null permitted).
      Returns:
      The object's hash code (or zero if the object is null).
    • clone

      public static Object clone(Object object) throws 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:
      CloneNotSupportedException - if the object cannot be cloned.
    • deepClone

      public static Collection deepClone(Collection collection) throws CloneNotSupportedException
      Returns a new collection containing clones of all the items in the specified collection.
      Parameters:
      collection - the collection (null not permitted).
      Returns:
      A new collection containing clones of all the items in the specified collection.
      Throws:
      CloneNotSupportedException - if any of the items in the collection cannot be cloned.