public class MapContext extends Objectimplements Map <String ,Object >, Serializable
MapContext provides a common base for context-based data storage in a
Map. Type-safe attribute retrieval is provided for subclasses with the
getTypedValue(String, Class) method.
SubjectContext,
SessionContext,
Serialized Form
| Constructor and Description |
|---|
MapContext()
|
MapContext(Map
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
|
boolean |
containsKey(Object
|
boolean |
containsValue(Object
|
Set |
entrySet()
|
Object |
get(Object
|
protected <E> E |
getTypedValue(String
Performs a
get operation but additionally ensures that the value returned is of the specified
type.
|
boolean |
isEmpty()
|
Set |
keySet()
|
protected void |
nullSafePut(String
Places a value in this context map under the given key only if the given
value argument is not null.
|
Object |
put(String
|
void |
putAll(Map
|
Object |
remove(Object
|
int |
size()
|
Collection |
values()
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAllprotected <E> E getTypedValue(Stringkey, Class <E> type)
get operation but additionally ensures that the value returned is of the specified
type. If there is no value,
null is returned.
E - the expected type of the value
key - the attribute key to look up a value
type - the expected type of the value
null if the attribute does not exist.
protected void nullSafePut(Stringkey, Object value)
value argument is not null.
key - the attribute key under which the non-null value will be stored
value - the non-null value to store. If
null, this method does nothing and returns immediately.
public int size()
public boolean isEmpty()
public boolean containsKey(Objecto)
public boolean containsValue(Objecto)
public void clear()
public Collection<Object > values()