Kotlin HashSet mapNotNullTo()
Syntax & Examples


Syntax of HashSet.mapNotNullTo()

The syntax of HashSet.mapNotNullTo() extension function is:

fun <T, R : Any, C : MutableCollection<in R>> Iterable<T>.mapNotNullTo( destination: C, transform: (T) -> R? ): C

This mapNotNullTo() extension function of HashSet applies the given transform function to each element in the original collection and appends only the non-null results to the given destination.