JunnyMapExtension<K, V> extension

提供对 Map 的便捷扩展操作,包括键值替换、过滤、对比等功能。

on

Methods

differentKeys(Map<K, V> other) Set<K>

Available on Map<K, V>, provided by the JunnyMapExtension extension

返回当前 Map 与另一个 Map other 中值不同的键集合。
moveKeyToLast(K key) Map<K, V>

Available on Map<K, V>, provided by the JunnyMapExtension extension

将指定的键 key 移动到 Map 的末尾。
otherDifference(Map<K, V> other) Map<K, V>

Available on Map<K, V>, provided by the JunnyMapExtension extension

返回一个新 Map,包含 other 中与当前 Map 比较后值不同的键值对。
removeKeys([Iterable<K>? keys]) Map<K, V>

Available on Map<K, V>, provided by the JunnyMapExtension extension

返回一个新 Map,去除指定的一组键 keys
replaceKey(K fromKey, [K? toKey]) Map<K, V>

Available on Map<K, V>, provided by the JunnyMapExtension extension

替换 Map 中的键 fromKeytoKey
retainKeys([Iterable<K>? keys]) Map<K, V>

Available on Map<K, V>, provided by the JunnyMapExtension extension

返回一个新 Map,仅保留指定的一组键 keys
thisDifference(Map<K, V> other) Map<K, V>

Available on Map<K, V>, provided by the JunnyMapExtension extension

返回一个新 Map,包含当前 Map 中与 other 比较后值不同的键值对。
withoutKey(K key) Map<K, V>

Available on Map<K, V>, provided by the JunnyMapExtension extension

返回一个新 Map,去除指定的键 key