associateBy

inline fun <T, K> Array<out T>.associateBy(
    keySelector: (T) -> K
): Map<K, T>
(source)
inline fun <K> ByteArray.associateBy(
    keySelector: (Byte) -> K
): Map<K, Byte>
(source)
inline fun <K> ShortArray.associateBy(
    keySelector: (Short) -> K
): Map<K, Short>
(source)
inline fun <K> IntArray.associateBy(
    keySelector: (Int) -> K
): Map<K, Int>
(source)
inline fun <K> LongArray.associateBy(
    keySelector: (Long) -> K
): Map<K, Long>
(source)
inline fun <K> FloatArray.associateBy(
    keySelector: (Float) -> K
): Map<K, Float>
(source)
inline fun <K> DoubleArray.associateBy(
    keySelector: (Double) -> K
): Map<K, Double>
(source)
inline fun <K> BooleanArray.associateBy(
    keySelector: (Boolean) -> K
): Map<K, Boolean>
(source)
inline fun <K> CharArray.associateBy(
    keySelector: (Char) -> K
): Map<K, Char>
(source)

Returns a Map containing the elements from the given array indexed by the key returned from keySelector function applied to each element.

If any two elements would have the same key returned by keySelector the last one gets added to the map.

The returned map preserves the entry iteration order of the original array.

inline fun <T, K, V> Array<out T>.associateBy(
    keySelector: (T) -> K,
    valueTransform: (T) -> V
): Map<K, V>
(source)
inline fun <K, V> ByteArray.associateBy(
    keySelector: (Byte) -> K,
    valueTransform: (Byte) -> V
): Map<K, V>
(source)
inline fun <K, V> ShortArray.associateBy(
    keySelector: (Short) -> K,
    valueTransform: (Short) -> V
): Map<K, V>
(source)
inline fun <K, V> IntArray.associateBy(
    keySelector: (Int) -> K,
    valueTransform: (Int) -> V
): Map<K, V>
(source)
inline fun <K, V> LongArray.associateBy(
    keySelector: (Long) -> K,
    valueTransform: (Long) -> V
): Map<K, V>
(source)
inline fun <K, V> FloatArray.associateBy(
    keySelector: (Float) -> K,
    valueTransform: (Float) -> V
): Map<K, V>
(source)
inline fun <K, V> DoubleArray.associateBy(
    keySelector: (Double) -> K,
    valueTransform: (Double) -> V
): Map<K, V>
(source)
inline fun <K, V> BooleanArray.associateBy(
    keySelector: (Boolean) -> K,
    valueTransform: (Boolean) -> V
): Map<K, V>
(source)
inline fun <K, V> CharArray.associateBy(
    keySelector: (Char) -> K,
    valueTransform: (Char) -> V
): Map<K, V>
(source)

Returns a Map containing the values provided by valueTransform and indexed by keySelector functions applied to elements of the given array.

If any two elements would have the same key returned by keySelector the last one gets added to the map.

The returned map preserves the entry iteration order of the original array.

inline fun <T, K> Iterable<T>.associateBy(
    keySelector: (T) -> K
): Map<K, T>
(source)

Returns a Map containing the elements from the given collection indexed by the key returned from keySelector function applied to each element.

If any two elements would have the same key returned by keySelector the last one gets added to the map.

The returned map preserves the entry iteration order of the original collection.

inline fun <T, K, V> Iterable<T>.associateBy(
    keySelector: (T) -> K,
    valueTransform: (T) -> V
): Map<K, V>
(source)

Returns a Map containing the values provided by valueTransform and indexed by keySelector functions applied to elements of the given collection.

If any two elements would have the same key returned by keySelector the last one gets added to the map.

The returned map preserves the entry iteration order of the original collection.