Package org.graalvm.collections
Class Equivalence
java.lang.Object
org.graalvm.collections.Equivalence
Strategy for comparing two objects. Default predefined strategies are
DEFAULT
,
IDENTITY
, and IDENTITY_WITH_SYSTEM_HASHCODE
.- Since:
- 19.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Equivalence
Default equivalence callingObject.equals(Object)
to check equality andObject.hashCode()
for obtaining hash values.static final Equivalence
Identity equivalence using==
to check equality andObject.hashCode()
for obtaining hash values.static final Equivalence
Identity equivalence using==
to check equality andSystem.identityHashCode(Object)
for obtaining hash values. -
Constructor Summary
ModifierConstructorDescriptionprotected
Subclass for creating custom equivalence definitions. -
Method Summary
-
Field Details
-
DEFAULT
Default equivalence callingObject.equals(Object)
to check equality andObject.hashCode()
for obtaining hash values. Do not change the logic of this class as it may be inlined in other places.- Since:
- 19.0
-
IDENTITY
Identity equivalence using==
to check equality andObject.hashCode()
for obtaining hash values. Do not change the logic of this class as it may be inlined in other places.- Since:
- 19.0
-
IDENTITY_WITH_SYSTEM_HASHCODE
Identity equivalence using==
to check equality andSystem.identityHashCode(Object)
for obtaining hash values. Do not change the logic of this class as it may be inlined in other places.- Since:
- 19.0
-
-
Constructor Details
-
Equivalence
protected Equivalence()Subclass for creating custom equivalence definitions.- Since:
- 19.0
-
-
Method Details
-
equals
Returnstrue
if the non-null
arguments are equal to each other andfalse
otherwise.- Since:
- 19.0
-
hashCode
Returns the hash code of a non-null
argumento
.- Since:
- 19.0
-