From b3265024abf59cd309034022285d9af0bcaec10a Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Mon, 3 Dec 2012 20:27:22 +0400 Subject: [PATCH] list(), set() and map() -> listOf(), setOf() and mapOf() --- libraries/stdlib/src/kotlin/JUtilJVM.kt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libraries/stdlib/src/kotlin/JUtilJVM.kt b/libraries/stdlib/src/kotlin/JUtilJVM.kt index 41fb606e7b1..57909663473 100644 --- a/libraries/stdlib/src/kotlin/JUtilJVM.kt +++ b/libraries/stdlib/src/kotlin/JUtilJVM.kt @@ -3,30 +3,30 @@ package kotlin import java.util.* /** Returns a new read-only list of given elements */ -public fun list(vararg values: T): List = arrayListOf(*values) +public fun listOf(vararg values: T): List = arrayListOf(*values) /** Returns a new read-only set of given elements */ -public fun set(vararg values: T): Set = values.toCollection(LinkedHashSet()) +public fun setOf(vararg values: T): Set = values.toCollection(LinkedHashSet()) /** Returns a new read-only map of given pairs, where the first value is the key, and the second is value */ -public fun map(vararg values: Pair): Map = hashMapOf(*values) +public fun mapOf(vararg values: Pair): Map = hashMapOf(*values) /** Returns a new ArrayList with a variable number of initial elements */ public fun arrayListOf(vararg values: T) : ArrayList = values.toCollection(ArrayList(values.size)) -deprecated("Use list(...) or arrayListOf(...) instead") +deprecated("Use listOf(...) or arrayListOf(...) instead") public fun arrayList(vararg values: T) : ArrayList = arrayListOf(*values) /** Returns a new LinkedList with a variable number of initial elements */ public fun linkedListOf(vararg values: T) : LinkedList = values.toCollection(LinkedList()) -deprecated("Use list(...) or linkedListOf(...) instead") +deprecated("Use listOf(...) or linkedListOf(...) instead") public fun linkedList(vararg values: T) : LinkedList = linkedListOf(*values) /** Returns a new HashSet with a variable number of initial elements */ public fun hashSetOf(vararg values: T) : HashSet = values.toCollection(HashSet(values.size)) -deprecated("Use set(...) or hashSetOf(...) instead") +deprecated("Use setOf(...) or hashSetOf(...) instead") public fun hashSet(vararg values: T) : HashSet = hashSetOf(*values) /** @@ -63,7 +63,7 @@ public fun hashMapOf(vararg values: Pair): HashMap { return answer } -deprecated("Use map(...) or hashMapOf(...) instead") +deprecated("Use mapOf(...) or hashMapOf(...) instead") public fun hashMap(vararg values: Pair): HashMap = hashMapOf(*values) /**