public final class Tuple2<A,B>
extends java.lang.Object
implements java.util.Map.Entry<A,B>
Final immutable container for 2 objects of different types.
Values might be accessed directly: _1 and _2,
or thru getters: get_1() and get_2().
Class also implements Map.Entry, so getters:
getKey() and getValue() are available.
tuple2(Object, Object),
Tuple3,
Tuple4,
Tuple5| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object object) |
A |
get_1()
Value of the
_1 field |
B |
get_2()
Value of the
_2 field |
A |
getKey()
Equal to
get_1() |
B |
getValue()
Equal to
get_2() |
int |
hashCode() |
B |
setValue(B value) |
java.lang.String |
toString() |
static <A,B> Tuple2<A,B> |
tuple2(A _1,
B _2)
Factory method to create new instance of the immutable tuple.
|
public static <A,B> Tuple2<A,B> tuple2(A _1, B _2)
public int hashCode()
public boolean equals(java.lang.Object object)
public java.lang.String toString()
toString in class java.lang.Object