GetOrPut<K, V> extension

on

Methods

getOrPut(K key, V defaultValue(K value)) → V
Returns the value for the given key. If the key is not found in the map, calls the defaultValue function, puts its result into the map under the given key and returns it.