Maps<K, V> extension

Provides functions for working with Maps.

on

Methods

inverse() Map<V, List<K>>
Inverts this map with keys becoming values and vice versa.
putAll(Map<K, V> other, {required V resolve(K key, V existing, V other)}) → void
Adds all entries in other to this map, using resolve to resolve conflicting entries.
rekey<K1>(K1 convert(K key)) Map<K1, V>
Returns a copy of this map with its keys transformed using convert.
retainWhere(bool predicate(K key, V value)) → void
Retains all entries that satisfy the given predicate.
revalue<V1>(V1 convert(V value)) Map<K, V1>
Returns a copy of this map with its values transformed using convert.
where(bool predicate(K key, V value)) Map<K, V>
Eagerly returns a map with only entries that satisfy the given predicate.

Static Methods

merge<K, V>(Map<K, V> a, Map<K, V> b, {required V resolve(K key, V a, V b)}) Map<K, V>
Merges a and b, using resolve to resolve conflicting entries.