Class Pair<LeftT,RightT>

java.lang.Object
software.amazon.awssdk.utils.Pair<LeftT,RightT>
Type Parameters:
LeftT - Left type
RightT - Right Type

public final class Pair<LeftT,RightT> extends Object
Simple struct of two values, possibly of different types.
  • Method Details

    • 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 of BiFunction.
      Parameters:
      function - Function to apply on the Pair
      Returns:
      Result of BiFunction applied on left and right values of the pair.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • of

      public static <LeftT, RightT> Pair<LeftT,RightT> of(LeftT left, RightT right)