Package io.debezium.util
Class HashCode
java.lang.Object
io.debezium.util.HashCode
Utilities for easily computing hash codes. The algorithm should generally produce good distributions for use in hash-based
containers or collections, but as expected does always result in repeatable hash codes given the inputs.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
Compute a combined hash code from the supplied objects.private static int
computeHashCode
(int seed, Object... objects) Compute a combined hash code from the supplied objects using the supplied seed.
-
Field Details
-
PRIME
private static final int PRIME- See Also:
-
-
Constructor Details
-
HashCode
private HashCode()
-
-
Method Details
-
compute
Compute a combined hash code from the supplied objects. This method always returns 0 if no objects are supplied.- Parameters:
objects
- the objects that should be used to compute the hash code- Returns:
- the hash code
-
computeHashCode
Compute a combined hash code from the supplied objects using the supplied seed.- Parameters:
seed
- a value upon which the hash code will be based; may be 0objects
- the objects that should be used to compute the hash code- Returns:
- the hash code
-