Class SetMultimap<K,V>

java.lang.Object
me.sbasalaev.collection.Multimap<K,V,Set<V>>
me.sbasalaev.collection.SetMultimap<K,V>
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
MutableSetMultimap

public abstract class SetMultimap<K,@Out V> extends Multimap<K,V,Set<V>> implements Cloneable
  • Constructor Details

    • SetMultimap

      public SetMultimap()
      Constructor for subclasses.
  • Method Details

    • empty

      public static <K, V> SetMultimap<K,V> empty()
      Empty list multimap.
    • build

      public static <K, V> SetMultimap.Builder<K,V> build()
      Builder of immutable list multimaps.
    • get

      public abstract Set<V> get(Object key)
      Set of values associated with given key in this multimap.
      Specified by:
      get in class Multimap<K,V,Set<V>>
    • containsEntry

      public boolean containsEntry(Object key, Object value)
      Description copied from class: Multimap
      Whether given key corresponds to given value in this map.
      Overrides:
      containsEntry in class Multimap<K,V,Set<V>>
    • entries

      public Set<Entry<K,V>> entries()
      Description copied from class: Multimap
      All key-value associations of this multimap. If this multimap allows multiple value associations to the single key (like e. g. ListMultimap) then the same entry is returned multiple times.
      Specified by:
      entries in class Multimap<K,V,Set<V>>
    • clone

      public SetMultimap<K,V> clone()
      Description copied from class: Multimap
      Returns a shallow copy of this multimap. The returned multimap is immutable, has the same type and contains the same collections of elements. The multimap is allowed to return itself if it is immutable.
      Specified by:
      clone in class Multimap<K,V,Set<V>>
    • equals

      public boolean equals(@Nullable Object obj)
      Description copied from class: Multimap
      Whether given object is equal to this multimap. Multimaps are equal if they map keys to the same collection types of values and the sets of Multimap.collectionEntries() are the same. Multimaps of different collection types are not equal to each other. In particular empty multimaps of different types are unequal since they return unequal empty collections.
      Specified by:
      equals in class Multimap<K,V,Set<V>>