IterableExtensions<T> extension
- on
-
- Iterable<
T> ?
- Iterable<
Properties
- firstOrNull → T?
-
Available on Iterable<
Returns first element or null otherwiseT> ?, provided by the IterableExtensions extensionno setter - lastOrNull → T?
-
Available on Iterable<
T> ?, provided by the IterableExtensions extensionno setter
Methods
-
any(
bool predicate(T element)) → bool -
Available on Iterable<
ReturnsT> ?, provided by the IterableExtensions extensiontrue
if at least one element matches the givenpredicate
. -
countWhere(
bool predicate(T element)) → int -
Available on Iterable<
Returns count of elements that matches the givenT> ?, provided by the IterableExtensions extensionpredicate
. Returns -1 if iterable is null -
elementAtOrNull(
int? index) → T? -
Available on Iterable<
T> ?, provided by the IterableExtensions extension -
filter(
bool test(T element)) → List< T> -
Available on Iterable<
Returns a list containing only elements matching the givenT> ?, provided by the IterableExtensions extensionpredicate!
-
filterNot(
bool test(T element)) → List< T> -
Available on Iterable<
Returns a list containing all elements not matching the givenT> ?, provided by the IterableExtensions extensionpredicate!
-
filterNotNull(
) → List< T> -
Available on Iterable<
Returns a list containing all elements that are not nullT> ?, provided by the IterableExtensions extension -
firstWhereOrNull(
bool test(T element)) → T? -
Available on Iterable<
Returns first element by given predicate or null otherwiseT> ?, provided by the IterableExtensions extension -
forEachIndexed(
void action(T element, int index)) → void -
Available on Iterable<
Performs the given action on each element on iterable, providing sequential index with the element.T> ?, provided by the IterableExtensions extensionelement!
the element on the current iterationindex!
the index of the current iteration -
groupBy<
T, K> (K keySelector(T e)) → Map< K, List< T> > -
Available on Iterable<
Groups elements of the original collection by the key returned by the givenT> ?, provided by the IterableExtensions extensionkeySelector
function applied to each element and returns a map where each group key is associated with a list of corresponding elements. -
intersect(
Iterable other) → Set< T> -
Available on Iterable<
Returns a set containing all elements that are contained by both this set and the specified collection.T> ?, provided by the IterableExtensions extension -
isNotNullOrEmpty(
) → bool -
Available on Iterable<
ReturnsT> ?, provided by the IterableExtensions extensionfalse
if this nullable iterable is eithernull
or empty. -
isNullOrEmpty(
) → bool -
Available on Iterable<
ReturnsT> ?, provided by the IterableExtensions extensiontrue
if this nullable iterable is eithernull
or empty. -
mapIndexed<
R> (R convert(int index, T element)) → Iterable< R> -
Available on Iterable<
Maps each element and its index to a new value.T> ?, provided by the IterableExtensions extension -
subtract(
Iterable< T> other) → Set<T> -
Available on Iterable<
Returns a set containing all elements that are contained by this collection and not contained by the specified collection.T> ?, provided by the IterableExtensions extension -
take(
int n) → List< T> -
Available on Iterable<
Returns a list containing firstT> ?, provided by the IterableExtensions extensionn
elements. -
toSet(
) → Set< T> -
Available on Iterable<
Convert iterable to setT> ?, provided by the IterableExtensions extension -
union(
Iterable< T> other) → Set<T> -
Available on Iterable<
Returns a set containing all distinct elements from both collections.T> ?, provided by the IterableExtensions extension