MapExtensions<K, V> extension

Provides extended methods for Map.

Map用の拡張メソッドを提供します。

on

Properties

isJsonEncodable bool
If this object is Json encodable, true is returned.
no setter

Methods

addAllIfEmpty(Map<K, V>? others) → void
Add others to Map.
addWith(Map<K, V> others, Iterable<K> keys) Map<K, V>
Set only the value of the key specified by keys in the map specified by others.
containsKeyAll(Iterable<Object?> keys) bool
Returns true if all keys are included in the keys of Map.
containsKeyAny(Iterable<Object?> keys) bool
Returns true if any of the keys in Map contain any of the keys in keys.
containsValueAll(Iterable<Object?> values) bool
Returns true if the value of Map contains all values.
containsValueAny(Iterable<Object?> values) bool
Returns true if the value of Map contains one of values.
equalsTo(Map<K, V> others) bool
Returns true if the internals of Map and others are compared and match.
get<T>(K key, T orElse) → T
Retrieves the element key from Map.
getAsDateTime(K key, [DateTime? orElse]) DateTime
Retrieves the element of key of type Map from Map.
getAsDouble(K key, [double orElse = 0.0]) double
Retrieves the element of key of type double from Map.
getAsInt(K key, [int orElse = 0]) int
Retrieves the element of key of type int from Map.
getAsList<T>(K key, [List<T>? orElse]) List<T>
Retrieves the element of key of type List from Map.
getAsMap<T>(K key, [Map<String, T>? orElse]) Map<String, T>
Retrieves the element of key of type Map from Map.
getAsSet<T>(K key, [Set<T>? orElse]) Set<T>
Retrieves the element of key of type Set from Map.
merge(Map<K, V>? others, {K convertKeys(K key)?, V convertValues(V value)?}) Map<K, V>
Merges elements of others into Map.
toList<T>(T callback(K key, V value)) Iterable<T>
Returns a list of callback return values generated from Map.
where(bool test(K key, V value)) Map<K, V>
Extracts only elements for which the return value of the callback given by test is true.