MapUtils extension
- on
Properties
Methods
-
camelCaseKeys<
V> () → Map< String, V> - Camel case all keys in the map. Returns a new map with camel cased keys.
-
camelCaseValues<
K> () → Map< K, String> - Camel case all values in the map. Returns a new map with camel cased values.
-
capitalizeKeys<
V> () → Map< String, V> - Capitalize all keys in the map. Returns a new map with capitalized keys.
-
capitalizeValues<
K> () → Map< K, String> - Capitalize all values in the map. Returns a new map with capitalized values.
-
contains(
Object key, Object value) → bool -
Available on Map, provided by the MapUtils extension
Returnstrueif the map contains the specifiedkeyandvalue,falseotherwise. -
filter<
K, V> (bool predicate(K key, V value)) → Map< K, V> -
Available on Map, provided by the MapUtils extension
Returns a new map with all entries that satisfy the givenpredicate. The entries in the resulting map preserve the order of the original map. -
filterEmpty<
K, V> () → Map< K, V> - Filter empty values from the map. Returns a new map with non-empty values.
-
filterKeys<
K, V> (Iterable< K> keys) → Map<K, V> -
Available on Map, provided by the MapUtils extension
Filter where the key is in the givenkeys. Returns a new map with filtered entries. -
filterNot<
K, V> (bool predicate(K key, V value)) → Map< K, V> -
Available on Map, provided by the MapUtils extension
Returns a new map with all entries that satisfy the givenpredicate. The entries in the resulting map do not preserve the order of the original map. -
filterNull<
K, V> () → Map< K, V> - Filter null values from the map. Returns a new map with non-null values.
-
filterValues<
K, V> (Iterable< V> values) → Map<K, V> -
Available on Map, provided by the MapUtils extension
Filter where the value is in the givenvalues. Returns a new map with filtered entries. -
kebabCaseKeys<
V> () → Map< String, V> - Kebab case all keys in the map. Returns a new map with kebab cased keys.
-
kebabCaseValues<
K> () → Map< K, String> - Kebab case all values in the map. Returns a new map with kebab cased values.
-
partition<
K, V> (bool predicate(K key, V value)) → Pair< Map< K, V> , Map<K, V> > -
Available on Map, provided by the MapUtils extension
Split map into two maps based on thepredicate. Returns a list of two maps. -
prefixKeys<
V> (String prefix) → Map< String, V> - Add prefix to all keys in the map. Returns a new map with prefixed keys.
-
prefixValues<
K> (String prefix) → Map< K, String> - Add prefix to all values in the map. Returns a new map with prefixed values.
-
printDebug<
K, V> ({String label = 'Map', String separator = ': ', String indent = ' '}) → void -
Available on Map, provided by the MapUtils extension
debug print the map withlabelandseparator.labelis the label for the map.separatoris the separator between key and value.indentis the indent for each line. -
reject<
K, V> (bool predicate(K key, V value)) → Map< K, V> -
Available on Map, provided by the MapUtils extension
Returns a new map with all entries that do not satisfy the givenpredicate. The entries in the resulting map preserve the order of the original map. -
rejectKeys<
K, V> (Iterable< K> keys) → Map<K, V> -
Available on Map, provided by the MapUtils extension
Filter where the key is not in the givenkeys. Returns a new map with filtered entries. -
rejectNot<
K, V> (bool predicate(K key, V value)) → Map< K, V> -
Available on Map, provided by the MapUtils extension
Returns a new map with all entries that do not satisfy the givenpredicate. The entries in the resulting map do not preserve the order of the original map. -
rejectValues<
K, V> (Iterable< V> values) → Map<K, V> -
Available on Map, provided by the MapUtils extension
Filter where the value is not in the givenvalues. Returns a new map with filtered entries. -
removeExact(
{required Object key, required Object value}) → bool -
Available on Map, provided by the MapUtils extension
Returnstrueif the map contains the specifiedkeyandvalueand removes the entry,falseotherwise. -
shift<
K, V> () → MapEntry< K, V> - Shift the first entry from the map.
-
snakeCaseKeys<
V> () → Map< String, V> - Snake case all keys in the map. Returns a new map with snake cased keys.
-
snakeCaseValues<
K> () → Map< K, String> - Snake case all values in the map. Returns a new map with snake cased values.
-
suffixKeys<
V> (String suffix) → Map< String, V> - Add suffix to all keys in the map. Returns a new map with suffixed keys.
-
suffixValues<
K> (String suffix) → Map< K, String> - Add suffix to all values in the map. Returns a new map with suffixed values.
-
uniqueValues<
K, V> () → Map< K, V> - Remove duplicate values from the map. Returns a new map with unique values.