Interface: MapDiff

Methods

addedKeys

addedKeys() returns rules.Set

Returns a rules.Set, which lists any keys that the Map calling diff() contains that the Map passed to diff() does not.

Returns

non-null rules.Set , a list of keys added to the rules.Map passed to the Map.diff() function.

Example

{"a":1}.diff({}).addedKeys() == ["a"].toSet()

affectedKeys

affectedKeys() returns rules.Set

Returns a rules.Set, which lists any keys that have been added to, removed from or modified from the Map calling diff() compared to the Map passed to diff(). This function returns the set equivalent to the combined results of MapDiff.addedKeys(), MapDiff.removedKeys() and MapDiff.changedKeys().

({"a":0, "c":0, "u":0}).diff({"r":0, "c":1, "u": 0}).affectedKeys() ==
     ["a", "r", "c"].toSet()
Returns

non-null rules.Set ,a list of keys added to, removed from or changed from the rules.Map passed to the Map.diff() function.

changedKeys

changedKeys() returns rules.Set

Returns a rules.Set, which lists any keys that appear in both the Map calling diff() and the Map passed to diff(), but whose values are not equal.

Returns

non-null rules.Set , a list of keys that appear in both rules.Maps but whose values are not equal.

Example

{"a":0}.diff({"a":1, "b":4}).changedKeys() == ["a"].toSet()

removedKeys

removedKeys() returns rules.Set

Returns a rules.Set, which lists any keys that the Map calling diff() does not contain compared to the Map passed to diff().

Returns

non-null rules.Set , a list of keys removed from the rules.Map passed to the Map.diff() function.

Example

{}.diff({"a":1}).removedKeys() == ["a"].toSet()

unchangedKeys

unchangedKeys() returns rules.Set

Returns a rules.Set, which lists any keys that appear in both the Map calling diff() and the Map passed to diff(), and whose values are equal.

Returns

non-null rules.Set , a list of keys that appear in both rules.Maps but whose values are equal.

Example

{"a": 0}.diff({"a":0}).unchangedKeys() == ["a"].toSet()
  翻译: