Package io.karma.kommons.tuple
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 TypeMethodDescriptiongetLeft()
Retrieves the left element of this triple instance.Retrieves the middle element of this triple instance.getRight()
Retrieves the right element of this triple instance.leftPair()
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> Triple <L, M, R> of
(L left, M middle, R right) Creates a new immutable triple of the given elements.
-
Method Details
-
of
Creates a new immutable triple of the given elements. -
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, mutableCopy()R> Creates a newMutableTriple
<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
-
rightPair
-
outerPair
-