- Type Parameters:
L - The type of the first item
R - The type of the second item
- All Implemented Interfaces:
Tuple, Iterable<Object>
- Direct Known Subclasses:
Tuple3
public class Tuple2<L,R>
extends Object
implements Tuple
A tuple containing two items.
-
Constructor Summary
Constructors
-
Method Summary
protected void
boolean
int
Applies a mapper function to the left (item1) part of this
Tuple2 to produce a new
Tuple2.
Applies a mapper function to the right part (item2) of this
Tuple2 to produce a new
Tuple2.
Get the item stored at the given index.
int
Methods inherited from interface io.smallrye.mutiny.tuples.Tuple
iterator
-
Constructor Details
-
Tuple2
protected Tuple2(L left,
R right)
-
Method Details
-
of
public static <L,
R> Tuple2<L,R> of(L l,
R r)
-
getItem1
Gets the first item.
- Returns:
- The first item, can be
null
-
getItem2
Gets the second item.
- Returns:
- The second item, can be
null
-
mapItem1
Applies a mapper function to the left (item1) part of this
Tuple2 to produce a new
Tuple2.
The right part (item2) is not modified.
- Type Parameters:
T - the new type for the left item
- Parameters:
mapper - the mapping Function for the left item
- Returns:
- the new
Tuple2
-
mapItem2
Applies a mapper function to the right part (item2) of this
Tuple2 to produce a new
Tuple2.
The left (item1) part is not modified.
- Type Parameters:
T - the new type for the right item
- Parameters:
mapper - the mapping Function for the right item
- Returns:
- the new
Tuple2
-
nth
Description copied from interface: Tuple
Get the item stored at the given index.
- Specified by:
nth in interface Tuple
- Parameters:
index - The index of the item to retrieve.
- Returns:
- The item, can be
null
-
assertIndexInBounds
protected void assertIndexInBounds(int index)
-
asList
Description copied from interface: Tuple
- Specified by:
asList in interface Tuple
- Returns:
- A list containing the item of the tuple.
-
-
-
size
public int size()
- Specified by:
size in interface Tuple
- Returns:
- the number of items stored in the
Tuple
-