put

fun put(key: K, value: V)

Adds the specified key-value pair to the map. If the key already exists, the value is updated. Observers are notified if the value changes.

Parameters

key

The key to be added or updated in the map.

value

The value associated with the specified key.