Interface MutableTriple<L,M,R>

Type Parameters:
L - The left element type.
M - The middle element type.
R - The right element type.
All Superinterfaces:
Copyable<MutableTriple<L,M,R>>, Triple<L,M,R>

@API(status=STABLE) public interface MutableTriple<L,M,R> extends Triple<L,M,R>, Copyable<MutableTriple<L,M,R>>
A mutable specialization of Triple, which allows setting the elements referenced by this triple instance.
Since:
11/08/2022
  • Method Details

    • of

      static <L, M, R> MutableTriple<L,M,R> of(@Nullable L left, @Nullable M middle, @Nullable R right)
      Creates a new mutable 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<MutableTriple, MutableTriple, MutableTriple> containing references to the given element(s).
    • setLeft

      void setLeft(@Nullable L left)
      Sets the reference to the left element.
      Parameters:
      left - The new left element reference or null.
    • setMiddle

      void setMiddle(@Nullable M middle)
      Sets the reference to the middle element.
      Parameters:
      middle - The new middle element reference or null.
    • setRight

      void setRight(@Nullable R right)
      Sets the reference to the right element.
      Parameters:
      right - The new right element reference or null.
    • immutableCopy

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

      default MutableTriple<L,M,R> mutableCopy()
      Description copied from interface: Triple
      Creates a new MutableTriple<Triple, Triple, Triple> containing references to the same left and right object this triple instance is referencing.
      Specified by:
      mutableCopy in interface Triple<L,M,R>
      Returns:
      A new MutableTriple<Triple, Triple, Triple> referencing the same elements as this triple instance.