de.caff.generics.tuple

## Class Tuple

- java.lang.Object
- - de.caff.generics.tuple.Tuple

-     public final class Tuple
      extends java.lang.Object

  Tuple helper class. This provides the `of(...)` and `ofNullable(...)` tuple creation methods which are a bit more wordy versions of the `T(...)` and `N(...)` methods of `Tuples`.

  So both

       Tuple.of(a, b) // from this class
       T(a, b),  // requires import static Tuples.T;

  will return equal 2-tuples.
  Since:
    November 18, 2021
  Author:
    Rammi

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <T1,T2> Tuple2<T1,T2>` | `of(T1 value1, T2 value2)` Create a tuple with two non-null values.
    `static <T1,T2,T3> Tuple3<T1,T2,T3>` | `of(T1 value1, T2 value2, T3 value3)` Create a tuple with 3 non-null values.
    `static <T1,T2,T3,T4> Tuple4<T1,T2,T3,T4>` | `of(T1 value1, T2 value2, T3 value3, T4 value4)` Create a tuple with 4 non-null values.
    `static <T1,T2,T3,T4,T5> Tuple5<T1,T2,T3,T4,T5>` | `of(T1 value1, T2 value2, T3 value3, T4 value4, T5 value5)` Create a tuple with 5 non-null values.
    `static <T1,T2,T3,T4,T5,T6> Tuple6<T1,T2,T3,T4,T5,T6>` | `of(T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6)` Create a tuple with 6 non-null values.
    `static <T1,T2,T3,T4,T5,T6,T7> Tuple7<T1,T2,T3,T4,T5,T6,T7>` | `of(T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7)` Create a tuple with 7 non-null values.
    `static <T1,T2,T3,T4,T5,T6,T7,T8> Tuple8<T1,T2,T3,T4,T5,T6,T7,T8>` | `of(T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8)` Create a tuple with 8 non-null values.
    `static <T1,T2,T3,T4,T5,T6,T7,T8,T9> Tuple9<T1,T2,T3,T4,T5,T6,T7,T8,T9>` | `of(T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8, T9 value9)` Create a tuple with 9 non-null values.
    `static <T1,T2> NTuple2<T1,T2>` | `ofNullable(T1 value1, T2 value2)` Create a tuple with two values which can possibly be null.
    `static <T1,T2,T3> NTuple3<T1,T2,T3>` | `ofNullable(T1 value1, T2 value2, T3 value3)` Create a tuple with 3 values which can possibly be null.
    `static <T1,T2,T3,T4> NTuple4<T1,T2,T3,T4>` | `ofNullable(T1 value1, T2 value2, T3 value3, T4 value4)` Create a tuple with 4 values which can possibly be null.
    `static <T1,T2,T3,T4,T5> NTuple5<T1,T2,T3,T4,T5>` | `ofNullable(T1 value1, T2 value2, T3 value3, T4 value4, T5 value5)` Create a tuple with 5 values which can possibly be null.
    `static <T1,T2,T3,T4,T5,T6> NTuple6<T1,T2,T3,T4,T5,T6>` | `ofNullable(T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6)` Create a tuple with 6 values which can possibly be null.
    `static <T1,T2,T3,T4,T5,T6,T7> NTuple7<T1,T2,T3,T4,T5,T6,T7>` | `ofNullable(T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7)` Create a tuple with 7 values which can possibly be null.
    `static <T1,T2,T3,T4,T5,T6,T7,T8> NTuple8<T1,T2,T3,T4,T5,T6,T7,T8>` | `ofNullable(T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8)` Create a tuple with 8 values which can possibly be null.
    `static <T1,T2,T3,T4,T5,T6,T7,T8,T9> NTuple9<T1,T2,T3,T4,T5,T6,T7,T8,T9>` | `ofNullable(T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8, T9 value9)` Create a tuple with 9 values which can possibly be null.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### of

          @NotNull
          public static <T1,T2> Tuple2<T1,T2> of(@NotNull
                                                          T1 value1,
                                                          @NotNull
                                                          T2 value2)

      Create a tuple with two non-null values.
      Type Parameters:
        `T1` - type of first value
        `T2` - type of second value
      Parameters:
        `value1` - first value
        `value2` - second value
      Returns:
        2-tuple

    - #### ofNullable

          @NotNull
          public static <T1,T2> NTuple2<T1,T2> ofNullable(@Nullable
                                                                   T1 value1,
                                                                   @Nullable
                                                                   T2 value2)

      Create a tuple with two values which can possibly be null.
      Type Parameters:
        `T1` - type of first value
        `T2` - type of second value
      Parameters:
        `value1` - first value
        `value2` - second value
      Returns:
        2-tuple

    - #### of

          @NotNull
          public static <T1,T2,T3> Tuple3<T1,T2,T3> of(@NotNull
                                                                T1 value1,
                                                                @NotNull
                                                                T2 value2,
                                                                @NotNull
                                                                T3 value3)

      Create a tuple with 3 non-null values.
      Type Parameters:
        `T1` - type of first value
        `T2` - type of second value
        `T3` - type of third value
      Parameters:
        `value1` - first value
        `value2` - second value
        `value3` - third value
      Returns:
        3-tuple

    - #### ofNullable

          @NotNull
          public static <T1,T2,T3> NTuple3<T1,T2,T3> ofNullable(@Nullable
                                                                         T1 value1,
                                                                         @Nullable
                                                                         T2 value2,
                                                                         @Nullable
                                                                         T3 value3)

      Create a tuple with 3 values which can possibly be null.
      Type Parameters:
        `T1` - type of first value
        `T2` - type of second value
        `T3` - type of third value
      Parameters:
        `value1` - first value
        `value2` - second value
        `value3` - third value
      Returns:
        3-tuple

    - #### of

          @NotNull
          public static <T1,T2,T3,T4> Tuple4<T1,T2,T3,T4> of(@NotNull
                                                                      T1 value1,
                                                                      @NotNull
                                                                      T2 value2,
                                                                      @NotNull
                                                                      T3 value3,
                                                                      @NotNull
                                                                      T4 value4)

      Create a tuple with 4 non-null values.
      Type Parameters:
        `T1` - type of first value
        `T2` - type of second value
        `T3` - type of third value
        `T4` - type of fourth value
      Parameters:
        `value1` - first value
        `value2` - second value
        `value3` - third value
        `value4` - fourth value
      Returns:
        4-tuple

    - #### ofNullable

          @NotNull
          public static <T1,T2,T3,T4> NTuple4<T1,T2,T3,T4> ofNullable(@Nullable
                                                                               T1 value1,
                                                                               @Nullable
                                                                               T2 value2,
                                                                               @Nullable
                                                                               T3 value3,
                                                                               @Nullable
                                                                               T4 value4)

      Create a tuple with 4 values which can possibly be null.
      Type Parameters:
        `T1` - type of first value
        `T2` - type of second value
        `T3` - type of third value
        `T4` - type of fourth value
      Parameters:
        `value1` - first value
        `value2` - second value
        `value3` - third value
        `value4` - fourth value
      Returns:
        4-tuple

    - #### of

          @NotNull
          public static <T1,T2,T3,T4,T5> Tuple5<T1,T2,T3,T4,T5> of(@NotNull
                                                                            T1 value1,
                                                                            @NotNull
                                                                            T2 value2,
                                                                            @NotNull
                                                                            T3 value3,
                                                                            @NotNull
                                                                            T4 value4,
                                                                            @NotNull
                                                                            T5 value5)

      Create a tuple with 5 non-null values.
      Type Parameters:
        `T1` - type of first value
        `T2` - type of second value
        `T3` - type of third value
        `T4` - type of fourth value
        `T5` - type of fifth value
      Parameters:
        `value1` - first value
        `value2` - second value
        `value3` - third value
        `value4` - fourth value
        `value5` - fifth value
      Returns:
        5-tuple

    - #### ofNullable

          @NotNull
          public static <T1,T2,T3,T4,T5> NTuple5<T1,T2,T3,T4,T5> ofNullable(@Nullable
                                                                                     T1 value1,
                                                                                     @Nullable
                                                                                     T2 value2,
                                                                                     @Nullable
                                                                                     T3 value3,
                                                                                     @Nullable
                                                                                     T4 value4,
                                                                                     @Nullable
                                                                                     T5 value5)

      Create a tuple with 5 values which can possibly be null.
      Type Parameters:
        `T1` - type of first value
        `T2` - type of second value
        `T3` - type of third value
        `T4` - type of fourth value
        `T5` - type of fifth value
      Parameters:
        `value1` - first value
        `value2` - second value
        `value3` - third value
        `value4` - fourth value
        `value5` - fifth value
      Returns:
        5-tuple

    - #### of

          @NotNull
          public static <T1,T2,T3,T4,T5,T6> Tuple6<T1,T2,T3,T4,T5,T6> of(@NotNull
                                                                                  T1 value1,
                                                                                  @NotNull
                                                                                  T2 value2,
                                                                                  @NotNull
                                                                                  T3 value3,
                                                                                  @NotNull
                                                                                  T4 value4,
                                                                                  @NotNull
                                                                                  T5 value5,
                                                                                  @NotNull
                                                                                  T6 value6)

      Create a tuple with 6 non-null values.
      Type Parameters:
        `T1` - type of first value
        `T2` - type of second value
        `T3` - type of third value
        `T4` - type of fourth value
        `T5` - type of fifth value
        `T6` - type of sixth value
      Parameters:
        `value1` - first value
        `value2` - second value
        `value3` - third value
        `value4` - fourth value
        `value5` - fifth value
        `value6` - sixth value
      Returns:
        6-tuple

    - #### ofNullable

          @NotNull
          public static <T1,T2,T3,T4,T5,T6> NTuple6<T1,T2,T3,T4,T5,T6> ofNullable(@Nullable
                                                                                           T1 value1,
                                                                                           @Nullable
                                                                                           T2 value2,
                                                                                           @Nullable
                                                                                           T3 value3,
                                                                                           @Nullable
                                                                                           T4 value4,
                                                                                           @Nullable
                                                                                           T5 value5,
                                                                                           @Nullable
                                                                                           T6 value6)

      Create a tuple with 6 values which can possibly be null.
      Type Parameters:
        `T1` - type of first value
        `T2` - type of second value
        `T3` - type of third value
        `T4` - type of fourth value
        `T5` - type of fifth value
        `T6` - type of sixth value
      Parameters:
        `value1` - first value
        `value2` - second value
        `value3` - third value
        `value4` - fourth value
        `value5` - fifth value
        `value6` - sixth value
      Returns:
        6-tuple

    - #### of

          @NotNull
          public static <T1,T2,T3,T4,T5,T6,T7> Tuple7<T1,T2,T3,T4,T5,T6,T7> of(@NotNull
                                                                                        T1 value1,
                                                                                        @NotNull
                                                                                        T2 value2,
                                                                                        @NotNull
                                                                                        T3 value3,
                                                                                        @NotNull
                                                                                        T4 value4,
                                                                                        @NotNull
                                                                                        T5 value5,
                                                                                        @NotNull
                                                                                        T6 value6,
                                                                                        @NotNull
                                                                                        T7 value7)

      Create a tuple with 7 non-null values.
      Type Parameters:
        `T1` - type of first value
        `T2` - type of second value
        `T3` - type of third value
        `T4` - type of fourth value
        `T5` - type of fifth value
        `T6` - type of sixth value
        `T7` - type of seventh value
      Parameters:
        `value1` - first value
        `value2` - second value
        `value3` - third value
        `value4` - fourth value
        `value5` - fifth value
        `value6` - sixth value
        `value7` - seventh value
      Returns:
        7-tuple

    - #### ofNullable

          @NotNull
          public static <T1,T2,T3,T4,T5,T6,T7> NTuple7<T1,T2,T3,T4,T5,T6,T7> ofNullable(@Nullable
                                                                                                 T1 value1,
                                                                                                 @Nullable
                                                                                                 T2 value2,
                                                                                                 @Nullable
                                                                                                 T3 value3,
                                                                                                 @Nullable
                                                                                                 T4 value4,
                                                                                                 @Nullable
                                                                                                 T5 value5,
                                                                                                 @Nullable
                                                                                                 T6 value6,
                                                                                                 @Nullable
                                                                                                 T7 value7)

      Create a tuple with 7 values which can possibly be null.
      Type Parameters:
        `T1` - type of first value
        `T2` - type of second value
        `T3` - type of third value
        `T4` - type of fourth value
        `T5` - type of fifth value
        `T6` - type of sixth value
        `T7` - type of seventh value
      Parameters:
        `value1` - first value
        `value2` - second value
        `value3` - third value
        `value4` - fourth value
        `value5` - fifth value
        `value6` - sixth value
        `value7` - seventh value
      Returns:
        7-tuple

    - #### of

          @NotNull
          public static <T1,T2,T3,T4,T5,T6,T7,T8> Tuple8<T1,T2,T3,T4,T5,T6,T7,T8> of(@NotNull
                                                                                              T1 value1,
                                                                                              @NotNull
                                                                                              T2 value2,
                                                                                              @NotNull
                                                                                              T3 value3,
                                                                                              @NotNull
                                                                                              T4 value4,
                                                                                              @NotNull
                                                                                              T5 value5,
                                                                                              @NotNull
                                                                                              T6 value6,
                                                                                              @NotNull
                                                                                              T7 value7,
                                                                                              @NotNull
                                                                                              T8 value8)

      Create a tuple with 8 non-null values.
      Type Parameters:
        `T1` - type of first value
        `T2` - type of second value
        `T3` - type of third value
        `T4` - type of fourth value
        `T5` - type of fifth value
        `T6` - type of sixth value
        `T7` - type of seventh value
        `T8` - type of eighth value
      Parameters:
        `value1` - first value
        `value2` - second value
        `value3` - third value
        `value4` - fourth value
        `value5` - fifth value
        `value6` - sixth value
        `value7` - seventh value
        `value8` - eighth value
      Returns:
        8-tuple

    - #### ofNullable

          @NotNull
          public static <T1,T2,T3,T4,T5,T6,T7,T8> NTuple8<T1,T2,T3,T4,T5,T6,T7,T8> ofNullable(@Nullable
                                                                                                       T1 value1,
                                                                                                       @Nullable
                                                                                                       T2 value2,
                                                                                                       @Nullable
                                                                                                       T3 value3,
                                                                                                       @Nullable
                                                                                                       T4 value4,
                                                                                                       @Nullable
                                                                                                       T5 value5,
                                                                                                       @Nullable
                                                                                                       T6 value6,
                                                                                                       @Nullable
                                                                                                       T7 value7,
                                                                                                       @Nullable
                                                                                                       T8 value8)

      Create a tuple with 8 values which can possibly be null.
      Type Parameters:
        `T1` - type of first value
        `T2` - type of second value
        `T3` - type of third value
        `T4` - type of fourth value
        `T5` - type of fifth value
        `T6` - type of sixth value
        `T7` - type of seventh value
        `T8` - type of eighth value
      Parameters:
        `value1` - first value
        `value2` - second value
        `value3` - third value
        `value4` - fourth value
        `value5` - fifth value
        `value6` - sixth value
        `value7` - seventh value
        `value8` - eighth value
      Returns:
        8-tuple

    - #### of

          @NotNull
          public static <T1,T2,T3,T4,T5,T6,T7,T8,T9> Tuple9<T1,T2,T3,T4,T5,T6,T7,T8,T9> of(@NotNull
                                                                                                    T1 value1,
                                                                                                    @NotNull
                                                                                                    T2 value2,
                                                                                                    @NotNull
                                                                                                    T3 value3,
                                                                                                    @NotNull
                                                                                                    T4 value4,
                                                                                                    @NotNull
                                                                                                    T5 value5,
                                                                                                    @NotNull
                                                                                                    T6 value6,
                                                                                                    @NotNull
                                                                                                    T7 value7,
                                                                                                    @NotNull
                                                                                                    T8 value8,
                                                                                                    @NotNull
                                                                                                    T9 value9)

      Create a tuple with 9 non-null values.
      Type Parameters:
        `T1` - type of first value
        `T2` - type of second value
        `T3` - type of third value
        `T4` - type of fourth value
        `T5` - type of fifth value
        `T6` - type of sixth value
        `T7` - type of seventh value
        `T8` - type of eighth value
        `T9` - type of nineth value
      Parameters:
        `value1` - first value
        `value2` - second value
        `value3` - third value
        `value4` - fourth value
        `value5` - fifth value
        `value6` - sixth value
        `value7` - seventh value
        `value8` - eighth value
        `value9` - nineth value
      Returns:
        9-tuple

    - #### ofNullable

          @NotNull
          public static <T1,T2,T3,T4,T5,T6,T7,T8,T9> NTuple9<T1,T2,T3,T4,T5,T6,T7,T8,T9> ofNullable(@Nullable
                                                                                                             T1 value1,
                                                                                                             @Nullable
                                                                                                             T2 value2,
                                                                                                             @Nullable
                                                                                                             T3 value3,
                                                                                                             @Nullable
                                                                                                             T4 value4,
                                                                                                             @Nullable
                                                                                                             T5 value5,
                                                                                                             @Nullable
                                                                                                             T6 value6,
                                                                                                             @Nullable
                                                                                                             T7 value7,
                                                                                                             @Nullable
                                                                                                             T8 value8,
                                                                                                             @Nullable
                                                                                                             T9 value9)

      Create a tuple with 9 values which can possibly be null.
      Type Parameters:
        `T1` - type of first value
        `T2` - type of second value
        `T3` - type of third value
        `T4` - type of fourth value
        `T5` - type of fifth value
        `T6` - type of sixth value
        `T7` - type of seventh value
        `T8` - type of eighth value
        `T9` - type of nineth value
      Parameters:
        `value1` - first value
        `value2` - second value
        `value3` - third value
        `value4` - fourth value
        `value5` - fifth value
        `value6` - sixth value
        `value7` - seventh value
        `value8` - eighth value
        `value9` - nineth value
      Returns:
        9-tuple