public abstract class Equivalence extends Object
Equivalence.DEFAULT
,
Equivalence.IDENTITY
, and Equivalence.IDENTITY_WITH_SYSTEM_HASHCODE
.Modifier and Type | Field and Description |
---|---|
static Equivalence |
DEFAULT
Default equivalence calling
Object.equals(Object) to check equality and Object.hashCode()
for obtaining hash values. |
static Equivalence |
IDENTITY
Identity equivalence using
== to check equality and Object.hashCode() for obtaining
hash values. |
static Equivalence |
IDENTITY_WITH_SYSTEM_HASHCODE
Identity equivalence using
== to check equality and
System.identityHashCode(Object) for obtaining hash values. |
Modifier | Constructor and Description |
---|---|
protected |
Equivalence()
Subclass for creating custom equivalence definitions.
|
Modifier and Type | Method and Description |
---|---|
abstract boolean |
equals(Object a,
Object b)
Returns
true if the non-null arguments are equal to each other and
false otherwise. |
abstract int |
hashCode(Object o)
Returns the hash code of a non-
null argument o . |
public static final Equivalence DEFAULT
Object.equals(Object)
to check equality and Object.hashCode()
for obtaining hash values. Do not change the logic of this class as it may be inlined in
other places.public static final Equivalence IDENTITY
==
to check equality and Object.hashCode()
for obtaining
hash values. Do not change the logic of this class as it may be inlined in other places.public static final Equivalence IDENTITY_WITH_SYSTEM_HASHCODE
==
to check equality and
System.identityHashCode(Object)
for obtaining hash values. Do not change the logic of
this class as it may be inlined in other places.