Class ListMultimap<K,V>

java.lang.Object
me.sbasalaev.collection.Multimap<K,V,List<V>>
me.sbasalaev.collection.ListMultimap<K,V>
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
MutableListMultimap

public abstract class ListMultimap<K,@Out V> extends Multimap<K,V,List<V>> implements Cloneable
Mapping of keys to lists of values.
Since:
3.2
  • Constructor Details

    • ListMultimap

      public ListMultimap()
      Constructor for subclasses.
  • Method Details

    • empty

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

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

      public abstract List<V> get(Object key)
      Values associated with given key in this multimap. Values are returned in the same order they are added to this multimap.
      Specified by:
      get in class Multimap<K,V,List<V>>
    • entries

      public Traversable<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,List<V>>
    • clone

      public ListMultimap<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,List<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,List<V>>