Package com.google.common.collect
Class MultimapBuilder.MultimapBuilderWithKeys<K0 extends @Nullable java.lang.Object>
- java.lang.Object
-
- com.google.common.collect.MultimapBuilder.MultimapBuilderWithKeys<K0>
-
- Type Parameters:
K0- The upper bound on the key type of the generated multimap.
- Enclosing class:
- MultimapBuilder<K0 extends @Nullable java.lang.Object,V0 extends @Nullable java.lang.Object>
public abstract static class MultimapBuilder.MultimapBuilderWithKeys<K0 extends @Nullable java.lang.Object> extends java.lang.Object
An intermediate stage in aMultimapBuilderin which the key-value collection map implementation has been specified, but the value collection implementation has not.- Since:
- 16.0
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MultimapBuilder.ListMultimapBuilder<K0,@Nullable java.lang.Object>arrayListValues()Uses anArrayListto store value collections.MultimapBuilder.ListMultimapBuilder<K0,@Nullable java.lang.Object>arrayListValues(int expectedValuesPerKey)Uses anArrayListto store value collections, initialized to expect the specified number of values per key.<V0 extends java.lang.Enum<V0>>
MultimapBuilder.SetMultimapBuilder<K0,V0>enumSetValues(java.lang.Class<V0> valueClass)Uses anEnumSetto store value collections.MultimapBuilder.SetMultimapBuilder<K0,@Nullable java.lang.Object>hashSetValues()Uses a hash-basedSetto store value collections.MultimapBuilder.SetMultimapBuilder<K0,@Nullable java.lang.Object>hashSetValues(int expectedValuesPerKey)Uses a hash-basedSetto store value collections, initialized to expect the specified number of values per key.MultimapBuilder.SetMultimapBuilder<K0,@Nullable java.lang.Object>linkedHashSetValues()Uses an insertion-ordered hash-basedSetto store value collections.MultimapBuilder.SetMultimapBuilder<K0,@Nullable java.lang.Object>linkedHashSetValues(int expectedValuesPerKey)Uses an insertion-ordered hash-basedSetto store value collections, initialized to expect the specified number of values per key.MultimapBuilder.ListMultimapBuilder<K0,@Nullable java.lang.Object>linkedListValues()Uses aLinkedListto store value collections.MultimapBuilder.SortedSetMultimapBuilder<K0,java.lang.Comparable>treeSetValues()Uses a naturally-orderedTreeSetto store value collections.<V0 extends @Nullable java.lang.Object>
MultimapBuilder.SortedSetMultimapBuilder<K0,V0>treeSetValues(java.util.Comparator<V0> comparator)Uses aTreeSetordered by the specified comparator to store value collections.
-
-
-
Method Detail
-
arrayListValues
public MultimapBuilder.ListMultimapBuilder<K0,@Nullable java.lang.Object> arrayListValues()
Uses anArrayListto store value collections.
-
arrayListValues
public MultimapBuilder.ListMultimapBuilder<K0,@Nullable java.lang.Object> arrayListValues(int expectedValuesPerKey)
Uses anArrayListto store value collections, initialized to expect the specified number of values per key.- Throws:
java.lang.IllegalArgumentException- ifexpectedValuesPerKey < 0
-
linkedListValues
public MultimapBuilder.ListMultimapBuilder<K0,@Nullable java.lang.Object> linkedListValues()
Uses aLinkedListto store value collections.
-
hashSetValues
public MultimapBuilder.SetMultimapBuilder<K0,@Nullable java.lang.Object> hashSetValues()
Uses a hash-basedSetto store value collections.
-
hashSetValues
public MultimapBuilder.SetMultimapBuilder<K0,@Nullable java.lang.Object> hashSetValues(int expectedValuesPerKey)
Uses a hash-basedSetto store value collections, initialized to expect the specified number of values per key.- Throws:
java.lang.IllegalArgumentException- ifexpectedValuesPerKey < 0
-
linkedHashSetValues
public MultimapBuilder.SetMultimapBuilder<K0,@Nullable java.lang.Object> linkedHashSetValues()
Uses an insertion-ordered hash-basedSetto store value collections.
-
linkedHashSetValues
public MultimapBuilder.SetMultimapBuilder<K0,@Nullable java.lang.Object> linkedHashSetValues(int expectedValuesPerKey)
Uses an insertion-ordered hash-basedSetto store value collections, initialized to expect the specified number of values per key.- Throws:
java.lang.IllegalArgumentException- ifexpectedValuesPerKey < 0
-
treeSetValues
public MultimapBuilder.SortedSetMultimapBuilder<K0,java.lang.Comparable> treeSetValues()
Uses a naturally-orderedTreeSetto store value collections.
-
treeSetValues
public <V0 extends @Nullable java.lang.Object> MultimapBuilder.SortedSetMultimapBuilder<K0,V0> treeSetValues(java.util.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.
-
enumSetValues
public <V0 extends java.lang.Enum<V0>> MultimapBuilder.SetMultimapBuilder<K0,V0> enumSetValues(java.lang.Class<V0> valueClass)
Uses anEnumSetto store value collections.
-
-