Package org.jfree.chart.util
Class ObjectUtils
- java.lang.Object
-
- org.jfree.chart.util.ObjectUtils
-
public final class ObjectUtils extends java.lang.ObjectA collection of useful static utility methods for handling classes and object instantiation.
-
-
Constructor Summary
Constructors Modifier Constructor Description privateObjectUtils()Default constructor - private.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static java.lang.Objectclone(java.lang.Object object)Returns a clone of the specified object, if it can be cloned, otherwise throws a CloneNotSupportedException.static java.util.CollectiondeepClone(java.util.Collection collection)Returns a new collection containing clones of all the items in the specified collection.static booleanequal(java.lang.Object o1, java.lang.Object o2)Deprecated.Use Objects.equals() from the JDK.static inthashCode(java.lang.Object object)Returns a hash code for an object, or zero if the object isnull.
-
-
-
Method Detail
-
equal
public static boolean equal(java.lang.Object o1, java.lang.Object o2)Deprecated.Use Objects.equals() from the JDK.Returnstrueif the two objects are equal OR bothnull.- Parameters:
o1- object 1 (nullpermitted).o2- object 2 (nullpermitted).- Returns:
trueorfalse.
-
hashCode
public static int hashCode(java.lang.Object object)
Returns a hash code for an object, or zero if the object isnull.- Parameters:
object- the object (nullpermitted).- Returns:
- The object's hash code (or zero if the object is
null).
-
clone
public static java.lang.Object clone(java.lang.Object object) throws java.lang.CloneNotSupportedExceptionReturns a clone of the specified object, if it can be cloned, otherwise throws a CloneNotSupportedException.- Parameters:
object- the object to clone (nullnot permitted).- Returns:
- A clone of the specified object.
- Throws:
java.lang.CloneNotSupportedException- if the object cannot be cloned.
-
deepClone
public static java.util.Collection deepClone(java.util.Collection collection) throws java.lang.CloneNotSupportedExceptionReturns a new collection containing clones of all the items in the specified collection.- Parameters:
collection- the collection (nullnot permitted).- Returns:
- A new collection containing clones of all the items in the specified collection.
- Throws:
java.lang.CloneNotSupportedException- if any of the items in the collection cannot be cloned.
-
-