Class 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 Detail

      • 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.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object