Package software.amazon.awssdk.utils
Class Pair<LeftT,RightT>
- java.lang.Object
-
- software.amazon.awssdk.utils.Pair<LeftT,RightT>
-
- Type Parameters:
LeftT
- Left typeRightT
- Right Type
public final class Pair<LeftT,RightT> extends Object
Simple struct of two values, possibly of different types.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <ReturnT> ReturnT
apply(BiFunction<LeftT,RightT,ReturnT> function)
Apply the function to both the left and right values and return the transformed result.boolean
equals(Object obj)
int
hashCode()
LeftT
left()
static <LeftT,RightT>
Pair<LeftT,RightT>of(LeftT left, RightT right)
RightT
right()
String
toString()
-
-
-
Method Detail
-
left
public LeftT left()
- Returns:
- Left value
-
right
public RightT right()
- Returns:
- Right value
-
apply
public <ReturnT> ReturnT apply(BiFunction<LeftT,RightT,ReturnT> function)
Apply the function to both the left and right values and return the transformed result.- Type Parameters:
ReturnT
- Transformed return type ofBiFunction
.- Parameters:
function
- Function to apply on thePair
- Returns:
- Result of
BiFunction
applied on left and right values of the pair.
-
of
public static <LeftT,RightT> Pair<LeftT,RightT> of(LeftT left, RightT right)
-
-