public static class Lang.Tuple<A,B> extends Object
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
A |
first() |
int |
hashCode() |
B |
last() |
A |
left() |
B |
right() |
B |
second() |
Lang.T2<A,B> |
set1(A a) |
Lang.T2<A,B> |
set2(B b) |
C.List |
toList() |
Map<A,B> |
toMap()
Convert this
Tuple instance into a Map with one key,value pair. |
static <K,V> Map<K,V> |
toMap(Collection<Lang.Tuple<K,V>> list)
Convert a list of
Tuple instances into a Map. |
String |
toString() |
public final A left()
public final B right()
public A first()
public B second()
public B last()
public C.List toList()
public Map<A,B> toMap()
Convert this Tuple instance into a Map with one key,value pair. Where key is _1 and value is _2;
public static <K,V> Map<K,V> toMap(Collection<Lang.Tuple<K,V>> list)
Convert a list of Tuple instances into a Map. Where key is _1 and value is _2;
Note that the size of the returned Map might be lesser than the size of the tuple list if there are multiple _1 has the same value, and the last one is the winner and it’s _2 will be put into the Map
K - the key typeV - the value typelist - the list of tuples to be transformed into MapCopyright © 2014–2019 OSGL (Open Source General Library). All rights reserved.