ListMultimap whose contents will never change, with many other important properties
detailed at ImmutableCollection.
See the Guava User Guide article on immutable collections.
| Modifier and Type | Class and Description |
|---|---|
| public static class | ImmutableListMultimap.
A builder for creating immutable |
| Modifier and Type | Field and Description |
|---|---|
| private transient ImmutableListMultimap | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public static <K, V> ImmutableListMultimap. | |
| public static <K, V> ImmutableListMultimap | copyOf(Multimap<? extends K, ? extends V> multimap)
Hides com. multimap.
|
| public static <K, V> ImmutableListMultimap | |
| public static <T extends @Nullable Object, K, V> Collector | flatteningToImmutableListMultimap(Function<? super T, ? extends K> keyFunction, Function<? super T, ? extends Stream<? extends V>> valuesFunction)
Returns a |
| pack-priv static <K, V> ImmutableListMultimap | fromMapEntries(Collection<? extends Map.
Creates an ImmutableListMultimap from an asMap.entrySet. |
| public ImmutableList | get(K key)
Implements abstract com. Implements com. |
| public ImmutableListMultimap | inverse()
Implements abstract com. |
| private ImmutableListMultimap | |
| public static <K, V> ImmutableListMultimap | |
| public static <K, V> ImmutableListMultimap | of(K k1, V v1)
Returns an immutable multimap containing a single entry.
|
| public static <K, V> ImmutableListMultimap | of(K k1, V v1, K k2, V v2)
Returns an immutable multimap containing the given entries, in order.
|
| public static <K, V> ImmutableListMultimap | of(K k1, V v1, K k2, V v2, K k3, V v3)
Returns an immutable multimap containing the given entries, in order.
|
| public static <K, V> ImmutableListMultimap | of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4)
Returns an immutable multimap containing the given entries, in order.
|
| public static <K, V> ImmutableListMultimap | of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5)
Returns an immutable multimap containing the given entries, in order.
|
| private void | |
| public final ImmutableList | removeAll(Object key)
Overrides com. Implements com.
Deprecated
Unsupported operation.
Guaranteed to throw an exception and leave the multimap unmodified.
|
| public final ImmutableList | replaceValues(K key, Iterable<? extends V> values)
Overrides com. Implements com.
Deprecated
Unsupported operation.
Guaranteed to throw an exception and leave the multimap unmodified.
|
| public static <T extends @Nullable Object, K, V> Collector | toImmutableListMultimap(Function<? super T, ? extends K> keyFunction, Function<? super T, ? extends V> valueFunction)
Returns a |
| private void |
| inverse | back to summary |
|---|---|
| private transient ImmutableListMultimap<V, K> inverse
| |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides com. | |
| ImmutableListMultimap | back to summary |
|---|---|
| pack-priv ImmutableListMultimap(ImmutableMap<K, ImmutableList<V>> map, int size) | |
| builder | back to summary |
|---|---|
| public static <K, V> ImmutableListMultimap. Hides com. Returns a new builder. The generated builder is equivalent to the builder created by the | |
| copyOf | back to summary |
|---|---|
| public static <K, V> ImmutableListMultimap Hides com. Returns an immutable multimap containing the same mappings as Despite the method name, this method attempts to avoid actually copying the data when it is safe to do so. The exact circumstances under which a copy will or will not be performed are undocumented and subject to change.
| |
| copyOf | back to summary |
|---|---|
| public static <K, V> ImmutableListMultimap Hides com. Returns an immutable multimap containing the specified entries. The returned multimap iterates over keys in the order they were first encountered in the input, and the values for each key are iterated in the order they were encountered.
| |
| flatteningToImmutableListMultimap | back to summary |
|---|---|
| public static <T extends @Nullable Object, K, V> Collector Returns a Example:
| |
| fromMapEntries | back to summary |
|---|---|
| pack-priv static <K, V> ImmutableListMultimap Creates an ImmutableListMultimap from an asMap.entrySet. | |
| get | back to summary |
|---|---|
| public ImmutableList Implements abstract com. Implements com. Returns an immutable list of the values for the given key. If no mappings in the multimap have the provided key, an empty immutable list is returned. The values are in the same order as the parameters used to build this multimap.
| |
| inverse | back to summary |
|---|---|
| public ImmutableListMultimap Implements abstract com. Doc from com. Returns an immutable multimap which is the inverse of this one. For every key-value mapping in the original, the result will have a mapping with key and value reversed. Because an inverse of a list multimap can contain multiple pairs with the same key and
value, this method returns an
| |
| invert | back to summary |
|---|---|
| private ImmutableListMultimap | |
| of | back to summary |
|---|---|
| public static <K, V> ImmutableListMultimap Hides com. Returns the empty multimap. Performance note: the instance returned is a singleton.
| |
| of | back to summary |
|---|---|
| public static <K, V> ImmutableListMultimap Hides com. Returns an immutable multimap containing a single entry. | |
| of | back to summary |
|---|---|
| public static <K, V> ImmutableListMultimap Hides com. Returns an immutable multimap containing the given entries, in order. | |
| of | back to summary |
|---|---|
| public static <K, V> ImmutableListMultimap Hides com. Returns an immutable multimap containing the given entries, in order. | |
| of | back to summary |
|---|---|
| public static <K, V> ImmutableListMultimap Hides com. Returns an immutable multimap containing the given entries, in order. | |
| of | back to summary |
|---|---|
| public static <K, V> ImmutableListMultimap Hides com. Returns an immutable multimap containing the given entries, in order. | |
| readObject | back to summary |
|---|---|
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException
| |
| removeAll | back to summary |
|---|---|
| public final ImmutableList Overrides com. Implements com. Deprecated Unsupported operation. Guaranteed to throw an exception and leave the multimap unmodified.
| |
| replaceValues | back to summary |
|---|---|
| public final ImmutableList Overrides com. Implements com. Deprecated Unsupported operation. Guaranteed to throw an exception and leave the multimap unmodified.
| |
| toImmutableListMultimap | back to summary |
|---|---|
| public static <T extends @Nullable Object, K, V> Collector Returns a For streams with defined encounter order (as defined in the Ordering section of the Example:
| |
| writeObject | back to summary |
|---|---|
private void writeObject(ObjectOutputStream stream) throws IOException
| |
ListMultimap instances, especially public
static final multimaps ("constant multimaps"). Example:
static final Multimap<String, Integer> STRING_TO_INTEGER_MULTIMAP =
new ImmutableListMultimap.Builder<String, Integer>()
.put("one", 1)
.putAll("several", 1, 2, 3)
.putAll("many", 1, 2, 3, 4, 5)
.build();
Builder instances can be reused; it is safe to call build multiple times to build
multiple multimaps in series. Each multimap contains the key-value mappings in the previously
created multimaps.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public ImmutableListMultimap | build()
Overrides com. |
| pack-priv ImmutableListMultimap. | combine(ImmutableMultimap.
Overrides com. |
| public ImmutableListMultimap. | orderKeysBy(Comparator<? super K> keyComparator)
Overrides com. |
| public ImmutableListMultimap. | orderValuesBy(Comparator<? super V> valueComparator)
Overrides com. |
| public ImmutableListMultimap. | put(K key, V value)
Overrides com. |
| public ImmutableListMultimap. | put(Map.
Overrides com. |
| public ImmutableListMultimap. | putAll(Iterable<? extends Map.
Overrides com. |
| public ImmutableListMultimap. | putAll(K key, Iterable<? extends V> values)
Overrides com. |
| public ImmutableListMultimap. | putAll(K key, V... values)
Overrides com. |
| public ImmutableListMultimap. | putAll(Multimap<? extends K, ? extends V> multimap)
Overrides com. |
| Builder | back to summary |
|---|---|
| public Builder() Creates a new builder. The returned builder is equivalent to the builder generated by | |
| build | back to summary |
|---|---|
| public ImmutableListMultimap Overrides com. Returns a newly-created immutable list multimap.
| |
| combine | back to summary |
|---|---|
| pack-priv ImmutableListMultimap. Overrides com.
| |
| orderKeysBy | back to summary |
|---|---|
| public ImmutableListMultimap. Overrides com. Doc from com. Specifies the ordering of the generated multimap's keys.
| |
| orderValuesBy | back to summary |
|---|---|
| public ImmutableListMultimap. Overrides com. Doc from com. Specifies the ordering of the generated multimap's values for each key.
| |
| put | back to summary |
|---|---|
| public ImmutableListMultimap. Overrides com. Doc from com. Adds a key-value mapping to the built multimap.
| |
| put | back to summary |
|---|---|
| public ImmutableListMultimap. Overrides com. Doc from com. Adds an entry to the built multimap.
| |
| putAll | back to summary |
|---|---|
| public ImmutableListMultimap. Overrides com. Doc from com. Adds entries to the built multimap.
| |
| putAll | back to summary |
|---|---|
| public ImmutableListMultimap. Overrides com. Doc from com. Stores a collection of values with the same key in the built multimap.
| |
| putAll | back to summary |
|---|---|
| public ImmutableListMultimap. Overrides com. Doc from com. Stores an array of values with the same key in the built multimap.
| |
| putAll | back to summary |
|---|---|
| public ImmutableListMultimap. Overrides com. Doc from com. Stores another multimap's entries in the built multimap. The generated multimap's key and
value orderings correspond to the iteration ordering of the
| |