Class MultimapBuilder<K0,​V0>

  • Type Parameters:
    K0 - An upper bound on the key type of the generated multimap.
    V0 - An upper bound on the value type of the generated multimap.
    Direct Known Subclasses:
    MultimapBuilder.ListMultimapBuilder, MultimapBuilder.SetMultimapBuilder

    public abstract class MultimapBuilder<K0,​V0>
    extends Object
    A builder for a multimap implementation that allows customization of the backing map and value collection implementations used in a particular multimap.

    This can be used to easily configure multimap data structure implementations not provided explicitly in, for example:

     ListMultimap<String, Integer> treeListMultimap =
     SetMultimap<Integer, MyEnum> hashEnumMultimap =

    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.

    Louis Wasserman