IterableExt<T extends Object> extension
- on
-
- Iterable<
T>
- Iterable<
Properties
-
firstOrNone
→ Option<
T> -
Available on Iterable<
Returns the first element as a Some, or None if the Iterable is empty.T> , provided by the IterableExt extensionno setter -
lastOrNone
→ Option<
T> -
Available on Iterable<
Returns the last element as a Some, or None if the Iterable is empty.T> , provided by the IterableExt extensionno setter -
noneIfEmpty
→ Option<
Iterable< T> > -
Available on Iterable<
Returns this Iterable wrapped in a Some if it's not empty, otherwise returns None.T> , provided by the IterableExt extensionno setter -
singleOrNone
→ Option<
T> -
Available on Iterable<
Returns the single element as a Some, or None if the Iterable does not contain exactly one element.T> , provided by the IterableExt extensionno setter
Methods
-
elementAtOrNone(
int index) → Option< T> -
Available on Iterable<
Returns the element at the givenT> , provided by the IterableExt extensionindex
as a Some, or None if the index is out of bounds. -
firstWhereOrNone(
bool test(T element)) → Option< T> -
Available on Iterable<
Returns the first element satisfyingT> , provided by the IterableExt extensiontest
as a Some, or None. -
lastWhereOrNone(
bool test(T element)) → Option< T> -
Available on Iterable<
Returns the last element satisfyingT> , provided by the IterableExt extensiontest
as a Some, or None. -
reduceOrNone(
T combine(T value, T element)) → Option< T> -
Available on Iterable<
Reduces the collection to a single value by iteratively combining elements. Returns the result as a Some, or None if the Iterable is empty.T> , provided by the IterableExt extension -
singleWhereOrNone(
bool test(T element)) → Option< T> -
Available on Iterable<
Returns the single element satisfyingT> , provided by the IterableExt extensiontest
as a Some, or None.