Package org.graalvm.collections
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 ifleft
is null.static <L,
R> Pair <L, R> createRight
(R right) Constructs a pair with its right value beingright
, or returns an empty pair ifright
is null.static <L,
R> Pair <L, R> empty()
Returns an empty pair.boolean
getLeft()
Returns the left value of this pair.getRight()
Returns the right value of this pair.int
hashCode()
toString()
-
Method Details
-
empty
Returns an empty pair.- Since:
- 19.0
-
createLeft
Constructs a pair with its left value beingleft
, or returns an empty pair ifleft
is null.- Returns:
- the constructed pair or an empty pair if
left
is null. - Since:
- 19.0
-
createRight
Constructs a pair with its right value beingright
, or returns an empty pair ifright
is null.- Returns:
- the constructed pair or an empty pair if
right
is 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
Returns the left value of this pair.- Since:
- 19.0
-
getRight
Returns the right value of this pair.- Since:
- 19.0
-
hashCode
public int hashCode() -
equals
-
toString
-