Hide toMap with keySelector

#KT-6657
This commit is contained in:
Ilya Gorbunov
2015-11-30 04:18:40 +03:00
parent ea60ab74a7
commit 0ffce06356
5 changed files with 41 additions and 41 deletions
@@ -1064,13 +1064,13 @@ public fun <T> Iterable<T>.toList(): List<T> {
return this.toArrayList()
}
@Deprecated("Use toMapBy instead.", ReplaceWith("toMapBy(selector)"))
@Deprecated("Use toMapBy instead.", ReplaceWith("toMapBy(selector)"), level = DeprecationLevel.HIDDEN)
public inline fun <T, K> Iterable<T>.toMap(selector: (T) -> K): Map<K, T> {
return toMapBy(selector)
}
/**
* Returns Map containing the values provided by [transform] and indexed by [selector] functions applied to elements of the given collection.
* Returns a [Map] containing the values provided by [transform] and indexed by [selector] functions applied to elements of the given collection.
* If any two elements would have the same key returned by [selector] the last one gets added to the map.
*/
public inline fun <T, K, V> Iterable<T>.toMap(selector: (T) -> K, transform: (T) -> V): Map<K, V> {
@@ -1083,7 +1083,7 @@ public inline fun <T, K, V> Iterable<T>.toMap(selector: (T) -> K, transform: (T)
}
/**
* Returns Map containing the elements from the given collection indexed by the key
* Returns a [Map] containing the elements from the given collection indexed by the key
* returned from [selector] function applied to each element.
* If any two elements would have the same key returned by [selector] the last one gets added to the map.
*/