Package one.microstream.hashing
Interface Hasher.ImmutableHashCode<E>
-
- Type Parameters:
E
-
- All Superinterfaces:
Hasher<E>
- All Known Subinterfaces:
HashEqualator.IdentityHashEqualator<E>
,HashEqualator.ImmutableHashEqualator<E>
,HashEqualator.ImmutableValueTypeHashEqualator<E>
,Hasher.IdentityHashCode<E>
public static interface Hasher.ImmutableHashCode<E> extends Hasher<E>
Type interface to indicate that the implementingHasher
implementation will always return the same hash value for the same object.
This is true for immutable objects (such as instances ofString
) or for the identity hash code provided bySystem.identityHashCode(Object)
.
The behavior can also be achieved by caching a once created hash code object-externally in theHasher
implementation to ensure unchanging hash codes even for objects that are mutable in terms of theirObject.equals(Object)
implemententation.The purpose of this marker interface is to indicate that using an implementation of it will not create hash values that will mess up a hash-based element distribution, which allows certain algorithm optimisations, for example in hashing collections.
- See Also:
Hasher.IdentityHashCode
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface one.microstream.hashing.Hasher
Hasher.IdentityHashCode<E>, Hasher.ImmutableHashCode<E>, Hasher.ValueHashCode<E>
-
-