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 two Maps, 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
    • 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<K,​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.
      • getRemovedEntries

        Map<K,​V> getRemovedEntries()
        Returns:
        A map with the keys of the removed entries, and the old value for each key.