Class Pair<L,R>
java.lang.Object
org.graalvm.collections.Pair<L,R>
Utility class representing a pair of values.
- Since:
- 19.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic <L,R> Pair <L, R> create(L left, R right) Constructs a pair with its left value beingleft, and its right value beingright, 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 beingleft, or returns an empty pair ifleftis null.static <L,R> Pair <L, R> createRight(R right) Constructs a pair with its right value beingright, or returns an empty pair ifrightis null.static <L,R> Pair <L, R> empty()Returns an empty pair.booleangetLeft()Returns the left value of this pair.getRight()Returns the right value of this pair.inthashCode()toString()
-
Method Details
-
empty
-
createLeft
Constructs a pair with its left value beingleft, or returns an empty pair ifleftis null.- Returns:
- the constructed pair or an empty pair if
leftis null. - Since:
- 19.0
-
createRight
Constructs a pair with its right value beingright, or returns an empty pair ifrightis null.- Returns:
- the constructed pair or an empty pair if
rightis null. - Since:
- 19.0
-
create
Constructs a pair with its left value beingleft, and its right value beingright, or returns an empty pair if both inputs are null.- Returns:
- the constructed pair or an empty pair if both inputs are null.
- Since:
- 19.0
-
getLeft
-
getRight
-
hashCode
-
equals
-
toString
-