Class Pair<A,​B>

  • Type Parameters:
    A - type of the left element.
    B - type of the right element.
    All Implemented Interfaces:
    Serializable

    public final class Pair<A,​B>
    extends Object
    implements Serializable
    Pair class.
    See Also:
    Serialized Form
    • Method Detail

      • left

        public A left()
        Returns:
        left element.
      • right

        public B right()
        Returns:
        right element
      • hashCode

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

        public static <A,​B> Pair<A,​B> of​(A left,
                                                     B right)
        Static initializer of the Pair class.
        Type Parameters:
        A - Type of the left element.
        B - Type of the right element.
        Parameters:
        left - left element.
        right - right element.
        Returns:
        the newly created Pair.