set Default
fun <K, V> Map<K, V>.setDefault(defaultValue: (key: K) -> V): MapWithDefault<K, V>
Content copied to clipboard
Create a new MapWithDefault from given map and for each unknown key, returns the value provided by defaultValue provider.
fun <K, V> MutableMap<K, V>.setDefault(defaultValue: (key: K) -> V): MutableMapWithDefault<K, V>
Content copied to clipboard
Create a new MutableMapWithDefault from given map and for each unknown key, returns the value provided by defaultValue provider.