Tuple2<T1, T2> extension

Extension methods on Record with 2 positional elements.

on
  • (T1, T2)

Properties

first → T1

Available on (T1, T2), provided by the Tuple2 extension

The first element of this tuple.
no setter
iterable → Iterable<Object?>

Available on (T1, T2), provided by the Tuple2 extension

An untyped Iterable over the values of this tuple.
no setter
last → T2

Available on (T1, T2), provided by the Tuple2 extension

The last element of this tuple.
no setter
length → int

Available on (T1, T2), provided by the Tuple2 extension

The number of elements in the tuple.
no setter
second → T2

Available on (T1, T2), provided by the Tuple2 extension

The second element of this tuple.
no setter

Methods

addFirst<T>(T value) → (T, T1, T2)

Available on (T1, T2), provided by the Tuple2 extension

Returns a new tuple with value added at the first position.
addLast<T>(T value) → (T1, T2, T)

Available on (T1, T2), provided by the Tuple2 extension

Returns a new tuple with value added at the last position.
addSecond<T>(T value) → (T1, T, T2)

Available on (T1, T2), provided by the Tuple2 extension

Returns a new tuple with value added at the second position.
addThird<T>(T value) → (T1, T2, T)

Available on (T1, T2), provided by the Tuple2 extension

Returns a new tuple with value added at the third position.
map<R>(R callback(T1 first, T2 second)) → R

Available on (T1, T2), provided by the Tuple2 extension

Transforms the elements of this tuple using callback.
removeFirst() → (T2)

Available on (T1, T2), provided by the Tuple2 extension

Returns a new tuple with the first element removed.
removeLast() → (T1)

Available on (T1, T2), provided by the Tuple2 extension

Returns a new tuple with the last element removed.
removeSecond() → (T1)

Available on (T1, T2), provided by the Tuple2 extension

Returns a new tuple with the second element removed.
toList() → List<Object?>

Available on (T1, T2), provided by the Tuple2 extension

Converts this tuple to an untyped List.
toSet() → Set<Object?>

Available on (T1, T2), provided by the Tuple2 extension

Converts this tuple to an untyped Set of unique values.
withFirst<T>(T value) → (T, T2)

Available on (T1, T2), provided by the Tuple2 extension

Returns a new tuple with the first element replaced by value.
withLast<T>(T value) → (T1, T)

Available on (T1, T2), provided by the Tuple2 extension

Returns a new tuple with the last element replaced by value.
withSecond<T>(T value) → (T1, T)

Available on (T1, T2), provided by the Tuple2 extension

Returns a new tuple with the second element replaced by value.

Static Methods

fromList<T>(List<T> list) → (T, T)

Available on (T1, T2), provided by the Tuple2 extension

Creates a tuple from the elements in list.