HashingStrategy<K>
, java.io.Serializable
public class IdentityHashingStrategy<K> extends java.lang.Object implements HashingStrategy<K>
HashingStrategy
that does identity comparisons
(==) and uses System.identityHashCode(Object)
for hashCode generation.Modifier and Type | Field | Description |
---|---|---|
static IdentityHashingStrategy<java.lang.Object> |
INSTANCE |
A single instance that can be shared with multiple collections.
|
Constructor | Description |
---|---|
IdentityHashingStrategy() |
Modifier and Type | Method | Description |
---|---|---|
int |
computeHashCode(K object) |
Computes a hash code for the specified object.
|
boolean |
equals(K o1,
K o2) |
Compares o1 and o2 for equality.
|
public static final IdentityHashingStrategy<java.lang.Object> INSTANCE
public int computeHashCode(K object)
HashingStrategy
computeHashCode
in interface HashingStrategy<K>
object
- for which the hashcode is to be computedpublic boolean equals(K o1, K o2)
HashingStrategy
equals
in interface HashingStrategy<K>
o1
- an Object
valueo2
- an Object
value