public interface Tuple
Elementary implementation of tuples, i.e, ordered sequences of items of arbitrary types. Tuples are generally
immutable and their main use is to get methods return multiple values with maximum compile-time safety. A concrete
tuple class is defined for each "arity", e.g., Tuple2
for 2 elements. Currently tuple classes for 2, 3 and 4
elements are defined.
A tuple may be instantiated using either the class constructor, e.g.,
new Tuple2<Integer, String>(10, "Foo")
or the associated static method
Tuple2.of(10, "Foo")Individual tuple elements can be accessed (read-only) by the associated field names, e.g.
f0
, f1
...
etc. There are no getter methods.