Returns a new builder, expecting the specified number of entries to be added. If expectedSize is exactly the number of entries added to the builder before Builder#build is called, the builder is likely to perform better than an unsized #builder() would have. It is not specified if any performance benefits apply if expectedSize is close to, but not exactly, the number of entries added to the builder.
Guaranteed to throw an exception and leave the map unmodified.
An object representing the differences between two maps.
A ListMultimap<K,V> whose contents will never change, with many other important properties detailed at ImmutableCollection<E>. See the Guava User Guide article on immutable collections.
A Map whose contents will never change, with many other important properties detailed at ImmutableCollection<E>. See the Guava User Guide article on immutable collections.
A list multimap which forwards all its method calls to another list multimap. Subclasses should override one or more methods to modify the behavior of the backing multimap as desired per the decorator pattern. default method warning: This class does not forward calls to default methods. Instead, it inherits their default implementations. When those implementations invoke methods, they invoke methods on the ForwardingListMultimap.
A Multimap that cannot hold duplicate key-value pairs. Adding a key-value pair that's already in the multimap has no effect. See the Multimap<K,V> documentation for information common to all multimaps. The #get, #removeAll, and #replaceValues methods each return a Set of values, while #entries returns a Set of map entries. Though the method signature doesn't say so explicitly, the map returned by #asMap has Set values. If the values corresponding to a single key should be ordered according to a java.util.Comparator (or the natural order), see the SortedSetMultimap<K,V> subinterface. Since the value collections are sets, the behavior of a SetMultimap is not specified if key or value objects already present in the multimap change in a manner that affects equals comparisons. Use caution if mutable objects are used as keys or values in a SetMultimap. See the Guava User Guide article on Multimap.
A builder for creating immutable map instances, especially public static final maps ("constant maps"). Example: static final ImmutableMap WORD_TO_INT = new ImmutableMap.Builder() .put("one", 1) .put("two", 2) .put("three", 3) .build(); For small immutable maps, the ImmutableMap.of() methods are even more convenient. By default, a Builder will generate maps that iterate over entries in the order they were inserted into the builder, equivalently to LinkedHashMap. For example, in the above example, WORD_TO_INT.entrySet() is guaranteed to iterate over the entries in the order "one"=1, "two"=2, "three"=3, and keySet() and values() respect the same order. If you want a different order, consider using ImmutableSortedMap<K,V> to sort by keys, or call orderEntriesByValue(Comparator<? super V> valueComparator), which changes this builder to sort entries by value. Builder instances can be reused - it is safe to call #build multiple times to build multiple maps in series. Each map is a superset of the maps created before it.