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 type.M- The middle element type.R- The right element type.
- All Implemented Interfaces:
Serializable, Comparable<Triple<L,M, R>>
A mutable triple consisting of three
Object elements.
Not #ThreadSafe#
- Since:
- 3.2
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MutableTriple<?,?, ?>[] The empty array singleton.Left object.Middle object.Right object. -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new triple instance of three nulls.MutableTriple(L left, M middle, R right) Create a new triple instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic <L,M, R> MutableTriple<L, M, R>[] Returns the empty array singleton that can be assigned without compiler warning.getLeft()Gets the left element from this triple.Gets the middle element from this triple.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.static <L,M, R> MutableTriple <L, M, R> ofNonNull(L left, M middle, R right) Obtains a mutable triple of three non-null objects inferring the generic types.voidSets the left element of the triple.voidSets the middle element of the triple.voidSets the right element of the triple.Methods inherited from class Triple
compareTo, equals, hashCode, toString, toStringModifier and TypeMethodDescriptionintCompares the triple based on the left element, followed by the middle element, finally the right element.booleanCompares this triple to another based on the three elements.inthashCode()Returns a suitable hash code.toString()Returns a String representation of this triple using the format(left,middle,right).Formats the receiver using the given format.
-
Field Details
-
EMPTY_ARRAY
The empty array singleton.Consider using
emptyArray()to avoid generics warnings.- Since:
- 3.10
-
left
-
middle
-
right
-
-
Constructor Details
-
MutableTriple
public MutableTriple()Create a new triple instance of three nulls. -
MutableTriple
Create a new triple instance.- Parameters:
left- The left value, may be null.middle- The middle value, may be null.right- The right value, may be null.
-
-
Method Details
-
emptyArray
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
-
of
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.
-
ofNonNull
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:
NullPointerException- Thrown if any input is null.- Since:
- 3.13.0
-
getLeft
-
getMiddle
-
getRight
-
setLeft
-
setMiddle
-
setRight
-