Maven module :un.api : api-common :
Class : un.api.collection.Hasher
Extends/Implements : -
Subclasses : -

Objects always have a default hash value which is sufficient for most cases.
More optimized hashes could be build when various conditions are met.
Used by hash collections to compute hash value and equality between objects.
author  Johann Sorel


Variables : DEFAULT, IDENTITY
Functions : getHash, equals



Default hasher, used objects hash and equals method.
public Hasher DEFAULT


Hasher which test equality with an identity test.
public Hasher IDENTITY



Calculate hash of given object.
param  candidate
return  hash value
int getHash (Object candidate)


Test if the two given objects are equals.
Any two objects that are equal must have the same hash value.
param  a
param  b
return  true if objects are equal.
boolean equals (Object a, Object b)