Class StringKeyedMapAdapter<V>
java.lang.Object
org.springframework.binding.collection.StringKeyedMapAdapter<V>
- Direct Known Subclasses:
HttpServletContextMap
,HttpServletRequestMap
,HttpServletRequestParameterMap
,HttpSessionMap
Base class for map adapters whose keys are String values. Concrete classes need only implement the abstract hook
methods defined by this class.
- Author:
- Keith Donald
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
boolean
containsKey
(Object key) boolean
containsValue
(Object value) entrySet()
protected abstract V
getAttribute
(String key) Hook method that needs to be implemented by concrete subclasses.Hook method that needs to be implemented by concrete subclasses.boolean
isEmpty()
keySet()
void
protected abstract void
removeAttribute
(String key) Hook method that needs to be implemented by concrete subclasses.protected abstract void
setAttribute
(String key, V value) Hook method that needs to be implemented by concrete subclasses.int
size()
values()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
StringKeyedMapAdapter
public StringKeyedMapAdapter()
-
-
Method Details
-
clear
public void clear() -
containsKey
- Specified by:
containsKey
in interfaceMap<String,
V>
-
containsValue
- Specified by:
containsValue
in interfaceMap<String,
V>
-
entrySet
-
get
-
isEmpty
public boolean isEmpty() -
keySet
-
put
-
putAll
-
remove
-
size
public int size() -
values
-
getAttribute
Hook method that needs to be implemented by concrete subclasses. Gets a value associated with a key.- Parameters:
key
- the key to lookup- Returns:
- the associated value, or null if none
-
setAttribute
Hook method that needs to be implemented by concrete subclasses. Puts a key-value pair in the map, overwriting any possible earlier value associated with the same key.- Parameters:
key
- the key to associate the value withvalue
- the value to associate with the key
-
removeAttribute
Hook method that needs to be implemented by concrete subclasses. Removes a key and its associated value from the map.- Parameters:
key
- the key to remove
-
getAttributeNames
Hook method that needs to be implemented by concrete subclasses. Returns an enumeration listing all keys known to the map.- Returns:
- the key enumeration
-