sdk-common / com.tomtom.online.sdk.common.functional.collections / Lists / map

map

@NonNull static fun <A : Any!, B : Any!> map(@NonNull list: MutableList<A>, @NonNull mapper: (A) -> B): MutableList<B>

For the given List of values runs the given function on each list value and stores the result in another list.

Parameters

list - MutableList<A>: list of values that are going to be mapped

mapper - (A) -> B: function used for mapping

- value type

- result type

Return
MutableList<B>: list of mapped values