java.lang.Object
org.jfree.chart.util.ObjectUtils
A collection of useful static utility methods for handling classes and object
instantiation.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Object
Returns a clone of the specified object, if it can be cloned, otherwise throws a CloneNotSupportedException.static Collection
deepClone
(Collection collection) Returns a new collection containing clones of all the items in the specified collection.static boolean
Deprecated.Use Objects.equals() from the JDK.static int
Returns a hash code for an object, or zero if the object isnull
.
-
Method Details
-
equal
Deprecated.Use Objects.equals() from the JDK.Returnstrue
if the two objects are equal OR bothnull
.- Parameters:
o1
- object 1 (null
permitted).o2
- object 2 (null
permitted).- Returns:
true
orfalse
.
-
hashCode
Returns a hash code for an object, or zero if the object isnull
.- Parameters:
object
- the object (null
permitted).- Returns:
- The object's hash code (or zero if the object is
null
).
-
clone
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
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.
-