ObjMapExt<K, V> extension
Methods
-
addAll(Map<K, V> other)
→ void
-
Adds all key/value pairs of
other
to this map.
-
addEntries(Iterable<MapEntry<K, V>> newEntries)
→ void
-
Adds all key/value pairs of
newEntries
to this map.
-
cast<RK, RV>()
→ Map<RK, RV>
-
Provides a view of this map as having
RK
keys and RV
instances,
if necessary.
-
clear()
→ void
-
Removes all entries from the map.
-
containsKey(Object? key)
→ bool
-
Whether this map contains the given
key
.
-
containsValue(Object? valueToEvaluate)
→ bool
-
Whether this map contains the given value.
-
forEach(void action(K key, V value))
→ void
-
Applies
action
to each key/value pair of the map.
-
map<K2, V2>(MapEntry<K2, V2> convert(K key, V value))
→ Map<K2, V2>
-
Returns a new map where all entries of this map are transformed by
the given
convert
function.
-
putIfAbsent(K key, V ifAbsent())
→ V
-
Look up the value of
key
, or add a new entry if it isn't there.
-
remove(Object? key)
→ V?
-
Removes
key
and its associated value, if present, from the map.
-
removeWhere(bool test(K key, V value))
→ void
-
Removes all entries of this map that satisfy the given
test
.
-
updateAll(V update(K key, V value))
→ void
-
Updates all values.
-
updateMap(K key, V update(V value), {V ifAbsent()?})
→ V
-
Updates the value for the provided
key
.
Operators
-
operator [](Object? key)
→ V?
-
The value for the given
key
, or null
if key
is not in the map.
-
operator []=(K key, V valueToSet)
→ void
-
Associates the
key
with the given value.