RequireNoNullsKtIterableExtension<T> extension
Methods
-
filterNotNull()
→ KtList<T>
-
Returns a list containing all elements that are not
null
.
-
filterNotNullTo<C extends KtMutableCollection>(C destination)
→ C
-
Appends all elements that are not
null
to the given destination
.
-
mapIndexedNotNull<R>(R? transform(int index, T?))
→ KtList<R>
-
Returns a list containing only the non-null results of applying the given
transform
function
to each element and its index in the original collection.
@param transform
function that takes the index of an element and the element itself
and returns the result of the transform applied to the element.
-
mapIndexedNotNullTo<R, C extends KtMutableCollection<R>>(C destination, R? transform(int index, T?))
→ C
-
Applies the given
transform
function to each element and its index in the original collection
and appends only the non-null results to the given destination
.
@param transform
function that takes the index of an element and the element itself
and returns the result of the transform applied to the element.
-
mapNotNull<R>(R? transform(T?))
→ KtList<R>
-
Returns a list containing the results of applying the given
transform
function
to each element in the original collection.
-
mapNotNullTo<R, C extends KtMutableCollection<R>>(C destination, R? transform(T?))
→ C
-
Applies the given
transform
function to each element in the original collection
and appends only the non-null results to the given destination
.
-
requireNoNulls()
→ KtIterable<T>
-
Returns an original collection containing all the non-
null
elements, throwing an ArgumentError if there are any null
elements.