Class Tuple<A,​B>

  • Type Parameters:
    A - Type one
    B - Type two

    public final class Tuple<A,​B>
    extends Object
    Tuples are immutable objects. Tuple with 2 Objects.
    Author:
    pchretien
    • Method Detail

      • of

        public static <A,​B> Tuple<A,​B> of​(A val1,
                                                      B val2)
        Creates a Tuple with 2 objects
        Parameters:
        val1 - the first object
        val2 - the second object
        Returns:
        the new tuple created
      • getVal1

        public A getVal1()
        Returns:
        Value#1.
      • getVal2

        public B getVal2()
        Returns:
        Value#2.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object