Class ParameterMap
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<K,V>
-
- java.util.LinkedHashMap<String,String[]>
-
- org.glassfish.grizzly.http.server.util.ParameterMap
-
- All Implemented Interfaces:
Serializable,Cloneable,Map<String,String[]>
public final class ParameterMap extends LinkedHashMap<String,String[]>
Extended implementation of LinkedHashMap that includes alockedproperty. This class can be used to safely expose Catalina internal parameter map objects to user classes without having to clone them in order to avoid modifications. When first created, aParameterMapinstance is not locked.- Version:
- $Revision: 1.4 $ $Date: 2007/06/18 17:41:35 $
- Author:
- Craig R. McClanahan
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Constructor Summary
Constructors Constructor Description ParameterMap()Construct a new, empty map with the default initial capacity and load factor.ParameterMap(int initialCapacity)Construct a new, empty map with the specified initial capacity and default load factor.ParameterMap(int initialCapacity, float loadFactor)Construct a new, empty map with the specified initial capacity and load factor.ParameterMap(Map<String,String[]> map)Construct a new map with the same mappings as the given map.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Remove all mappings from this map.booleanisLocked()Return the locked state of this parameter map.String[]put(String key, String[] value)Associate the specified value with the specified key in this map.voidputAll(Map map)Copy all of the mappings from the specified map to this one.Objectremove(String key)Remove the mapping for this key from the map if present.voidsetLocked(boolean locked)Set the locked state of this parameter map.-
Methods inherited from class java.util.LinkedHashMap
containsValue, entrySet, forEach, get, getOrDefault, keySet, removeEldestEntry, replaceAll, values
-
Methods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, putIfAbsent, remove, remove, replace, replace, size
-
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, putIfAbsent, remove, remove, replace, replace, size
-
-
-
-
Constructor Detail
-
ParameterMap
public ParameterMap()
Construct a new, empty map with the default initial capacity and load factor.
-
ParameterMap
public ParameterMap(int initialCapacity)
Construct a new, empty map with the specified initial capacity and default load factor.- Parameters:
initialCapacity- The initial capacity of this map
-
ParameterMap
public ParameterMap(int initialCapacity, float loadFactor)Construct a new, empty map with the specified initial capacity and load factor.- Parameters:
initialCapacity- The initial capacity of this maploadFactor- The load factor of this map
-
-
Method Detail
-
isLocked
public boolean isLocked()
Return the locked state of this parameter map.
-
setLocked
public void setLocked(boolean locked)
Set the locked state of this parameter map.- Parameters:
locked- The new locked state
-
clear
public void clear()
Remove all mappings from this map.- Specified by:
clearin interfaceMap<String,String[]>- Overrides:
clearin classLinkedHashMap<String,String[]>- Throws:
IllegalStateException- if this map is currently locked
-
put
public String[] put(String key, String[] value)
Associate the specified value with the specified key in this map. If the map previously contained a mapping for this key, the old value is replaced.- Specified by:
putin interfaceMap<String,String[]>- Overrides:
putin classHashMap<String,String[]>- Parameters:
key- Key with which the specified value is to be associatedvalue- Value to be associated with the specified key- Returns:
- The previous value associated with the specified key, or
nullif there was no mapping for key - Throws:
IllegalStateException- if this map is currently locked
-
putAll
public void putAll(Map map)
Copy all of the mappings from the specified map to this one. These mappings replace any mappings that this map had for any of the keys currently in the specified Map.
-
remove
public Object remove(String key)
Remove the mapping for this key from the map if present.- Parameters:
key- Key whose mapping is to be removed from the map- Returns:
- The previous value associated with the specified key, or
nullif there was no mapping for that key - Throws:
IllegalStateException- if this map is currently locked
-
-