public final class CompareUtil
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
nullSafeEquals(java.lang.Object obj1,
java.lang.Object obj2)
Checks if two objects (eventually null) are the same.
|
static int |
nullSafeHashCode(java.lang.Object obj)
Returns
0 if the object is null, the hash code of the object
otherwise. |
public static boolean nullSafeEquals(java.lang.Object obj1,
java.lang.Object obj2)
obj1 - The first object to check.obj2 - The second object to check.true if the objects are the same.public static int nullSafeHashCode(java.lang.Object obj)
0 if the object is null, the hash code of the object
otherwise.obj - The object from which the hash code must be calculated..