public final class Pair<L,R> extends Object
Modifier and Type | Method and Description |
---|---|
static <L,R> Pair<L,R> |
create(L left,
R right)
Constructs a pair with its left value being
left , and its right value being
right , or returns an empty pair if both inputs are null. |
static <L,R> Pair<L,R> |
createLeft(L left)
Constructs a pair with its left value being
left , or returns an empty pair if
left is null. |
static <L,R> Pair<L,R> |
createRight(R right)
Constructs a pair with its right value being
right , or returns an empty pair if
right is null. |
static <L,R> Pair<L,R> |
empty()
Returns an empty pair.
|
boolean |
equals(Object obj) |
L |
getLeft()
Returns the left value of this pair.
|
R |
getRight()
Returns the right value of this pair.
|
int |
hashCode() |
String |
toString() |
public static <L,R> Pair<L,R> empty()
public static <L,R> Pair<L,R> createLeft(L left)
left
, or returns an empty pair if
left
is null.left
is null.public static <L,R> Pair<L,R> createRight(R right)
right
, or returns an empty pair if
right
is null.right
is null.public static <L,R> Pair<L,R> create(L left, R right)
left
, and its right value being
right
, or returns an empty pair if both inputs are null.public L getLeft()
public R getRight()