Interface Tuple

All Known Implementing Classes:
Duad, Heptad, Hexad, Monad, Octad, Pentad, Quad, Triad, Unit

public sealed interface Tuple permits Duad<T,U>, Heptad<T,U,V,W,X,Y,Z>, Hexad<T,U,V,W,X,Y>, Monad<T>, Octad<T,U,V,W,X,Y,Z,A>, Pentad<T,U,V,W,X>, Quad<T,U,V,W>, Triad<T,U,V>, Unit
Tuple is a finite-ordered list of elements.
Since:
1.0.0
  • Method Summary

    Static Methods
    Modifier and Type
    Method
    Description
    static <T> @Unmodifiable @NotNull List<T>
    asList(@NotNull Duad<? extends T,? extends T> duad)
    Returns an unmodifiable list of all the values in the duad.
    static <T> @Unmodifiable @NotNull List<T>
    asList(@NotNull Heptad<? extends T,? extends T,? extends T,? extends T,? extends T,? extends T,? extends T> heptad)
    Returns an unmodifiable list of all the values in the heptad.
    static <T> @Unmodifiable @NotNull List<T>
    asList(@NotNull Hexad<? extends T,? extends T,? extends T,? extends T,? extends T,? extends T> hexad)
    Returns an unmodifiable list of all the values in the hexad.
    static <T> @Unmodifiable @NotNull List<T>
    asList(@NotNull Monad<? extends T> monad)
    Returns an unmodifiable list of the value in the monad.
    static <T> @Unmodifiable @NotNull List<T>
    asList(@NotNull Octad<? extends T,? extends T,? extends T,? extends T,? extends T,? extends T,? extends T,? extends T> octad)
    Returns an unmodifiable list of all the values in the octad.
    static <T> @Unmodifiable @NotNull List<T>
    asList(@NotNull Pentad<? extends T,? extends T,? extends T,? extends T,? extends T> pentad)
    Returns an unmodifiable list of all the values in the pentad.
    static <T> @Unmodifiable @NotNull List<T>
    asList(@NotNull Quad<? extends T,? extends T,? extends T,? extends T> quad)
    Returns an unmodifiable list of all the values in the quad.
    static <T> @Unmodifiable @NotNull List<T>
    asList(@NotNull Triad<? extends T,? extends T,? extends T> triad)
    Returns an unmodifiable list of all the values in the triad.
    static <T> @Unmodifiable @NotNull List<? super T>
    asList(@NotNull Tuple tuple)
    Returns an unmodifiable list based on the tuple that is inputted.
    static <T> @Unmodifiable @NotNull List<T>
    asList(@NotNull Unit unit)
    Returns an empty unmodifiable list.
    static @NotNull Unit
    Returns an empty tuple instance.
    static <T> @NotNull Monad<T>
    of(T first)
    Returns a monad instance.
    static <T, U> @NotNull Duad<T,U>
    of(T first, U second)
    Returns a duad instance.
    static <T, U, V> @NotNull Triad<T,U,V>
    of(T first, U second, V third)
    Returns a triad instance.
    static <T, U, V, W>
    @NotNull Quad<T,U,V,W>
    of(T first, U second, V third, W fourth)
    Returns a quad instance.
    static <T, U, V, W, X>
    @NotNull Pentad<T,U,V,W,X>
    of(T first, U second, V third, W fourth, X fifth)
    Returns a pentad instance.
    static <T, U, V, W, X, Y>
    @NotNull Hexad<T,U,V,W,X,Y>
    of(T first, U second, V third, W fourth, X fifth, Y sixth)
    Returns a hexad instance.
    static <T, U, V, W, X, Y, Z>
    @NotNull Heptad<T,U,V,W,X,Y,Z>
    of(T first, U second, V third, W fourth, X fifth, Y sixth, Z seventh)
    Returns a heptad instance.
    static <T, U, V, W, X, Y, Z, A>
    @NotNull Octad<T,U,V,W,X,Y,Z,A>
    of(T first, U second, V third, W fourth, X fifth, Y sixth, Z seventh, A eighth)
    Returns a octad instance.
  • Method Details

    • asList

      @NotNull static <T> @Unmodifiable @NotNull List<? super T> asList(@NotNull @NotNull Tuple tuple)
      Returns an unmodifiable list based on the tuple that is inputted.
      Type Parameters:
      T - the type of the return value
      Parameters:
      tuple - the tuple to be converted
      Returns:
      an unmodifiable list
      Since:
      1.0.0
    • asList

      @Contract(pure=true) @NotNull static <T> @Unmodifiable @NotNull List<T> asList(@NotNull @NotNull Unit unit)
      Returns an empty unmodifiable list.
      Type Parameters:
      T - the type of the return value
      Parameters:
      unit - the unit to be converted
      Returns:
      an empty unmodifiable list
      Since:
      1.0.0
    • asList

      @NotNull static <T> @Unmodifiable @NotNull List<T> asList(@NotNull @NotNull Monad<? extends T> monad)
      Returns an unmodifiable list of the value in the monad.
      Type Parameters:
      T - the type of the return value
      Parameters:
      monad - the monad to be converted
      Returns:
      an unmodifiable list of the value in the monad
      Since:
      1.0.0
    • asList

      @NotNull static <T> @Unmodifiable @NotNull List<T> asList(@NotNull @NotNull Duad<? extends T,? extends T> duad)
      Returns an unmodifiable list of all the values in the duad.
      Type Parameters:
      T - the type of the return value
      Parameters:
      duad - the duad to be converted
      Returns:
      an unmodifiable list of all the values in the duad
      Since:
      1.0.0
    • asList

      @NotNull static <T> @Unmodifiable @NotNull List<T> asList(@NotNull @NotNull Triad<? extends T,? extends T,? extends T> triad)
      Returns an unmodifiable list of all the values in the triad.
      Type Parameters:
      T - the type of the return value
      Parameters:
      triad - the triad to be converted
      Returns:
      an unmodifiable list of all the values in the triad
      Since:
      1.0.0
    • asList

      @NotNull static <T> @Unmodifiable @NotNull List<T> asList(@NotNull @NotNull Quad<? extends T,? extends T,? extends T,? extends T> quad)
      Returns an unmodifiable list of all the values in the quad.
      Type Parameters:
      T - the type of the return value
      Parameters:
      quad - the quad to be converted
      Returns:
      an unmodifiable list of all the values in the quad
      Since:
      1.0.0
    • asList

      @NotNull static <T> @Unmodifiable @NotNull List<T> asList(@NotNull @NotNull Pentad<? extends T,? extends T,? extends T,? extends T,? extends T> pentad)
      Returns an unmodifiable list of all the values in the pentad.
      Type Parameters:
      T - the type of the return value
      Parameters:
      pentad - the pentad to be converted
      Returns:
      an unmodifiable list of all the values in the pentad
      Since:
      1.0.0
    • asList

      @NotNull static <T> @Unmodifiable @NotNull List<T> asList(@NotNull @NotNull Hexad<? extends T,? extends T,? extends T,? extends T,? extends T,? extends T> hexad)
      Returns an unmodifiable list of all the values in the hexad.
      Type Parameters:
      T - the type of the return value
      Parameters:
      hexad - the duad to be converted
      Returns:
      an unmodifiable list of all the values in the hexad
      Since:
      1.0.0
    • asList

      @NotNull static <T> @Unmodifiable @NotNull List<T> asList(@NotNull @NotNull Heptad<? extends T,? extends T,? extends T,? extends T,? extends T,? extends T,? extends T> heptad)
      Returns an unmodifiable list of all the values in the heptad.
      Type Parameters:
      T - the type of the return value
      Parameters:
      heptad - the heptad to be converted
      Returns:
      an unmodifiable list of all the values in the heptad
      Since:
      1.0.0
    • asList

      @NotNull static <T> @Unmodifiable @NotNull List<T> asList(@NotNull @NotNull Octad<? extends T,? extends T,? extends T,? extends T,? extends T,? extends T,? extends T,? extends T> octad)
      Returns an unmodifiable list of all the values in the octad.
      Type Parameters:
      T - the type of the return value
      Parameters:
      octad - the octad to be converted
      Returns:
      an unmodifiable list of all the values in the octad
      Since:
      1.0.0
    • empty

      @Contract(" -> new") @NotNull static @NotNull Unit empty()
      Returns an empty tuple instance.
      Returns:
      an empty tuple instance
      Since:
      1.0.0
    • of

      @Contract("_ -> new") @NotNull static <T> @NotNull Monad<T> of(T first)
      Returns a monad instance.
      Type Parameters:
      T - the type of the first value
      Returns:
      a monad instance
      Since:
      1.0.0
    • of

      @Contract("_, _ -> new") @NotNull static <T, U> @NotNull Duad<T,U> of(T first, U second)
      Returns a duad instance.
      Type Parameters:
      T - the type of the first value
      U - the type of the second value
      Returns:
      a duad instance
      Since:
      1.0.0
    • of

      @Contract("_, _, _ -> new") @NotNull static <T, U, V> @NotNull Triad<T,U,V> of(T first, U second, V third)
      Returns a triad instance.
      Type Parameters:
      T - the type of the first value
      U - the type of the second value
      V - the type of the third value
      Returns:
      a triad instance
      Since:
      1.0.0
    • of

      @Contract("_, _, _, _ -> new") @NotNull static <T, U, V, W> @NotNull Quad<T,U,V,W> of(T first, U second, V third, W fourth)
      Returns a quad instance.
      Type Parameters:
      T - the type of the first value
      U - the type of the second value
      V - the type of the third value
      W - the type of the fourth value
      Returns:
      a quad instance
      Since:
      1.0.0
    • of

      @Contract("_, _, _, _, _ -> new") @NotNull static <T, U, V, W, X> @NotNull Pentad<T,U,V,W,X> of(T first, U second, V third, W fourth, X fifth)
      Returns a pentad instance.
      Type Parameters:
      T - the type of the first value
      U - the type of the second value
      V - the type of the third value
      W - the type of the fourth value
      X - the type of the fifth value
      Returns:
      a pentad instance
      Since:
      1.0.0
    • of

      @Contract("_, _, _, _, _, _ -> new") @NotNull static <T, U, V, W, X, Y> @NotNull Hexad<T,U,V,W,X,Y> of(T first, U second, V third, W fourth, X fifth, Y sixth)
      Returns a hexad instance.
      Type Parameters:
      T - the type of the first value
      U - the type of the second value
      V - the type of the third value
      W - the type of the fourth value
      X - the type of the fifth value
      Y - the type of the sixth value
      Returns:
      a hexad instance
      Since:
      1.0.0
    • of

      @Contract("_, _, _, _, _, _, _ -> new") @NotNull static <T, U, V, W, X, Y, Z> @NotNull Heptad<T,U,V,W,X,Y,Z> of(T first, U second, V third, W fourth, X fifth, Y sixth, Z seventh)
      Returns a heptad instance.
      Type Parameters:
      T - the type of the first value
      U - the type of the second value
      V - the type of the third value
      W - the type of the fourth value
      X - the type of the fifth value
      Y - the type of the sixth value
      Z - the type of the seventh value
      Returns:
      a heptad instance
      Since:
      1.0.0
    • of

      @Contract("_, _, _, _, _, _, _, _ -> new") @NotNull static <T, U, V, W, X, Y, Z, A> @NotNull Octad<T,U,V,W,X,Y,Z,A> of(T first, U second, V third, W fourth, X fifth, Y sixth, Z seventh, A eighth)
      Returns a octad instance.
      Type Parameters:
      T - the type of the first value
      U - the type of the second value
      V - the type of the third value
      W - the type of the fourth value
      X - the type of the fifth value
      Y - the type of the sixth value
      Z - the type of the seventh value
      A - the type of the eighth value
      Returns:
      a octad instance
      Since:
      1.0.0