MapScrewdriver<K, V> extension
provides extensions for map
- on
-
- Map<
K, V>
- Map<
Properties
-
records
→ Iterable<
(K, V)> -
Similar to Map.entries but returns an iterable of records instead of
MapEntry.
no setter
Methods
-
except(
Iterable< K> keys) → Map<K, V> -
Returns a new Map with the same keys and values as this except
keys present
keys
. -
only(
Iterable< K> keys) → Map<K, V> -
Returns a new Map with the same keys and values but only contains
the keys present in
keys
. -
removeKeys(
Iterable< K> keys) → Map<K, V> -
Removes all the keys present in
keys
from this map. If this is an instance of UnmodifiableMapBase, it will return a new map with the same keys and values except the keys present inkeys
. -
toJson(
) → String - Converts this map into a JSON string.
-
where(
bool test(K key, V value)) → Map< K, V> -
Returns a new Map with the same keys and values as this where the
key-value pair satisfies the
test
function. Similar to Iterable.where. -
whereNot(
bool test(K key, V value)) → Map< K, V> -
Returns a new Map with the same keys and values as this where the
key-value pair doesn't satisfy the
test
function.
Operators
-
operator +(
(K, V) entry) → void - Allows to add a record entry to this.
-
operator <<(
MapEntry< K, V> entry) → void - Allows to add MapEntry to this.