MutableTriple
- public class org.apache.commons.lang3.tuple.MutableTriple<L, M, R> extends Triple<L, M, R>[source]
A mutable triple consisting of three
Objectelements.Not #ThreadSafe#
- Parameters:
<L> – The left element type.
<M> – The middle element type.
<R> – The right element type.
- Since:
3.2
Constructors
Create a new triple instance of three nulls. |
|
Create a new triple instance. |
Fields and constants
The empty array singleton. |
|
Left object. |
|
Middle object. |
|
Right object. |
- public static final MutableTriple<?, ?, ?>[] EMPTY_ARRAY[source]
The empty array singleton.
Consider using
#emptyArray()to avoid generics warnings.- Since:
3.10
Methods
Returns the empty array singleton that can be assigned without compiler warning. |
|
Gets the left element from this triple. |
|
Gets the middle element from this triple. |
|
Gets the right element from this triple. |
|
Obtains a mutable triple of three objects inferring the generic types. |
|
Obtains a mutable triple of three non-null objects inferring the generic types. |
|
Sets the left element of the triple. |
|
Sets the middle element of the triple. |
|
Sets the right element of the triple. |
- @SuppressWarnings({"unchecked"}) public static <L, M, R> MutableTriple<L, M, R>[] emptyArray()[source]
Returns the empty array singleton that can be assigned without compiler warning.
- Type parameters:
<L> – The left element type.
<M> – The middle element type.
<R> – The right element type.
- Returns:
The empty array singleton that can be assigned without compiler warning.
- Since:
3.10
- @Override public L getLeft()[source]
Gets the left element from this triple.
- Returns:
The left element, may be null.
- @Override public M getMiddle()[source]
Gets the middle element from this triple.
- Returns:
The middle element, may be null.
- @Override public R getRight()[source]
Gets the right element from this triple.
- Returns:
The right element, may be null.
- public static <L, M, R> MutableTriple<L, M, R> of(L left, M middle, R right)[source]
Obtains a mutable triple of three objects inferring the generic types.
- Type parameters:
<L> – The left element type.
<M> – The middle element type.
<R> – The right element type.
- Parameters:
left – The left element, may be null.
middle – The middle element, may be null.
right – The right element, may be null.
- Returns:
A mutable triple formed from the three parameters, not null.
- public static <L, M, R> MutableTriple<L, M, R> ofNonNull(L left, M middle, R right)[source]
Obtains a mutable triple of three non-null objects inferring the generic types.
- Type parameters:
<L> – The left element type.
<M> – The middle element type.
<R> – The right element type.
- Parameters:
left – The left element, may not be null.
middle – The middle element, may not be null.
right – The right element, may not be null.
- Returns:
A mutable triple formed from the three parameters, not null.
- Throws:
java.lang.NullPointerException – Thrown if any input is null.
- Since:
3.13.0
- public void setLeft(L left)[source]
Sets the left element of the triple.
- Parameters:
left – The new value of the left element, may be null.