java.lang.Object | |
↳ | java.util.Objects |
Utility methods for objects.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns 0 if
a == b , or c.compare(a, b) otherwise.
| |||||||||||
Returns true if both arguments are null,
the result of
equals(boolean[], boolean[]) if both arguments are primitive arrays,
the result of deepEquals(Object[], Object[]) if both arguments are arrays of reference types,
and the result of equals(Object) otherwise.
| |||||||||||
Null-safe equivalent of
a.equals(b) .
| |||||||||||
Convenience wrapper for
hashCode() , adding varargs.
| |||||||||||
Returns 0 for null or
o.hashCode() .
| |||||||||||
Returns
o if non-null, or throws NullPointerException
with the given detail message.
| |||||||||||
Returns
o if non-null, or throws NullPointerException .
| |||||||||||
Returns
nullString for null or o.toString() .
| |||||||||||
Returns "null" for null or
o.toString() .
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Returns 0 if a == b
, or c.compare(a, b)
otherwise.
That is, this makes c
null-safe.
Returns true if both arguments are null,
the result of equals(boolean[], boolean[])
if both arguments are primitive arrays,
the result of deepEquals(Object[], Object[])
if both arguments are arrays of reference types,
and the result of equals(Object)
otherwise.
Null-safe equivalent of a.equals(b)
.
Convenience wrapper for hashCode()
, adding varargs.
This can be used to compute a hash code for an object's fields as follows:
Objects.hash(a, b, c)
.
Returns o
if non-null, or throws NullPointerException
with the given detail message.
Returns o
if non-null, or throws NullPointerException
.
Returns nullString
for null or o.toString()
.
Returns "null" for null or o.toString()
.