alakazam.kotlin.core.MapExtensions.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlin-core Show documentation
Show all versions of kotlin-core Show documentation
A set of useful functions and extensions for Kotlin development.
package alakazam.kotlin.core
/**
* Returns a copied new map instance.
*/
public fun Map.deepCopy(): Map = mutableMapOf().also { it.putAll(this) }
/**
* Clears the map and inserts a new set of values.
*/
public fun MutableMap.replaceAllWith(list: Map) {
clear()
putAll(list)
}