java.lang.Object
com.google.common.collect.MultimapBuilder.MultimapBuilderWithKeys<K0>
- Type Parameters:
K0
- The upper bound on the key type of the generated multimap.
public abstract static class MultimapBuilder.MultimapBuilderWithKeys<K0 extends @Nullable Object>
extends Object
An intermediate stage in a
MultimapBuilder
in which the key-value collection map
implementation has been specified, but the value collection implementation has not.- Since:
- 16.0
- Author:
- Louis Wasserman
-
Method Summary
Modifier and TypeMethodDescriptionUses anArrayList
to store value collections.arrayListValues
(int expectedValuesPerKey) Uses anArrayList
to store value collections, initialized to expect the specified number of values per key.<V0 extends Enum<V0>>
MultimapBuilder.SetMultimapBuilder<K0, V0> enumSetValues
(Class<V0> valueClass) Uses anEnumSet
to store value collections.Uses a hash-basedSet
to store value collections.hashSetValues
(int expectedValuesPerKey) Uses a hash-basedSet
to store value collections, initialized to expect the specified number of values per key.Uses an insertion-ordered hash-basedSet
to store value collections.linkedHashSetValues
(int expectedValuesPerKey) Uses an insertion-ordered hash-basedSet
to store value collections, initialized to expect the specified number of values per key.Uses aLinkedList
to store value collections.Uses a naturally-orderedTreeSet
to store value collections.<V0 extends @Nullable Object>
MultimapBuilder.SortedSetMultimapBuilder<K0, V0> treeSetValues
(Comparator<V0> comparator) Uses aTreeSet
ordered by the specified comparator to store value collections.
-
Method Details
-
arrayListValues
Uses anArrayList
to store value collections. -
arrayListValues
public MultimapBuilder.ListMultimapBuilder<K0,@Nullable Object> arrayListValues(int expectedValuesPerKey) Uses anArrayList
to store value collections, initialized to expect the specified number of values per key.- Throws:
IllegalArgumentException
- ifexpectedValuesPerKey < 0
-
linkedListValues
Uses aLinkedList
to store value collections. -
hashSetValues
Uses a hash-basedSet
to store value collections. -
hashSetValues
public MultimapBuilder.SetMultimapBuilder<K0,@Nullable Object> hashSetValues(int expectedValuesPerKey) Uses a hash-basedSet
to store value collections, initialized to expect the specified number of values per key.- Throws:
IllegalArgumentException
- ifexpectedValuesPerKey < 0
-
linkedHashSetValues
Uses an insertion-ordered hash-basedSet
to store value collections. -
linkedHashSetValues
public MultimapBuilder.SetMultimapBuilder<K0,@Nullable Object> linkedHashSetValues(int expectedValuesPerKey) Uses an insertion-ordered hash-basedSet
to store value collections, initialized to expect the specified number of values per key.- Throws:
IllegalArgumentException
- ifexpectedValuesPerKey < 0
-
treeSetValues
Uses a naturally-orderedTreeSet
to store value collections. -
treeSetValues
public <V0 extends @Nullable Object> MultimapBuilder.SortedSetMultimapBuilder<K0,V0> treeSetValues(Comparator<V0> comparator) Uses aTreeSet
ordered by the specified comparator to store value collections.Multimaps generated by the resulting builder will not be serializable if
comparator
is not serializable. -
enumSetValues
public <V0 extends Enum<V0>> MultimapBuilder.SetMultimapBuilder<K0,V0> enumSetValues(Class<V0> valueClass) Uses anEnumSet
to store value collections.
-