Package groovy.lang

Class Tuple2<T1,T2>

All Implemented Interfaces:
Serializable, Cloneable, Comparable, Iterable, Collection, List, RandomAccess

public final class Tuple2<T1,T2> extends Tuple
Represents a list of 2 typed Objects.
See Also:
  • Constructor Details

    • Tuple2

      public Tuple2(T1 v1, T2 v2)
      Creates a tuple containing the supplied elements.
      Parameters:
      v1 - the first element
      v2 - the second element
    • Tuple2

      public Tuple2(Tuple2<T1,T2> tuple)
      Creates a tuple from the supplied tuple.
      Parameters:
      tuple - the source tuple
  • Method Details

    • getFirst

      @Deprecated public T1 getFirst()
      Deprecated.
      Returns the first element.
      Returns:
      the first element
    • getSecond

      @Deprecated public T2 getSecond()
      Deprecated.
      Returns the second element.
      Returns:
      the second element
    • getV1

      public T1 getV1()
      Returns the first element.
      Returns:
      the first element
    • getV2

      public T2 getV2()
      Returns the second element.
      Returns:
      the second element
    • clone

      public Tuple2<T1,T2> clone()
      Overrides:
      clone in class Tuple