Package de.xima.fc.workflow.model
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
- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface de.xima.fc.interfaces.IMapDiff
IMapDiff.IModifiedValue<V>
-
Method Summary
Modifier and TypeMethodDescriptionvoid
applyBackward
(Map<K, V> map) Applies the diff represented by this instance to the given map.void
applyForward
(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 twoMap
s.static <K,
V> IMapDiff<K, V> empty()
boolean
int
hashCode()
-
Method Details
-
applyBackward
Description copied from interface:IMapDiff
Applies 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:
applyBackward
in interfaceIMapDiff<K,
V> - Parameters:
map
- Map to modify.
-
applyForward
Description copied from interface:IMapDiff
Applies 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:
applyForward
in interfaceIMapDiff<K,
V> - Parameters:
map
- Map to modify.
-
equals
-
getAddedEntries
- Specified by:
getAddedEntries
in interfaceIMapDiff<K,
V> - Returns:
- A map with the keys of the newly added entries, and the new value for each key.
-
getModifiedEntries
- Specified by:
getModifiedEntries
in interfaceIMapDiff<K,
V> - Returns:
- A map with the keys of the modified entries, together with the old and new value for each key.
-
getRemovedEntries
- Specified by:
getRemovedEntries
in interfaceIMapDiff<K,
V> - Returns:
- A map with the keys of the removed entries, and the old value for each key.
-
hashCode
public int hashCode() -
betweenMaps
Computes and returns the difference between twoMap
s.- 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).
-