Class DiffableUtils.MapDiff<K,T,M extends Map<K,T>>

java.lang.Object
org.elasticsearch.cluster.DiffableUtils.MapDiff<K,T,M>
Type Parameters:
K - the type of map keys
T - the type of map values
All Implemented Interfaces:
Diff<M>, Writeable
Enclosing class:
DiffableUtils

public static class DiffableUtils.MapDiff<K,T,M extends Map<K,T>> 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.
  • Field Details

  • Method Details

    • apply

      public M apply(M map)
      Description copied from interface: Diff
      Applies difference to the specified part and returns the resulted part
      Specified by:
      apply in interface Diff<K>
    • 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 List<Map.Entry<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 List<Map.Entry<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
    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Throws:
      IOException