Class Tuple<T,​U>

  • Type Parameters:
    T - The type of the first element in the tuple.
    U - The type of the second element in the tuple.

    public final class Tuple<T,​U>
    extends Object
    Tuple class.
    • Method Detail

      • of

        public static <T,​U> Tuple<T,​U> of​(T first,
                                                      U second)
        Creates a tuple from two value.
        Type Parameters:
        T - The type of the first value.
        U - The type of the second value.
        Parameters:
        first - The first value.
        second - The second value.
        Returns:
        A new tuple.
      • getFirst

        public T getFirst()
        Gets the first value.
        Returns:
        The first value.
      • getSecond

        public U getSecond()
        Gets the second value.
        Returns:
        The second value.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object