Multimap instances, letting you independently select the desired
behaviors (for example, ordering) of the backing map and value-collections. Example:
ListMultimap<UserId, ErrorResponse> errorsByUser =
MultimapBuilder.linkedHashKeys().arrayListValues().build();
SortedSetMultimap<String, Method> methodsForName =
MultimapBuilder.treeKeys().treeSetValues(this::compareMethods).build();
MultimapBuilder instances are immutable. Invoking a configuration method has no effect
on the receiving instance; you must store and use the new builder instance it returns instead.
The generated multimaps are serializable if the key and value types are serializable, unless stated otherwise in one of the configuration methods.
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private static class | |
| private static class | |
| private static class | |
| private static enum | |
| public abstract static class | MultimapBuilder.
A specialization of |
| public abstract static class | MultimapBuilder.
The upper bound on the key type of the generated multimap. K0 extends @Nullable Object>An intermediate stage in a |
| public abstract static class | MultimapBuilder.
A specialization of |
| public abstract static class | MultimapBuilder.
A specialization of |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final int |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public abstract <K extends K0, V extends V0> Multimap | |
| public <K extends K0, V extends V0> Multimap | |
| public static <K0 extends Enum | |
| public static MultimapBuilder. | |
| public static MultimapBuilder. | hashKeys(int expectedKeys)
Uses a hash table to map keys to value collections, initialized to expect the specified number of keys. |
| public static MultimapBuilder. | |
| public static MultimapBuilder. | linkedHashKeys(int expectedKeys)
Uses an hash table to map keys to value collections, initialized to expect the specified number of keys. |
| public static MultimapBuilder. | |
| public static <K0 extends @Nullable Object> MultimapBuilder. | treeKeys(Comparator<K0> comparator)
Uses a |