L
- the left element typeM
- the middle element typeR
- the right element typepublic class MutableTriple<L,M,R> extends Triple<L,M,R>
A mutable triple consisting of three Object
elements.
Not #ThreadSafe#
Modifier and Type | Field and Description |
---|---|
static MutableTriple<?,?,?>[] |
EMPTY_ARRAY
The empty array singleton.
|
L |
left
Left object
|
M |
middle
Middle object
|
R |
right
Right object
|
Constructor and Description |
---|
MutableTriple()
Create a new triple instance of three nulls.
|
MutableTriple(L left,
M middle,
R right)
Create a new triple instance.
|
Modifier and Type | Method and Description |
---|---|
static <L,M,R> MutableTriple<L,M,R>[] |
emptyArray()
Returns the empty array singleton that can be assigned without compiler warning.
|
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.
|
public static final MutableTriple<?,?,?>[] EMPTY_ARRAY
Consider using emptyArray()
to avoid generics warnings.
public L left
public M middle
public R right
public MutableTriple()
public static <L,M,R> MutableTriple<L,M,R>[] emptyArray()
L
- the left element typeM
- the middle element typeR
- the right element typepublic 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.
L
- the left element typeM
- the middle element typeR
- the right element typeleft
- the left element, may be nullmiddle
- the middle element, may be nullright
- the right element, may be nullpublic L getLeft()
Gets the left element from this triple.
public M getMiddle()
Gets the middle element from this triple.
public R getRight()
Gets the right element from this triple.
public void setLeft(L left)
left
- the new value of the left element, may be nullpublic void setMiddle(M middle)
middle
- the new value of the middle element, may be nullpublic void setRight(R right)
right
- the new value of the right element, may be nullCopyright © 2001–2021 The Apache Software Foundation. All rights reserved.