associateBy
Returns a map containing the values provided by valueTransform and indexed by keySelector functions applied to elements of the given collection.
All pairs are added in order of iteration. If some key is already added to the map, adding new key-value pair with the key is resolved with resolve function which takes the key, current value corresponding to the key, and new value from the pair.
Return
the result map.
Parameters
lambda functions that generates keys for the key-value pairs.
lambda functions that generates value for the key-value pairs.
lambda function that resolves merge conflicts which receives some key, its current, and new corresponding values.
Returns a map containing the elements from the given collection indexed by the key returned from keySelector function applied to each element.
All pairs are added in order of iteration. If some key is already added to the map, adding new key-value pair with the key is resolved with resolve function which takes the key, current value corresponding to the key, and new value from the pair.
Return
the result map.
Parameters
lambda functions that generates keys for the key-value pairs.
lambda function that resolves merge conflicts which receives some key, its current, and new corresponding values.