public final class Tuple<A,B,C>
extends java.lang.Object
A tuple of three elements.
Modifier and Type | Method and Description |
---|---|
static <X> Tuple<X,X,X> |
fromArray(X[] array)
Create tuple from array.
|
static <X> Tuple<X,X,X> |
fromCollection(java.util.Collection<X> collection)
Create tuple from collection.
|
static <X> Tuple<X,X,X> |
fromIterable(java.lang.Iterable<X> iterable)
Create tuple from iterable.
|
static <X> Tuple<X,X,X> |
fromIterable(java.lang.Iterable<X> iterable,
int index)
Create tuple from iterable, starting from the specified index.
|
int |
getSize() |
A |
getValue0() |
B |
getValue1() |
C |
getValue2() |
static <A,B,C> Tuple<A,B,C> |
with(A value0,
B value1,
C value2) |
public static <A,B,C> Tuple<A,B,C> with(A value0, B value1, C value2)
public static <X> Tuple<X,X,X> fromArray(X[] array)
Create tuple from array. Array has to have exactly three elements.
X
- the array component typearray
- the array to be converted to a tuplepublic static <X> Tuple<X,X,X> fromCollection(java.util.Collection<X> collection)
Create tuple from collection. Collection has to have exactly three elements.
X
- the collection component typecollection
- the collection to be converted to a tuplepublic static <X> Tuple<X,X,X> fromIterable(java.lang.Iterable<X> iterable)
Create tuple from iterable. Iterable has to have exactly three elements.
X
- the iterable component typeiterable
- the iterable to be converted to a tuplepublic static <X> Tuple<X,X,X> fromIterable(java.lang.Iterable<X> iterable, int index)
Create tuple from iterable, starting from the specified index. Iterable can have more (or less) elements than the tuple to be created.
X
- the iterable component typeiterable
- the iterable to be converted to a tuplepublic A getValue0()
public B getValue1()
public C getValue2()
public int getSize()