putIfAbsent

actual fun putIfAbsent(key: K, value: V): V?
expect fun putIfAbsent(key: K, value: V): V?

Atomically associates the specified key with the given value if the key is not already associated with a value.

Return

the previous value associated with the key, or null if there was no mapping

Parameters

key

the key with which the specified value is to be associated

value

the value to be associated with the specified key

actual fun putIfAbsent(key: K, value: V): V?
actual fun putIfAbsent(key: K, value: V): V?
actual fun putIfAbsent(key: K, value: V): V?