Example usage for Java java.util Objects fields, constructors, methods, implement or subclass
The text is from its open source code.
int | compare(T a, T b, Comparator super T> c) Returns 0 if the arguments are identical and c.compare(a, b) otherwise. |
boolean | deepEquals(Object a, Object b) Returns true if the arguments are deeply equal to each other and false otherwise. |
boolean | equals(Object a, Object b) Returns true if the arguments are equal to each other and false otherwise. |
int | hash(Object... values) Generates a hash code for a sequence of input values. |
int | hashCode(Object o) Returns the hash code of a non- null argument and 0 for a null argument. |
boolean | isNull(Object obj) Returns true if the provided reference is null otherwise returns false . |
boolean | nonNull(Object obj) Returns true if the provided reference is non- null otherwise returns false . |
T | requireNonNull(T obj) Checks that the specified object reference is not null . |
T | requireNonNull(T obj, String message) Checks that the specified object reference is not null and throws a customized NullPointerException if it is. |
T | requireNonNull(T obj, Supplier Checks that the specified object reference is not null and throws a customized NullPointerException if it is. |
T | requireNonNullElse(T obj, T defaultObj) Returns the first argument if it is non- null and otherwise returns the non- null second argument. |
String | toString(Object o, String nullDefault) Returns the result of calling toString on the first argument if the first argument is not null and returns the second argument otherwise. |
String | toString(Object o) Returns the result of calling toString for a non- null argument and "null" for a null argument. |