MapExtensions<K, V> extension
- on
-
- Map<
K, V>
- Map<
Properties
-
invert
→ Map<
V, K> -
Available on Map<
Swaps keys and values (values must be unique)K, V> , provided by the MapExtensions extensionno setter - toJson → String
-
Available on Map<
Returns a parsed jsonK, V> , provided by the MapExtensions extensionstringof this map.no setter - toQueryString → String
-
Available on Map<
Converts the map into a URL query-string style representation (e.g. ?key1=value1&key2=value2)K, V> , provided by the MapExtensions extensionno setter
Methods
-
containsAllKeys(
List< K> keys) → bool -
Available on Map<
Checks if it contains all required keys.K, V> , provided by the MapExtensions extension -
containsAnyKey(
List< K> keys) → bool -
Available on Map<
Checks if it contains any key from a list.K, V> , provided by the MapExtensions extension -
ensureKey(
K key, V value) → void -
Available on Map<
Ensure that the map contains theK, V> , provided by the MapExtensions extensionkey. If not, add it with thevalueto prevent null or overriding values. -
excludeKeys(
List< K> keys) → Map<K, V> -
Available on Map<
Returns a new map containing entries whose keys are not in theK, V> , provided by the MapExtensions extensionkeyslist. -
excludeValues(
List< V> values) → Map<K, V> -
Available on Map<
Returns a new map containing entries whose values are not in theK, V> , provided by the MapExtensions extensionvalueslist. -
filterKeys(
bool test(K key)) → Map< K, V> -
Available on Map<
Returns a new map containing only entries whose keys satisfy a predicate.K, V> , provided by the MapExtensions extension -
filterValues(
bool test(V value)) → Map< K, V> -
Available on Map<
Returns a new map containing only entries whose values satisfy a predicate.K, V> , provided by the MapExtensions extension -
mapKeys<
K2> (K2 transform(K key)) → Map< K2, V> -
Available on Map<
Transforms all the keys in the map by applying aK, V> , provided by the MapExtensions extensiontransformfunction. -
mapValues<
V2> (V2 transform(V value)) → Map< K, V2> -
Available on Map<
Transforms all the values in the map by applying aK, V> , provided by the MapExtensions extensiontransformfunction. -
mergeWith(
Map< K, V> other, V combine(V value1, V value2)) → Map<K, V> -
Available on Map<
Merges two maps, using a custom combine function when keys overlap.K, V> , provided by the MapExtensions extension -
pickKeys(
List< K> keys) → Map<K, V> -
Available on Map<
Returns a new map containing entries whose keys are in theK, V> , provided by the MapExtensions extensionkeyslist. -
pickValues(
List< V> values) → Map<K, V> -
Available on Map<
Returns a new map containing entries whose values are in theK, V> , provided by the MapExtensions extensionvalueslist. -
safeUpdate(
K key, V value) → void -
Available on Map<
Updates only if the key already exists. Else, do nothing.K, V> , provided by the MapExtensions extension