public abstract class ObjectUtils
extends java.lang.Object
Constructor and Description |
---|
ObjectUtils() |
Modifier and Type | Method and Description |
---|---|
static java.util.List |
clone(java.util.List list)
Returns a clone of the list.
|
static java.lang.Object |
clone(java.lang.Object object)
Returns a clone of the object if the object implements the
PublicCloneable
interface otherwise the original object reference is returned. |
static boolean |
equal(java.lang.Object o1,
java.lang.Object o2)
Returns
true if the two objects are equal OR both null . |
static boolean |
equalOrBothNull(java.lang.Object o1,
java.lang.Object o2)
Deprecated.
Use ObjectUtils.equal().
|
static int |
hashCode(java.lang.Object object)
Returns a hash code for an object, or zero if the object is
null . |
public static boolean equal(java.lang.Object o1, java.lang.Object o2)
true
if the two objects are equal OR both null
.o1
- object 1 (null
permitted).o2
- object 2 (null
permitted).true
or false
.public static int hashCode(java.lang.Object object)
null
.object
- the object (null
permitted).null
).public static java.lang.Object clone(java.lang.Object object) throws java.lang.CloneNotSupportedException
PublicCloneable
interface otherwise the original object reference is returned.object
- the object to clone (null
permitted).java.lang.CloneNotSupportedException
- if the object cannot be cloned.public static java.util.List clone(java.util.List list) throws java.lang.CloneNotSupportedException
PublicCloneable
interface, otherwise the reference to the original object is
retained in the cloned list.list
- the list.java.lang.CloneNotSupportedException
- if the list could not be cloned.public static boolean equalOrBothNull(java.lang.Object o1, java.lang.Object o2)
true
if the two objects are equal OR both null
.o1
- object 1.o2
- object 2.true
or false
.