Class MapDiff<K,V>
java.lang.Object
de.xima.fc.workflow.model.MapDiff<K,V>
- Type Parameters:
K- Type of the map's keys.V- Type of the map's values.
- All Implemented Interfaces:
IMapDiff<K,V>, Serializable
-
Nested Class Summary
Nested classes/interfaces inherited from interface IMapDiff
IMapDiff.IModifiedValue<V> -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyBackward(Map<K, V> map) Applies the diff represented by this instance to the given map.voidapplyForward(Map<? super K, ? super V> map) Applies the diff represented by this instance to the given map.static <K,V> IMapDiff <K, V> betweenMaps(Map<K, V> oldMap, Map<K, V> newMap) Computes and returns the difference between twoMaps.static <K,V> IMapDiff <K, V> empty()booleaninthashCode()
-
Method Details
-
applyBackward
Description copied from interface:IMapDiffApplies the diff represented by this instance to the given map. If this is called on the map new map used to create the diff, this method turns it into the old map.- Specified by:
applyBackwardin interfaceIMapDiff<K,V> - Parameters:
map- Map to modify.
-
applyForward
Description copied from interface:IMapDiffApplies the diff represented by this instance to the given map. If this is called on the map old map used to create the diff, this method turns it into the new map.- Specified by:
applyForwardin interfaceIMapDiff<K,V> - Parameters:
map- Map to modify.
-
equals
-
getAddedEntries
-
getModifiedEntries
- Specified by:
getModifiedEntriesin interfaceIMapDiff<K,V> - Returns:
- A map with the keys of the modified entries, together with the old and new value for each key.
-
getRemovedEntries
-
hashCode
-
betweenMaps
Computes and returns the difference between twoMaps.- Type Parameters:
K- Type of the map's keys.V- Type of the map's values.- Parameters:
oldMap- Previous map.newMap- New map.- Returns:
- The diff between the two maps.
-
empty
- Returns:
- A diff with no entries (no added, removed, or modified entries).
-