| Modifier and Type | Method and Description |
|---|---|
static <X> Pair<X,X> |
fromArray(X[] array)
Create tuple from array.
|
static <X> Pair<X,X> |
fromCollection(java.util.Collection<X> collection)
Create tuple from collection.
|
static <X> Pair<X,X> |
fromIterable(java.lang.Iterable<X> iterable)
Create tuple from iterable.
|
static <X> Pair<X,X> |
fromIterable(java.lang.Iterable<X> iterable,
int index)
Create tuple from iterable, starting from the specified index.
|
int |
getSize()
Return the size of the tuple.
|
A |
getValue0() |
B |
getValue1() |
static <A,B> Pair<A,B> |
with(A value0,
B value1) |
compareTo, contains, containsAll, containsAll, equals, from, getValue, hashCode, indexOf, iterator, lastIndexOf, readFromByteBufStream, toArray, toList, toString, writeToByteBufStreampublic static <A,B> Pair<A,B> with(A value0, B value1)
public static <X> Pair<X,X> fromArray(X[] array)
Create tuple from array. Array has to have exactly two elements.
X - the array component typearray - the array to be converted to a tuplepublic static <X> Pair<X,X> fromCollection(java.util.Collection<X> collection)
Create tuple from collection. Collection has to have exactly two elements.
X - the collection component typecollection - the collection to be converted to a tuplepublic static <X> Pair<X,X> fromIterable(java.lang.Iterable<X> iterable)
Create tuple from iterable. Iterable has to have exactly two elements.
X - the iterable component typeiterable - the iterable to be converted to a tuplepublic static <X> Pair<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 tuple