T1 - The type of the first value held by this tupleT2 - The type of the second value held by this tuplepublic class Tuple2<T1,T2> extends Object implements Iterable<Object>, Serializable
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
Object |
get(int index)
Get the object at the given index.
|
T1 |
getT1()
Type-safe way to get the fist object of this
Tuples. |
T2 |
getT2()
Type-safe way to get the second object of this
Tuples. |
int |
hashCode() |
protected StringBuilder |
innerToString()
String representation that can be adjusted for higher-cardinality Tuples in order
to show all values hold.
|
Iterator<Object> |
iterator() |
int |
size()
Return the number of elements in this Tuples.
|
Object[] |
toArray()
Turn this Tuples into a plain Object array.
|
List<Object> |
toList()
Turn this Tuples into a plain Object list.
|
String |
toString()
A Tuple String representation is the comma separated list of values, enclosed
in square brackets.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic T1 getT1()
Tuples.public T2 getT2()
Tuples.@Nullable public Object get(int index)
index - The index of the object to retrieve. Starts at 0.public List<Object> toList()
public Object[] toArray()
public int size()
protected StringBuilder innerToString()
public final String toString()
[value1,,value3] for a Tuple3 or [,value2]
for a Tuple2.