Interface Triple<L,M,R>

Type Parameters:
L - The left element type.
M - The middle element type.
R - The right element type.
All Known Subinterfaces:
MutableTriple<L,M,R>

@API(status=STABLE) public interface Triple<L,M,R>
A simple triple tuple type which can hold three objects.
Since:
02/02/2022
  • Method Summary

    Modifier and Type
    Method
    Description
    Retrieves the left element of this triple instance.
    Retrieves the middle element of this triple instance.
    Retrieves the right element of this triple instance.
    default Pair<L,M>
    Retrieve the leftmost two elements (Triple and Triple) from this triple instance and creates a new Pair<Triple, Triple> from them.
    Creates a new MutableTriple<Triple, Triple, Triple> containing references to the same left and right object this triple instance is referencing.
    static <L, M, R> Triple<L,M,R>
    of(L left, M middle, R right)
    Creates a new immutable triple of the given elements.
    default Pair<L,R>
    Retrieve the outermost two elements (Triple and Triple) from this triple instance and creates a new Pair<Triple, Triple> from them.
    default Pair<M,R>
    Retrieve the rightmost two elements (Triple and Triple) from this triple instance and creates a new Pair<Triple, Triple> from them.
  • Method Details

    • of

      static <L, M, R> Triple<L,M,R> of(@Nullable L left, @Nullable M middle, @Nullable R right)
      Creates a new immutable triple of the given elements.
      Type Parameters:
      L - The left element type.
      R - The right element type.
      Parameters:
      left - The left element or null.
      middle - The middle element or null.
      right - The right element or null.
      Returns:
      A new Triple<Triple, Triple, Triple> containing references to the given element(s).
    • getLeft

      L getLeft()
      Retrieves the left element of this triple instance.
      Returns:
      The left element referenced by this triple instance.
    • getMiddle

      M getMiddle()
      Retrieves the middle element of this triple instance.
      Returns:
      The middle element referenced by this triple instance.
    • getRight

      R getRight()
      Retrieves the right element of this triple instance.
      Returns:
      The right element referenced by this triple instance.
    • mutableCopy

      MutableTriple<L,M,R> mutableCopy()
      Creates a new MutableTriple<Triple, Triple, Triple> containing references to the same left and right object this triple instance is referencing.
      Returns:
      A new MutableTriple<Triple, Triple, Triple> referencing the same elements as this triple instance.
    • leftPair

      default Pair<L,M> leftPair()
      Retrieve the leftmost two elements (Triple and Triple) from this triple instance and creates a new Pair<Triple, Triple> from them.
      Returns:
      A new Pair<Triple, Triple> instance, referencing the same elements as this triple instance.
    • rightPair

      default Pair<M,R> rightPair()
      Retrieve the rightmost two elements (Triple and Triple) from this triple instance and creates a new Pair<Triple, Triple> from them.
      Returns:
      A new Pair<Triple, Triple> instance, referencing the same elements as this triple instance.
    • outerPair

      default Pair<L,R> outerPair()
      Retrieve the outermost two elements (Triple and Triple) from this triple instance and creates a new Pair<Triple, Triple> from them.
      Returns:
      A new Pair<Triple, Triple> instance, referencing the same elements as this triple instance.