Top Description Fields Constructors Methods
org.apache.commons.lang3.tuple

public Class ImmutableTriple<L, M, R>

extends Triple<L, M, R>
Class Inheritance
Type Parameters
<L>
the left element type.
<M>
the middle element type.
<R>
the right element type.
Imports
java.util.Objects

An immutable triple consisting of three Object elements.

Although the implementation is immutable, there is no restriction on the objects that may be stored. If mutable objects are stored in the triple, then the triple itself effectively becomes mutable.

#ThreadSafe# if all three objects are thread-safe.

Since
3.2

Field Summary

Modifier and TypeField and Description
public static final ImmutableTriple<?, ?, ?>[]
public final L
left

Left object.

public final M
middle

Middle object.

private static final ImmutableTriple<L, M, R>
NULL

An immutable triple of nulls.

public final R
right

Right object.

private static final long

Constructor Summary

AccessConstructor and Description
public
ImmutableTriple(final L
the left value, may be null.
left
,
final M
the middle value, may be null.
middle
,
final R
the right value, may be null.
right
)

Constructs a new triple instance.

Method Summary

Modifier and TypeMethod and Description
public static <
the left element type.
L
,
the middle element type.
M
,
the right element type.
R
>
ImmutableTriple<L, M, R>[]

Returns:

the empty array singleton that can be assigned without compiler warning.
emptyArray
()

Hides org.apache.commons.lang3.tuple.Triple.emptyArray.

Gets the empty array singleton that can be assigned without compiler warning.

public L
getLeft()

Implements abstract org.apache.commons.lang3.tuple.Triple.getLeft.

Gets the left element from this triple.

public M
getMiddle()

Implements abstract org.apache.commons.lang3.tuple.Triple.getMiddle.

Gets the middle element from this triple.

public R
getRight()

Implements abstract org.apache.commons.lang3.tuple.Triple.getRight.

Gets the right element from this triple.

public static <
the left element of this triple. Value is null.
L
,
the middle element of this triple. Value is null.
M
,
the right element of this triple. Value is null.
R
>
ImmutableTriple<L, M, R>

Returns:

an immutable triple of nulls.
nullTriple
()

Gets the immutable triple of nulls singleton.

public static <
the left element type.
L
,
the middle element type.
M
,
the right element type.
R
>
ImmutableTriple<L, M, R>

Returns:

an immutable triple formed from the three parameters, not null.
of
(final L
the left element, may be null.
left
,
final M
the middle element, may be null.
middle
,
final R
the right element, may be null.
right
)

Hides org.apache.commons.lang3.tuple.Triple.of.

Creates an immutable triple of three objects inferring the generic types.

public static <
the left element type.
L
,
the middle element type.
M
,
the right element type.
R
>
ImmutableTriple<L, M, R>

Returns:

an immutable triple formed from the three parameters, not null.
ofNonNull
(final L
the left element, may not be null.
left
,
final M
the middle element, may not be null.
middle
,
final R
the right element, may not be null.
right
)

Hides org.apache.commons.lang3.tuple.Triple.ofNonNull.

Creates an immutable triple of three non-null objects inferring the generic types.

Inherited from org.apache.commons.lang3.tuple.Triple:
compareToequalshashCodetoStringtoString

Field Detail

EMPTY_ARRAYback to summary
public static final ImmutableTriple<?, ?, ?>[] EMPTY_ARRAY

Hides org.apache.commons.lang3.tuple.Triple.EMPTY_ARRAY.

An empty array.

Consider using emptyArray() to avoid generics warnings.

Since
3.10
leftback to summary
public final L left

Left object.

middleback to summary
public final M middle

Middle object.

NULLback to summary
private static final ImmutableTriple<L, M, R> NULL

An immutable triple of nulls.

Annotations
@SuppressWarnings:rawtypes
serialVersionUIDback to summary
private static final long serialVersionUID

Hides org.apache.commons.lang3.tuple.Triple.serialVersionUID.

Serialization version.

Constructor Detail

ImmutableTripleback to summary
public ImmutableTriple(final L left, final M middle, final R right)

Constructs a new triple instance.

Parameters
left:L

the left value, may be null.

middle:M

the middle value, may be null.

right:R

the right value, may be null.

Method Detail

emptyArrayback to summary
public static <L, M, R> ImmutableTriple<L, M, R>[] emptyArray()

Hides org.apache.commons.lang3.tuple.Triple.emptyArray.

Gets the empty array singleton that can be assigned without compiler warning.

Parameters
<L>
the left element type.
<M>
the middle element type.
<R>
the right element type.
Returns:ImmutableTriple<L, M, R>[]

the empty array singleton that can be assigned without compiler warning.

Annotations
@SuppressWarnings:unchecked
Since
3.10
getLeftback to summary
public L getLeft()

Implements abstract org.apache.commons.lang3.tuple.Triple.getLeft.

Doc from org.apache.commons.lang3.tuple.Triple.getLeft.

Gets the left element from this triple.

Annotations
@Override
getMiddleback to summary
public M getMiddle()

Implements abstract org.apache.commons.lang3.tuple.Triple.getMiddle.

Doc from org.apache.commons.lang3.tuple.Triple.getMiddle.

Gets the middle element from this triple.

Annotations
@Override
getRightback to summary
public R getRight()

Implements abstract org.apache.commons.lang3.tuple.Triple.getRight.

Doc from org.apache.commons.lang3.tuple.Triple.getRight.

Gets the right element from this triple.

Annotations
@Override
nullTripleback to summary
public static <L, M, R> ImmutableTriple<L, M, R> nullTriple()

Gets the immutable triple of nulls singleton.

Parameters
<L>
the left element of this triple. Value is null.
<M>
the middle element of this triple. Value is null.
<R>
the right element of this triple. Value is null.
Returns:ImmutableTriple<L, M, R>

an immutable triple of nulls.

Annotations
@SuppressWarnings:unchecked
Since
3.6
ofback to summary
public static <L, M, R> ImmutableTriple<L, M, R> of(final L left, final M middle, final R right)

Hides org.apache.commons.lang3.tuple.Triple.of.

Creates an immutable triple of three objects inferring the generic types.

Parameters
<L>
the left element type.
<M>
the middle element type.
<R>
the right element type.
left:L

the left element, may be null.

middle:M

the middle element, may be null.

right:R

the right element, may be null.

Returns:ImmutableTriple<L, M, R>

an immutable triple formed from the three parameters, not null.

ofNonNullback to summary
public static <L, M, R> ImmutableTriple<L, M, R> ofNonNull(final L left, final M middle, final R right)

Hides org.apache.commons.lang3.tuple.Triple.ofNonNull.

Creates an immutable triple of three non-null objects inferring the generic types.

Parameters
<L>
the left element type.
<M>
the middle element type.
<R>
the right element type.
left:L

the left element, may not be null.

middle:M

the middle element, may not be null.

right:R

the right element, may not be null.

Returns:ImmutableTriple<L, M, R>

an immutable triple formed from the three parameters, not null.

Exceptions
NullPointerException:
if any input is null.
Since
3.13.0