Returns an immutable map containing the same entries as the provided sorted map, with the same ordering. Despite the method name, this method attempts to avoid actually copying the data when it is safe to do so. The exact circumstances under which a copy will or will not be performed are undocumented and subject to change.
Creates a new Multimap backed by map, whose internal value collections are generated by factory. Warning: do not use this method when the collections returned by factory implement either List or Set! Use the more specific method #newListMultimap, #newSetMultimap or #newSortedSetMultimap instead, to avoid very surprising behavior from Multimap#equals. The factory-generated and map classes determine the multimap iteration order. They also specify the behavior of the equals, hashCode, and toString methods for the multimap and its returned views. However, the multimap's get method returns instances of a different class than factory.get() does. The multimap is serializable if map, factory, the collections generated by factory, and the multimap contents are all serializable. The multimap is not threadsafe when any concurrent operations update the multimap, even if map and the instances generated by factory are. Concurrent read operations will work correctly. To allow concurrent update operations, wrap the multimap with a call to #synchronizedMultimap. Call this method only when the simpler methods <K,V>create(), <K,V>create(), <K,V>create(), <K,V>create(), <K,V>create(), and <K,V>create(Comparator<? super K> keyComparator, Comparator<? super V> valueComparator) won't suffice. Note: the multimap assumes complete ownership over of map and the collections returned by factory. Those objects should not be manually updated and they should not use soft, weak, or phantom references.
A builder for creating immutable bimap instances, especially public static final bimaps ("constant bimaps"). Example: static final ImmutableBiMap WORD_TO_INT = new ImmutableBiMap.Builder() .put("one", 1) .put("two", 2) .put("three", 3) .build(); For small immutable bimaps, the ImmutableBiMap.of() methods are even more convenient. By default, a Builder will generate bimaps that iterate over entries in the order they were inserted into the builder. 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 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 bimaps in series. Each bimap is a superset of the bimaps created before it.
A builder for creating immutable sorted map instances, especially public static final maps ("constant maps"). Example: static final ImmutableSortedMap INT_TO_WORD = new ImmutableSortedMap.Builder(Ordering.natural()) .put(1, "one") .put(2, "two") .put(3, "three") .build(); For small immutable sorted maps, the ImmutableSortedMap.of() methods are even more convenient. 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.
A SetMultimap<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.
Returns a builder that creates immutable sorted maps with an explicit comparator. If the comparator has a more general type than the map's keys, such as creating a SortedMap with a Comparator, use the ImmutableSortedMap.Builder<K,V> constructor instead.