Class ImmutableMap<K,V>
java.lang.Object
org.docx4j.com.google.common.collect.ImmutableMap<K,V>
- All Implemented Interfaces:
java.io.Serializable,java.util.Map<K,V>
@GwtCompatible(serializable=true, emulated=true) public abstract class ImmutableMap<K,V> extends java.lang.Object implements java.util.Map<K,V>, java.io.Serializable
A
Map whose contents will never change, with many other important properties detailed at
ImmutableCollection.
See the Guava User Guide article on immutable collections.
- Since:
- 2.0
- Author:
- Jesse Wilson, Kevin Bourrillion
- See Also:
- Serialized Form
-
Nested Class Summary
-
Constructor Summary
Constructors Constructor Description ImmutableMap() -
Method Summary
Modifier and Type Method Description static <K, V> ImmutableMap<K,V>copyOf(java.util.Map<? extends K,? extends V> map)Returns an immutable map containing the same entries asmap.
-
Constructor Details
-
ImmutableMap
public ImmutableMap()
-
-
Method Details
-
copyOf
Returns an immutable map containing the same entries asmap. The returned map iterates over entries in the same order as theentrySetof the original map. Ifmapsomehow contains entries with duplicate keys (for example, if it is aSortedMapwhose comparator is not consistent with equals), the results of this method are undefined.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.
- Throws:
java.lang.NullPointerException- if any key or value inmapis null
-