getOrPut method
V
getOrPut(
- K key,
- V put()
Returns the value for key, computing and storing it if absent.
Implementation
V getOrPut(K key, V Function() put) {
if (!containsKey(key)) {
this[key] = put();
}
return this[key] as V;
}