Add samples for mapNotNull, find, getOrNull functions
This commit is contained in:
committed by
Abduqodiri Qurbonzoda
parent
62df2b3195
commit
41d5615608
@@ -98,6 +98,8 @@ public inline fun <K, V, R> Map<out K, V>.map(transform: (Map.Entry<K, V>) -> R)
|
||||
/**
|
||||
* Returns a list containing only the non-null results of applying the given [transform] function
|
||||
* to each entry in the original map.
|
||||
*
|
||||
* @sample samples.collections.Maps.Transformations.mapNotNull
|
||||
*/
|
||||
public inline fun <K, V, R : Any> Map<out K, V>.mapNotNull(transform: (Map.Entry<K, V>) -> R?): List<R> {
|
||||
return mapNotNullTo(ArrayList<R>(), transform)
|
||||
|
||||
Reference in New Issue
Block a user