public class ObjectUtils extends Object
Operations on Object.
| Constructor and Description |
|---|
ObjectUtils() |
public static boolean equals(Object object1, 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 sameCopyright © 2014. All rights reserved.