Package io.karma.kommons.tuple
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 Summary
Modifier and TypeMethodDescriptionCreates a newTriple
<MutableTriple
,MutableTriple
,MutableTriple
> containing references to the same left, middle and right object this triple instance is referencing.default MutableTriple
<L, M, R> Creates a newMutableTriple
<Triple
,Triple
,Triple
> containing references to the same left and right object this triple instance is referencing.static <L,
M, R> MutableTriple <L, M, R> of
(L left, M middle, R right) Creates a new mutable triple of the given elements.void
Sets the reference to the left element.void
Sets the reference to the middle element.void
Sets the reference to the right element.
-
Method Details
-
of
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
Sets the reference to the left element.- Parameters:
left
- The new left element reference or null.
-
setMiddle
Sets the reference to the middle element.- Parameters:
middle
- The new middle element reference or null.
-
setRight
Sets the reference to the right element.- Parameters:
right
- The new right element reference or null.
-
immutableCopy
Creates a newTriple
<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
Description copied from interface:Triple
Creates a newMutableTriple
<Triple
,Triple
,Triple
> containing references to the same left and right object this triple instance is referencing.- Specified by:
mutableCopy
in interfaceTriple<L,
M, R> - Returns:
- A new
MutableTriple
<Triple
,Triple
,Triple
> referencing the same elements as this triple instance.
-