public class ObjectUtils
extends java.lang.Object
Operations on Object.
| Constructor and Description |
|---|
ObjectUtils() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
equals(java.lang.Object object1,
java.lang.Object object2)
Compares two objects for equality, where either one or both objects may be
null. |
public static boolean equals(java.lang.Object object1,
java.lang.Object object2)
Compares two objects for equality, where either one or both objects may be null.
ObjectUtils.equals(null, null) = true
ObjectUtils.equals(null, "") = false
ObjectUtils.equals("", null) = false
ObjectUtils.equals("", "") = true
ObjectUtils.equals(Boolean.TRUE, null) = false
ObjectUtils.equals(Boolean.TRUE, "true") = false
ObjectUtils.equals(Boolean.TRUE, Boolean.TRUE) = true
ObjectUtils.equals(Boolean.TRUE, Boolean.FALSE) = false
object1 - the first object, may be nullobject2 - the second object, may be nulltrue if the values of both objects are the same