toEnumMap

inline fun <K : Enum<K>, V : Any> Array<K>.toEnumMap(generator: (K) -> V): EnumMap<K, V>

Project the receiver onto an {@link EnumMap}, applying the function to each enum value of the array.

Return

A fully populated EnumMap.

Parameters

K

The key type, an Enum.

V

The value type produced by the function.

generator

The function to map keys to values.