A - type of first valueB - type of second valuepublic class Tuple<A,B> extends DataObject
null.
It implements methods equals(), hashCode() and toString()
It's useful when if you would like to have a composite return value from a method or as a composite key to a map.
| Constructor and Description |
|---|
Tuple(A a,
B b)
Constructor of
Tuple with two values to wrap |
| Modifier and Type | Method and Description |
|---|---|
A |
a()
Returns first value
|
B |
b()
Returns second value
|
A |
getA()
Returns first value
|
B |
getB()
Returns second value
|
<C> C |
map(java.util.function.BiFunction<? super A,? super B,? extends C> mapper)
Maps wrapped values using a provided
BiFunction |
static <A,B> Tuple<A,B> |
tuple(A a,
B b)
Factory method to create
Tuple. |
equals, hashCode, toStringpublic static <A,B> Tuple<A,B> tuple(A a, B b)
Tuple.A - first value typeB - second value typea - first valueb - second valueTuplepublic A getA()
public B getB()
public A a()
public B b()