Class Tuple2<T1,​T2>

  • Type Parameters:
    T1 - the type of the first value.
    T2 - the type of the second value.

    public final class Tuple2<T1,​T2>
    extends Object
    A container for two values. Use the corresponding Tuple.create(Object, Object) method to instantiate this tuple.
    Since:
    1.0
    Author:
    Michael Nitschinger
    • Method Detail

      • value1

        public T1 value1()
        Get the first value.
        Returns:
        the first value.
      • value2

        public T2 value2()
        Get the second value.
        Returns:
        the second value.
      • swap

        public Tuple2<T2,​T1> swap()
        Create a new Tuple2 where the two values are swapped.
        Returns:
        the swapped values in a new tuple.