Top Description Fields Constructors Methods
org.graalvm.collections

public abstract Class Equivalence

extends Object
Class Inheritance

Strategy for comparing two objects. Default predefined strategies are DEFAULT, IDENTITY, and IDENTITY_WITH_SYSTEM_HASHCODE.
Since
19.0

Field Summary

Modifier and TypeField and Description
public static final Equivalence
DEFAULT

Default equivalence calling equals(Object) to check equality and hashCode() for obtaining hash values.

public static final Equivalence
IDENTITY

Identity equivalence using == to check equality and hashCode() for obtaining hash values.

public static final Equivalence
IDENTITY_WITH_SYSTEM_HASHCODE

Identity equivalence using == to check equality and System#identityHashCode(Object) for obtaining hash values.

Constructor Summary

AccessConstructor and Description
protected
Equivalence()

Subclass for creating custom equivalence definitions.

Method Summary

Modifier and TypeMethod and Description
public abstract boolean
equals(Object a, Object b)

Returns true if the non-null arguments are equal to each other and false otherwise.

public abstract int
hashCode(Object o)

Returns the hash code of a non-null argument o.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULTback to summary
public static final Equivalence DEFAULT

Default equivalence calling equals(Object) to check equality and hashCode() for obtaining hash values. Do not change the logic of this class as it may be inlined in other places.

Since
19.0
IDENTITYback to summary
public static final Equivalence IDENTITY

Identity equivalence using == to check equality and 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_HASHCODEback to summary
public static final Equivalence IDENTITY_WITH_SYSTEM_HASHCODE

Identity equivalence using == 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.

Since
19.0

Constructor Detail

Equivalenceback to summary
protected Equivalence()

Subclass for creating custom equivalence definitions.

Since
19.0

Method Detail

equalsback to summary
public abstract boolean equals(Object a, Object b)

Returns true if the non-null arguments are equal to each other and false otherwise.

Since
19.0
hashCodeback to summary
public abstract int hashCode(Object o)

Returns the hash code of a non-null argument o.

Since
19.0