Modifier and Type | Field and Description |
---|---|
static HashCodeCalculator<java.lang.Object> |
NATURAL
Default hash code calculator which just uses
the object's own hash code implementation.
|
static HashCodeCalculator<java.lang.Object> |
NATURAL_NULL_SAFE
Default hash code calculator which just uses
the object's own hash code implementation, but takes care of
null values. |
static HashCodeCalculator<java.lang.Object> |
OBJECTS
Default hash code calculator which just uses
Objects.hashCode(java.lang.Object) . |
Modifier and Type | Method and Description |
---|---|
int |
getHashCode(T obj)
Get the hash code value of the given object.
|
static <K> HashCodeCalculator<K> |
natural()
Get a hash code calculator which uses
the object's own hashcode implementation.
|
static <K> HashCodeCalculator<K> |
naturalNullSafe()
Get a hash code calculator which uses
the object's own hashcode implementation,
but takes care of
null values. |
static <K> HashCodeCalculator<K> |
objects()
Get a hash code calculator which uses
Objects.hashCode(java.lang.Object) . |
static final HashCodeCalculator<java.lang.Object> OBJECTS
Objects.hashCode(java.lang.Object)
.static final HashCodeCalculator<java.lang.Object> NATURAL
null
objects.static final HashCodeCalculator<java.lang.Object> NATURAL_NULL_SAFE
null
values.int getHashCode(T obj)
obj
- object for which the hash code is requested@NotNull static <K> HashCodeCalculator<K> objects()
Objects.hashCode(java.lang.Object)
.K
- object type@NotNull static <K> HashCodeCalculator<K> natural()
null
objects.
Use naturalNullSafe()
to avoid this.K
- object type@NotNull static <K> HashCodeCalculator<K> naturalNullSafe()
null
values.K
- object type