- Type Parameters:
LeftT- Left typeRightT- Right Type
public final class Pair<LeftT,
Simple struct of two values, possibly of different types.
Method Summary
<ReturnT> ReturnTApply the function to both the left and right values and return the transformed result.
booleanintstatic <LeftT,RightT>
Pair<LeftT, RightT> of(LeftT left, RightT right)
Method Details
left
- Returns:
- Left value
right
- Returns:
- Right value
apply
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.
equals
public boolean equals(Object obj) hashCode
public int hashCode()
toString
of
public static <LeftT,RightT> Pair<LeftT,RightT> of(LeftT left, RightT right)