Class Pair<A,B>

java.lang.Object
org.eclipse.hono.util.Pair<A,B>
Type Parameters:
A - The type of the first value.
B - The type of the second value.

public final class Pair<A,B> extends Object
A pair of two values of arbitrary type.
  • Method Details

    • of

      public static <A, B> Pair<A,B> of(A one, B two)
      Creates a new pair for two values of arbitrary type.
      Type Parameters:
      A - The type of the first value.
      B - The type of the second value.
      Parameters:
      one - First value.
      two - Second value.
      Returns:
      The pair.
      Throws:
      IllegalArgumentException - if all values are null.
    • one

      public A one()
      Returns:
      The one.
    • two

      public B two()
      Returns:
      The two.
    • toString

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

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

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