Class TrackingMap<V>

java.lang.Object
org.jboss.resteasy.specimpl.MultivaluedTreeMap<String,V>
org.jboss.resteasy.util.CaseInsensitiveMap<V>
org.jboss.resteasy.client.jaxrs.internal.TrackingMap<V>
All Implemented Interfaces:
jakarta.ws.rs.core.MultivaluedMap<String,V>, Serializable, Cloneable, Map<String,List<V>>

public class TrackingMap<V> extends org.jboss.resteasy.util.CaseInsensitiveMap<V> implements jakarta.ws.rs.core.MultivaluedMap<String,V>, Cloneable
A decorator class to track changes to the underlying map. Tracks the keys that are either added/replaced/modified in addedOrUpdatedKeys. Tracks the keys that are removed in removedKeys.

Known Limitation: The get and getFirst methods returns the list(since this is an instance of MultivaluedMap) value of the given key. Any direct changes to the underlying list will not be tracked.

See Also:
  • Constructor Details

    • TrackingMap

      public TrackingMap(org.jboss.resteasy.util.CaseInsensitiveMap<V> delegate)
  • Method Details

    • getAddedOrUpdatedKeys

      public Set<String> getAddedOrUpdatedKeys()
    • getRemovedKeys

      public Set<String> getRemovedKeys()
    • add

      public void add(String key, V value)
      Specified by:
      add in interface jakarta.ws.rs.core.MultivaluedMap<String,V>
      Overrides:
      add in class org.jboss.resteasy.specimpl.MultivaluedTreeMap<String,V>
    • addFirst

      public void addFirst(String key, V value)
      Specified by:
      addFirst in interface jakarta.ws.rs.core.MultivaluedMap<String,V>
      Overrides:
      addFirst in class org.jboss.resteasy.specimpl.MultivaluedTreeMap<String,V>
    • put

      public List<V> put(String key, List<V> value)
      Specified by:
      put in interface Map<String,List<V>>
      Overrides:
      put in class org.jboss.resteasy.specimpl.MultivaluedTreeMap<String,V>
    • putSingle

      public void putSingle(String key, V value)
      Specified by:
      putSingle in interface jakarta.ws.rs.core.MultivaluedMap<String,V>
      Overrides:
      putSingle in class org.jboss.resteasy.specimpl.MultivaluedTreeMap<String,V>
    • replace

      public boolean replace(String key, List<V> oldValue, List<V> newValue)
      Specified by:
      replace in interface Map<String,List<V>>
    • replace

      public List<V> replace(String key, List<V> value)
      Specified by:
      replace in interface Map<String,List<V>>
    • addAll

      public void addAll(String key, List<V> valueList)
      Specified by:
      addAll in interface jakarta.ws.rs.core.MultivaluedMap<String,V>
      Overrides:
      addAll in class org.jboss.resteasy.specimpl.MultivaluedTreeMap<String,V>
    • addAll

      public void addAll(String key, V... newValues)
      Specified by:
      addAll in interface jakarta.ws.rs.core.MultivaluedMap<String,V>
      Overrides:
      addAll in class org.jboss.resteasy.specimpl.MultivaluedTreeMap<String,V>
    • merge

      public List<V> merge(String key, List<V> value, BiFunction<? super List<V>,? super List<V>,? extends List<V>> remappingFunction)
      Specified by:
      merge in interface Map<String,List<V>>
    • putAll

      public void putAll(Map<? extends String,? extends List<V>> t)
      Specified by:
      putAll in interface Map<String,List<V>>
      Overrides:
      putAll in class org.jboss.resteasy.specimpl.MultivaluedTreeMap<String,V>
    • replaceAll

      public void replaceAll(BiFunction<? super String,? super List<V>,? extends List<V>> function)
      Specified by:
      replaceAll in interface Map<String,List<V>>
    • putIfAbsent

      public List<V> putIfAbsent(String key, List<V> value)
      Specified by:
      putIfAbsent in interface Map<String,List<V>>
    • computeIfAbsent

      public List<V> computeIfAbsent(String key, Function<? super String,? extends List<V>> mappingFunction)
      Specified by:
      computeIfAbsent in interface Map<String,List<V>>
    • computeIfPresent

      public List<V> computeIfPresent(String key, BiFunction<? super String,? super List<V>,? extends List<V>> remappingFunction)
      Specified by:
      computeIfPresent in interface Map<String,List<V>>
    • compute

      public List<V> compute(String key, BiFunction<? super String,? super List<V>,? extends List<V>> remappingFunction)
      Specified by:
      compute in interface Map<String,List<V>>
    • remove

      public List<V> remove(Object key)
      Specified by:
      remove in interface Map<String,List<V>>
      Overrides:
      remove in class org.jboss.resteasy.specimpl.MultivaluedTreeMap<String,V>
    • remove

      public boolean remove(Object key, Object value)
      Specified by:
      remove in interface Map<String,List<V>>
    • clear

      public void clear()
      Specified by:
      clear in interface Map<String,List<V>>
      Overrides:
      clear in class org.jboss.resteasy.specimpl.MultivaluedTreeMap<String,V>
    • containsKey

      public boolean containsKey(Object key)
      Specified by:
      containsKey in interface Map<String,List<V>>
      Overrides:
      containsKey in class org.jboss.resteasy.specimpl.MultivaluedTreeMap<String,V>
    • containsValue

      public boolean containsValue(Object value)
      Specified by:
      containsValue in interface Map<String,List<V>>
      Overrides:
      containsValue in class org.jboss.resteasy.specimpl.MultivaluedTreeMap<String,V>
    • entrySet

      public Set<Map.Entry<String,List<V>>> entrySet()
      Specified by:
      entrySet in interface Map<String,List<V>>
      Overrides:
      entrySet in class org.jboss.resteasy.specimpl.MultivaluedTreeMap<String,V>
    • equals

      public boolean equals(Object o)
      Specified by:
      equals in interface Map<String,List<V>>
      Overrides:
      equals in class org.jboss.resteasy.specimpl.MultivaluedTreeMap<String,V>
    • get

      public List<V> get(Object key)
      Specified by:
      get in interface Map<String,List<V>>
      Overrides:
      get in class org.jboss.resteasy.specimpl.MultivaluedTreeMap<String,V>
    • getFirst

      public V getFirst(String key)
      Specified by:
      getFirst in interface jakarta.ws.rs.core.MultivaluedMap<String,V>
      Overrides:
      getFirst in class org.jboss.resteasy.specimpl.MultivaluedTreeMap<String,V>
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface Map<String,List<V>>
      Overrides:
      hashCode in class org.jboss.resteasy.specimpl.MultivaluedTreeMap<String,V>
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface Map<String,List<V>>
      Overrides:
      isEmpty in class org.jboss.resteasy.specimpl.MultivaluedTreeMap<String,V>
    • keySet

      public Set<String> keySet()
      Specified by:
      keySet in interface Map<String,List<V>>
      Overrides:
      keySet in class org.jboss.resteasy.specimpl.MultivaluedTreeMap<String,V>
    • size

      public int size()
      Specified by:
      size in interface Map<String,List<V>>
      Overrides:
      size in class org.jboss.resteasy.specimpl.MultivaluedTreeMap<String,V>
    • values

      public Collection<List<V>> values()
      Specified by:
      values in interface Map<String,List<V>>
      Overrides:
      values in class org.jboss.resteasy.specimpl.MultivaluedTreeMap<String,V>
    • equalsIgnoreValueOrder

      public boolean equalsIgnoreValueOrder(jakarta.ws.rs.core.MultivaluedMap<String,V> omap)
      Specified by:
      equalsIgnoreValueOrder in interface jakarta.ws.rs.core.MultivaluedMap<String,V>
      Overrides:
      equalsIgnoreValueOrder in class org.jboss.resteasy.specimpl.MultivaluedTreeMap<String,V>
    • getOrDefault

      public List<V> getOrDefault(Object key, List<V> defaultValue)
      Specified by:
      getOrDefault in interface Map<String,List<V>>
    • forEach

      public void forEach(BiConsumer<? super String,? super List<V>> action)
      Specified by:
      forEach in interface Map<String,List<V>>
    • toString

      public String toString()
      Overrides:
      toString in class org.jboss.resteasy.specimpl.MultivaluedTreeMap<String,V>
    • clone

      public TrackingMap<V> clone()
      Overrides:
      clone in class org.jboss.resteasy.specimpl.MultivaluedTreeMap<String,V>