Package org.eclipse.rdf4j.common.lang
Class ObjectUtil
- java.lang.Object
-
- org.eclipse.rdf4j.common.lang.ObjectUtil
-
public class ObjectUtil extends Object
Generic utility methods related to objects.- Author:
- Arjohn Kampman
-
-
Constructor Summary
Constructors Constructor Description ObjectUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
nullEquals(Object o1, Object o2)
Compares two objects or null references.static int
nullHashCode(Object o)
Returns the hash code of the supplied object, or 0 if a null reference is supplied.
-
-
-
Method Detail
-
nullEquals
public static boolean nullEquals(Object o1, Object o2)
Compares two objects or null references.- Parameters:
o1
- The first object.o2
- The second object- Returns:
- true if both objects are null, if the object references are identical, or if the
objects are equal according to the
Object.equals(java.lang.Object)
method of the first object; false in all other situations.
-
nullHashCode
public static int nullHashCode(Object o)
Returns the hash code of the supplied object, or 0 if a null reference is supplied.- Parameters:
o
- An object or null reference.- Returns:
- The object's hash code, or 0 if the parameter is null.
-
-