Package nz.org.riskscape.engine.util
Class Pair<L,R>
java.lang.Object
nz.org.riskscape.engine.util.Pair<L,R>
General purpose pair type
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
getLeft()
getRight()
int
hashCode()
static <L,
R> Pair<L, R> of
(L l, R r) Construct a new pair in a slightly nicer way that using the constructor e.g.toMap()
Returns a collector that can be used to reduce a stream ofPair
s to a map, throwing an exception on duplicates.toString()
-
Constructor Details
-
Pair
-
-
Method Details
-
of
Construct a new pair in a slightly nicer way that using the constructor e.g.
Pair.of(foo, bar)
vsnew Pair<>(foo, bar)
-
toMap
Returns a collector that can be used to reduce a stream of
Pair
s to a map, throwing an exception on duplicates.- Type Parameters:
K
- the type of keysV
- the type of values- Returns:
- a map that is the result of mapping every pair's left side to its right side
-
getLeft
-
getRight
-
equals
-
hashCode
public int hashCode() -
toString
-