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> ReturnTapply(BiFunction<LeftT,RightT,ReturnT> function)Apply the function to both the left and right values and return the transformed result.booleanequals(Object obj)inthashCode()LeftTleft()static <LeftT,RightT>
Pair<LeftT,RightT>of(LeftT left, RightT right)RightTright()StringtoString()
-
-
-
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
BiFunctionapplied on left and right values of the pair.
-
of
public static <LeftT,RightT> Pair<LeftT,RightT> of(LeftT left, RightT right)
-
-