Package de.xima.fc.interfaces
Interface IMapDiff<K,V>
-
- Type Parameters:
K
- Type of the map's keys.V
- Type of the map's values.
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
MapDiff
public interface IMapDiff<K,V> extends Serializable
Represents the different between twoMap
s, i.e. when comparing two maps m1 and m2, which keys were removed, which keys were added, and which values were changed.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
IMapDiff.IModifiedValue<V>
Represents a value that was changed, used bygetModifiedEntries()
.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
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.Map<K,V>
getAddedEntries()
Map<K,IMapDiff.IModifiedValue<V>>
getModifiedEntries()
Map<K,V>
getRemovedEntries()
-
-
-
Method Detail
-
applyBackward
void applyBackward(Map<K,V> map)
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.- Parameters:
map
- Map to modify.
-
applyForward
void applyForward(Map<? super K,? super V> map)
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.- Parameters:
map
- Map to modify.
-
getAddedEntries
Map<K,V> getAddedEntries()
- Returns:
- A map with the keys of the newly added entries, and the new value for each key.
-
getModifiedEntries
Map<K,IMapDiff.IModifiedValue<V>> getModifiedEntries()
- Returns:
- A map with the keys of the modified entries, together with the old and new value for each key.
-
-