Class Pair<A,B>

java.lang.Object
org.dizitart.no2.common.tuples.Pair<A,B>
Type Parameters:
A - the type of the first value in the pair
B - the type of the second value in the pair
All Implemented Interfaces:
Serializable

public class Pair<A,B> extends Object implements Serializable
A simple generic class representing a pair of values.
Since:
4.0
Author:
Anindya Chatterjee.
See Also:
  • Constructor Details

    • Pair

      public Pair()
    • Pair

      public Pair(A first, B second)
  • Method Details

    • pair

      public static <A, B> Pair<A,B> pair(A first, B second)
      Creates a new pair.
      Type Parameters:
      A - the type parameter
      B - the type parameter
      Parameters:
      first - the first
      second - the second
      Returns:
      the pair
    • getFirst

      public A getFirst()
    • getSecond

      public B getSecond()
    • setFirst

      public void setFirst(A first)
    • setSecond

      public void setSecond(B second)
    • 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