Class MapDiff<K,​T,​M>

  • Type Parameters:
    K - the type of map keys
    T - the type of map values
    M - 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
    • Field Detail

      • deletes

        protected final List<K> deletes
      • diffs

        protected final Map<K,​Diff<T>> diffs
      • upserts

        protected final Map<K,​T> upserts
    • Constructor Detail

      • MapDiff

        public MapDiff()
    • 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 the Diff interface.
        Returns:
        the map entries that are incrementally updated
      • getUpserts

        public 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.
        Returns:
        the map entries that are additions or full updates