Package com.im.commons.util
Class ImmutableCaseInsensitiveMap<V>
- java.lang.Object
-
- java.util.AbstractMap<java.lang.String,V>
-
- com.im.commons.util.AbstractCaseInsensitiveMap<V>
-
- com.im.commons.util.ImmutableCaseInsensitiveMap<V>
-
- Type Parameters:
V- Value type.
- All Implemented Interfaces:
java.io.Serializable,java.util.Map<java.lang.String,V>
public final class ImmutableCaseInsensitiveMap<V> extends AbstractCaseInsensitiveMap<V>
This Map is a delegate that transforms all keys to lowercase. Null keys and values are not allowed as the backing map isImmutableMap. On return the keys are unwrapped. Modification of data is not allowed.- Since:
- 17.1.9
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <V> ImmutableCaseInsensitiveMap<V>copyOf(java.util.Map<?,V> map)Wraps the original map to an immutable case insensitive map.-
Methods inherited from class com.im.commons.util.AbstractCaseInsensitiveMap
clear, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, remove, size, values
-
-
-
-
Method Detail
-
copyOf
public static <V> ImmutableCaseInsensitiveMap<V> copyOf(java.util.Map<?,V> map)
Wraps the original map to an immutable case insensitive map. Despite the method name, this method attempts to avoid actually copying the data when it is safe to do so.- Type Parameters:
V- Value type.- Parameters:
map- Map to wrap.- Returns:
- Immutable case insensitive map.
- Throws:
java.lang.NullPointerException- - if any key, value, or entry is nulljava.lang.IllegalArgumentException- - if two entries have the same key
-
-