Interface MultimapMutator<K,V,C extends Collection<V>>

Type Parameters:
K - type of the keys of this multimap.
V - type of the values of this multimap.
C - type of the collections of values corresponding to a single key.
All Known Implementing Classes:
MutableListMultimap, MutableMap, MutableSetMultimap

public interface MultimapMutator<K,V,C extends Collection<V>>
Common mutating methods for all mutable multimaps.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    add(K key, V value)
    Puts key-value pair in this multimap.
    default boolean
    add(Entry<K,V> entry)
    Puts key-value pair in this multimap.
    void
    Removes all entries from this multimap.
    boolean
    removeEntry(K key, V value)
    Removes a single entry from this multimap.
    removeKey(K key)
    Removes the key and all associated values from this multimap.
  • Method Details

    • add

      boolean add(K key, V value)
      Puts key-value pair in this multimap.
      Returns:
      true iff the multimap was modified as a result of this operation.
    • add

      default boolean add(Entry<K,V> entry)
      Puts key-value pair in this multimap.
      Returns:
      true iff the multimap was modified as a result of this operation.
    • removeKey

      C removeKey(K key)
      Removes the key and all associated values from this multimap.
      Returns:
      the collection of elements that was previously associated with given key.
    • removeEntry

      boolean removeEntry(K key, V value)
      Removes a single entry from this multimap.
      Returns:
      true if the collection is changed as the result of this operation, false otherwise.
    • clear

      void clear()
      Removes all entries from this multimap.