Package org.apache.commons.lang3.tuple
Class MutableTriple<L,M,R>
- java.lang.Object
-
- org.apache.commons.lang3.tuple.Triple<L,M,R>
-
- org.apache.commons.lang3.tuple.MutableTriple<L,M,R>
-
- Type Parameters:
L
- the left element typeM
- the middle element typeR
- the right element type
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<Triple<L,M,R>>
public class MutableTriple<L,M,R> extends Triple<L,M,R>
A mutable triple consisting of three
Object
elements.Not #ThreadSafe#
- Since:
- 3.2
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MutableTriple()
Create a new triple instance of three nulls.MutableTriple(L left, M middle, R right)
Create a new triple instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description L
getLeft()
Gets the left element from this triple.M
getMiddle()
Gets the middle element from this triple.R
getRight()
Gets the right element from this triple.static <L,M,R>
MutableTriple<L,M,R>of(L left, M middle, R right)
Obtains a mutable triple of three objects inferring the generic types.void
setLeft(L left)
Sets the left element of the triple.void
setMiddle(M middle)
Sets the middle element of the triple.void
setRight(R right)
Sets the right element of the triple.
-
-
-
Method Detail
-
of
public static <L,M,R> MutableTriple<L,M,R> of(L left, M middle, R right)
Obtains a mutable triple of three objects inferring the generic types.
This factory allows the triple to be created using inference to obtain the generic types.
- Type Parameters:
L
- the left element typeM
- the middle element typeR
- the right element type- Parameters:
left
- the left element, may be nullmiddle
- the middle element, may be nullright
- the right element, may be null- Returns:
- a triple formed from the three parameters, not null
-
getLeft
public L getLeft()
Gets the left element from this triple.
-
setLeft
public void setLeft(L left)
Sets the left element of the triple.- Parameters:
left
- the new value of the left element, may be null
-
getMiddle
public M getMiddle()
Gets the middle element from this triple.
-
setMiddle
public void setMiddle(M middle)
Sets the middle element of the triple.- Parameters:
middle
- the new value of the middle element, may be null
-
getRight
public R getRight()
Gets the right element from this triple.
-
setRight
public void setRight(R right)
Sets the right element of the triple.- Parameters:
right
- the new value of the right element, may be null
-
-