de.caff.generics

## Interface Subjective<T>

- Type Parameters:
    `T` - type which this subjective is handling

      public interface Subjective<T>

  Type-based information how to create a `Subject` from an object. This is used to override standard Java object behavior, especially for `Object.equals(Object)` and `Object.hashCode()`.
  Since:
    February 12, 2023
  Author:
    Rammi

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `default T` | `cast(java.lang.Object object)` Cast any object to the type of this subjective.
    `Subject<T>` | `subject(T object)` Get the substitute object for the given object.
    `default Subject<T>` | `subjectFrom(java.lang.Object object)` Helper method to create a subject from an arbitrary object.
    `java.lang.Class<T>` | `type()` Get the subjective type.

- - ### Method Detail

    - #### type

          @NotNull
          java.lang.Class<T> type()

      Get the subjective type.
      Returns:
        type of subjectivized object.

    - #### cast

          @NotNull
          default T cast(@NotNull
                                  java.lang.Object object)

      Cast any object to the type of this subjective.
      Parameters:
        `object` - object to be cast
      Returns:
        object cast to type()
      Throws:
        `java.lang.ClassCastException` - if object has wrong type

    - #### subject

          @NotNull
          Subject<T> subject(@NotNull
                                      T object)

      Get the substitute object for the given object. Any implementation is expected to handle the incoming `object` as immutable, i.e. to never change it.
      Parameters:
        `object` - object to be substituted
      Returns:
        substitution object

    - #### subjectFrom

          @NotNull
          default Subject<T> subjectFrom(@NotNull
                                                  java.lang.Object object)

      Helper method to create a subject from an arbitrary object.
      Parameters:
        `object` - object expected to be of the type() of this subjective
      Returns:
        subjectivized `object`
      Throws:
        `java.lang.ClassCastException` - if object has wrong type