F
- type of the first pair elementS
- type of the second pair elementpublic final class Pair<F,S> extends Object
Modifier and Type | Field and Description |
---|---|
static Comparator |
COMPARATOR
|
static Pair<?,?> |
EMPTY
An empty Pair.
|
Modifier and Type | Method and Description |
---|---|
Map<F,S> |
asMap()
Get the pair as a map of key to value.
|
static <F,S> Pair<F,S> |
empty()
Returns an empty Pair matching the required types.
|
boolean |
equals(Object obj) |
F |
getFirst()
Returns the first element of this pair.
|
static <F extends Comparable<F>,S extends Comparable<S>> |
getPairComparator()
Returns a comparator for Pairs of comparable objects.
|
S |
getSecond()
Returns the second element of this pair.
|
int |
hashCode() |
static <F,S> Pair<F,S> |
of(F first,
S second)
Creates a new
Pair . |
String |
toString() |
public static final Pair<?,?> EMPTY
public static final Comparator COMPARATOR
public static <F,S> Pair<F,S> of(F first, S second)
Pair
.F
- type of the first pair elementS
- type of the second pair elementfirst
- the first element of the constructed pairsecond
- the second element of the constructed pairpublic static <F,S> Pair<F,S> empty()
F
- type of the first pair elementS
- type of the second pair elementpublic static <F extends Comparable<F>,S extends Comparable<S>> Comparator<Pair<F,S>> getPairComparator()
F
- type of the first pair elementS
- type of the second pair elementpublic F getFirst()
public S getSecond()
Copyright 2010-2022 ForgeRock AS.