Class Pair<A,B>

java.lang.Object
de.eldoria.eldoutilities.container.Pair<A,B>
Type Parameters:
A - value A
B - value B

public class Pair<A,B> extends Object
Contains a immutable pair of two values
Since:
1.0.0
  • Field Details

    • first

      public final A first
    • second

      public final B second
  • Constructor Details

    • Pair

      public Pair(A first, B second)
      Create a new pair.
      Parameters:
      first - first value
      second - second value
  • Method Details

    • of

      public static <X, Y> Pair<X,Y> of(X x, Y y)
      Create a new pair.
      Type Parameters:
      X - type of first value
      Y - type of second value
      Parameters:
      x - first value
      y - second value
      Returns:
      new pair
    • 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