Class Pair<A,B>

java.lang.Object
com.atlassian.upm.api.util.Pair<A,B>
Type Parameters:
A - type of the first value
B - type of the second value

public final class Pair<A,B> extends Object
A tuple of size 2.
  • Method Details

    • first

      public A first()
      Returns:
      the first value
    • second

      public B second()
      Returns:
      the second value
    • equals

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

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

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

      public static <A, B> Pair<A,B> pair(A first, B second)
      Static factory method for creating pairs.
      Type Parameters:
      A - type of the first value
      B - type of the second value
      Parameters:
      first - the first value of the pair
      second - the second value of the pair
      Returns:
      a new pair consisting of the first and second values
    • fromMapEntry

      public static <A, B> Pair<A,B> fromMapEntry(Map.Entry<A,B> entry)