Interface HashingStrategy<T>
public interface HashingStrategy<T>
Abstraction for hash code generation and equality comparison.
-
Field Summary
Fields -
Method Summary
-
Field Details
-
JAVA_HASHER
-
-
Method Details
-
hashCode
Generate a hash code forobj.This method must obey the same relationship that
Object.hashCode()has withObject.equals(Object):- Calling this method multiple times with the same
objshould return the same result - If
equals(Object, Object)with parametersaandbreturnstruethen the return value for this method for parametersaandbmust return the same result - If
equals(Object, Object)with parametersaandbreturnsfalsethen the return value for this method for parametersaandbdoes not have to return different results results. However this property is desirable. - if
objisnullthen this method return0
- Calling this method multiple times with the same
-
equals
Returnstrueif the arguments are equal to each other andfalseotherwise. This method has the following restrictions:- reflexive -
equals(a, a)should return true - symmetric -
equals(a, b)returnstrueifequals(b, a)returnstrue - transitive - if
equals(a, b)returnstrueandequals(a, c)returnstruethenequals(b, c)should also returntrue - consistent -
equals(a, b)should return the same result when called multiple times assumingaandbremain unchanged relative to the comparison criteria - if
aandbare bothnullthen this method returnstrue - if
aisnullandbis non-null, orais non-nullandbisnullthen this method returnsfalse
- reflexive -
-