A
- the first element typeB
- the second element typepublic class Pair<A,B> extends Object implements Serializable
Although the instances of this class are immutable, it is impossible to ensure that the references passed to the constructor will not be modified by the caller.
Modifier and Type | Field and Description |
---|---|
A |
first
The first pair element
|
B |
second
The second pair element
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other) |
int |
hashCode() |
static <A,B> Pair<A,B> |
of(A a,
B b)
Creates new pair of elements pulling of the necessity to provide corresponding types of the
elements supplied
|
public A first
public B second
public static <A,B> Pair<A,B> of(A a, B b)
A
- the first element typeB
- the second element typea
- first elementb
- second elementCopyright © 2016. All rights reserved.