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 SummaryModifier and TypeMethodDescriptionUses anArrayListto store value collections.arrayListValues(int expectedValuesPerKey) Uses anArrayListto 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 anEnumSetto store value collections.Uses a hash-basedSetto store value collections.hashSetValues(int expectedValuesPerKey) Uses a hash-basedSetto store value collections, initialized to expect the specified number of values per key.Uses an insertion-ordered hash-basedSetto store value collections.linkedHashSetValues(int expectedValuesPerKey) Uses an insertion-ordered hash-basedSetto store value collections, initialized to expect the specified number of values per key.Uses aLinkedListto store value collections.Uses a naturally-orderedTreeSetto store value collections.<V0 extends @Nullable Object>
 MultimapBuilder.SortedSetMultimapBuilder<K0, V0> treeSetValues(Comparator<V0> comparator) Uses aTreeSetordered by the specified comparator to store value collections.
- 
Method Details- 
arrayListValuesUses anArrayListto store value collections.
- 
arrayListValuespublic MultimapBuilder.ListMultimapBuilder<K0, @Nullable Object> arrayListValues(int expectedValuesPerKey) Uses anArrayListto store value collections, initialized to expect the specified number of values per key.- Throws:
- IllegalArgumentException- if- expectedValuesPerKey < 0
 
- 
linkedListValuesUses aLinkedListto store value collections.Performance note: ArrayListandArrayDequeconsistently outperformLinkedListexcept in certain rare and specific situations. Unless you have spent a lot of time benchmarking your specific needs, use one of those instead. (However, we do not currently offer aMultimapimplementation based onArrayDeque.)
- 
hashSetValuesUses a hash-basedSetto store value collections.
- 
hashSetValuespublic MultimapBuilder.SetMultimapBuilder<K0, @Nullable Object> hashSetValues(int expectedValuesPerKey) Uses a hash-basedSetto store value collections, initialized to expect the specified number of values per key.- Throws:
- IllegalArgumentException- if- expectedValuesPerKey < 0
 
- 
linkedHashSetValuesUses an insertion-ordered hash-basedSetto store value collections.
- 
linkedHashSetValuespublic MultimapBuilder.SetMultimapBuilder<K0, @Nullable Object> linkedHashSetValues(int expectedValuesPerKey) Uses an insertion-ordered hash-basedSetto store value collections, initialized to expect the specified number of values per key.- Throws:
- IllegalArgumentException- if- expectedValuesPerKey < 0
 
- 
treeSetValuesUses a naturally-orderedTreeSetto store value collections.
- 
treeSetValuespublic <V0 extends @Nullable Object> MultimapBuilder.SortedSetMultimapBuilder<K0,V0> treeSetValues(Comparator<V0> comparator) Uses aTreeSetordered by the specified comparator to store value collections.Multimaps generated by the resulting builder will not be serializable if comparatoris not serializable.
- 
enumSetValuespublic <V0 extends Enum<V0>> MultimapBuilder.SetMultimapBuilder<K0,V0> enumSetValues(Class<V0> valueClass) Uses anEnumSetto store value collections.
 
-