Package cn.sliew.milky.common.diff
Class MapDiff<K,T,M>
- java.lang.Object
-
- cn.sliew.milky.common.diff.MapDiff<K,T,M>
-
- Type Parameters:
K- the type of map keysT- the type of map valuesM- the map implementation type
- All Implemented Interfaces:
Diff<M>,Serializable
- Direct Known Subclasses:
JdkMapDiff
public abstract class MapDiff<K,T,M> extends Object implements Diff<M>
Represents differences between two maps of objects and is used as base class for different map implementations.Implements serialization. How differences are applied is left to subclasses.
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<K>getDeletes()The keys that, when this diff is applied to a map, should be removed from the map.Map<K,Diff<T>>getDiffs()Map entries that, when this diff is applied to a map, should be incrementally updated.Map<K,T>getUpserts()Map entries that, when this diff is applied to a map, should be added to the map or fully replace the previous value.
-
-
-
Method Detail
-
getDeletes
public List<K> getDeletes()
The keys that, when this diff is applied to a map, should be removed from the map.- Returns:
- the list of keys that are deleted
-
getDiffs
public Map<K,Diff<T>> getDiffs()
Map entries that, when this diff is applied to a map, should be incrementally updated. The incremental update is represented using theDiffinterface.- Returns:
- the map entries that are incrementally updated
-
-