Package com.github.tadukoo.util.tuple
Class Pair<L,R>
java.lang.Object
com.github.tadukoo.util.tuple.Pair<L,R>
- Type Parameters:
L
- The left item typeR
- The right item type
A tuple class for holding 2 items of specified type.
- Version:
- 0.1-Alpha-SNAPSHOT
- Author:
- Logan Ferree (Tadukoo)
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetKey()
getLeft()
getRight()
getValue()
static <L,
R> Pair<L, R> of
(L left, R right) Constructs a Pair of the two given objects.void
Sets the left item (key) of the Pairvoid
Sets the left item of the Pairvoid
Sets the right item of the Pairvoid
Sets the right item (value) of the PairtoString()
-
Field Details
-
left
The left item in the tuple -
right
The right item in the tuple
-
-
Constructor Details
-
Pair
Constructs a Pair of the two given objects.- Parameters:
left
- The left item in the pairright
- The right item in the pair
-
-
Method Details
-
of
Constructs a Pair of the two given objects.- Type Parameters:
L
- The type of the left itemR
- The type of the right item- Parameters:
left
- The left item in the Pairright
- The right item in the Pair- Returns:
- A Pair containing the two given items
-
getLeft
- Returns:
- The left item from the Pair
-
getKey
- Returns:
- The left item (key) from the Pair
-
setLeft
Sets the left item of the Pair- Parameters:
left
- The left item to set
-
setKey
Sets the left item (key) of the Pair- Parameters:
key
- The left item (key) to set
-
getRight
- Returns:
- The right item of the Pair
-
getValue
- Returns:
- The right item (value) of the Pair
-
setRight
Sets the right item of the Pair- Parameters:
right
- The right item to set
-
setValue
Sets the right item (value) of the Pair- Parameters:
value
- The right item (value) to set
-
toString
-