Provide mutableListOf.
Deprecate linkedListOf. #KT-9663
This commit is contained in:
@@ -74,9 +74,18 @@ public fun <T> listOf(element: T): List<T> = Collections.singletonList(element)
|
||||
|
||||
/** Returns a new [LinkedList] with the given elements. */
|
||||
@JvmVersion
|
||||
@Deprecated("Use LinkedList constructor.", ReplaceWith("LinkedList(listOf(*elements))", "java.util.LinkedList"))
|
||||
public fun <T> linkedListOf(vararg elements: T): LinkedList<T>
|
||||
= if (elements.size == 0) LinkedList() else LinkedList(ArrayAsCollection(elements))
|
||||
|
||||
@Deprecated("Use LinkedList constructor.", ReplaceWith("LinkedList<T>()", "java.util.LinkedList"))
|
||||
public fun <T> linkedListOf() = LinkedList<T>()
|
||||
|
||||
|
||||
/** Returns a new [MutableList] with the given elements. */
|
||||
public fun <T> mutableListOf(vararg elements: T): MutableList<T>
|
||||
= if (elements.size == 0) ArrayList() else ArrayList(ArrayAsCollection(elements))
|
||||
|
||||
/** Returns a new [ArrayList] with the given elements. */
|
||||
public fun <T> arrayListOf(vararg elements: T): ArrayList<T>
|
||||
= if (elements.size == 0) ArrayList() else ArrayList(ArrayAsCollection(elements))
|
||||
|
||||
Reference in New Issue
Block a user