OptionalIterableExtension<T> extension
Extensions that apply to all iterables.
- on
-
- Iterable<
T>
- Iterable<
Properties
-
firstOptional
→ Optional<
T> -
Available on Iterable<
The first element, orT> , provided by the OptionalIterableExtension extensionOptional.empty()
if the iterable is empty.no setter -
lastOptional
→ Optional<
T> -
Available on Iterable<
The last element, orT> , provided by the OptionalIterableExtension extensionOptional.empty()
if the iterable is empty.no setter -
singleOptional
→ Optional<
T> -
Available on Iterable<
The single element of the iterable, orT> , provided by the OptionalIterableExtension extensionOptional.empty()
.no setter
Methods
-
firstWhereIndexedOptional(
bool test(int index, T element)) → Optional< T> -
Available on Iterable<
The first element whose value and index satisfiesT> , provided by the OptionalIterableExtension extensiontest
. -
firstWhereOptional(
bool test(T element)) → Optional< T> -
Available on Iterable<
The first element satisfyingT> , provided by the OptionalIterableExtension extensiontest
, orOptional.empty()
if there are none. -
lastWhereIndexedOptional(
bool test(int index, T element)) → Optional< T> -
Available on Iterable<
The last element whose index and value satisfiesT> , provided by the OptionalIterableExtension extensiontest
. -
lastWhereOptional(
bool test(T element)) → Optional< T> -
Available on Iterable<
The last element satisfyingT> , provided by the OptionalIterableExtension extensiontest
, orOptional.empty()
if there are none. -
singleWhereIndexedOptional(
bool test(int index, T element)) → Optional< T> -
Available on Iterable<
The single element satisfyingT> , provided by the OptionalIterableExtension extensiontest
. -
singleWhereOptional(
bool test(T element)) → Optional< T> -
Available on Iterable<
The single element satisfyingT> , provided by the OptionalIterableExtension extensiontest
.