de.caff.generics

## Interface HashCodeCalculator<T>

- All Known Implementing Classes:
    HashCoder

      public interface HashCodeCalculator<T>

  Calculator interface for generalized hash code calculation.

  Author:
    Rammi
  See Also:
    `Matcher`

- - ### Field Summary

    Fields
    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)`.

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    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)`.

- - ### Field Detail

    - #### OBJECTS

          static final HashCodeCalculator<java.lang.Object> OBJECTS

      Default hash code calculator which just uses `Objects.hashCode(java.lang.Object)`.

    - #### NATURAL

          static final HashCodeCalculator<java.lang.Object> NATURAL

      Default hash code calculator which just uses the object's own hash code implementation. Note that this requires non-`null` objects.

    - #### NATURAL_NULL_SAFE

          static final 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.

  - ### Method Detail

    - #### getHashCode

          int getHashCode(T obj)

      Get the hash code value of the given object.
      Parameters:
        `obj` - object for which the hash code is requested
      Returns:
        hash code

    - #### objects

          @NotNull
          static <K> HashCodeCalculator<K> objects()

      Get a hash code calculator which uses `Objects.hashCode(java.lang.Object)`.
      Type Parameters:
        `K` - object type
      Returns:
        natural hashCode implementation

    - #### natural

          @NotNull
          static <K> HashCodeCalculator<K> natural()

      Get a hash code calculator which uses the object's own hashcode implementation. Note that this requires non-`null` objects. Use `naturalNullSafe()` to avoid this.
      Type Parameters:
        `K` - object type
      Returns:
        natural hashCode implementation

    - #### naturalNullSafe

          @NotNull
          static <K> HashCodeCalculator<K> naturalNullSafe()

      Get a hash code calculator which uses the object's own hashcode implementation, but takes care of `null` values.
      Type Parameters:
        `K` - object type
      Returns:
        natural hashCode implementation