T
- public class SessionPersistentMap<T> extends Object implements PersistentMap<T>
Constructor and Description |
---|
SessionPersistentMap(Class<T> type) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Remove all of the key/value associations from this map.
|
boolean |
containsKey(Object key)
Returns true if this map contains a mapping for the specified key.
|
boolean |
containsValue(Object value)
Returns true if this map maps one or more keys to the specified value.
|
Set<Map.Entry<String,T>> |
entrySet()
Returns a set of all entries (that is, key/value pairs) stored in this
map.
|
T |
get(Object key)
Returns the value to which the specified key is mapped, or null if this
map contains no mapping for the key.
|
boolean |
isEmpty()
Returns
true if this map contains no key-value mappings. |
Set<String> |
keySet()
Returns the set of all keys currently in use in this map--that is, all
keys that are mapped to values.
|
T |
put(String key,
T value)
Stores a given object in the map by associating it with the given key.
|
void |
putAll(Map<? extends String,? extends T> m)
Copies all of the mappings from the specified map into this map.
|
T |
remove(Object key)
Remove an object from this map by specifying its key.
|
int |
size()
Returns the number of key-value mappings in this map.
|
Collection<T> |
values()
Returns a collection representing all of the values stored in this map.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
public int size()
PersistentMap
public boolean isEmpty()
PersistentMap
true
if this map contains no key-value mappings.public boolean containsKey(Object key)
PersistentMap
containsKey
in interface Map<String,T>
containsKey
in interface PersistentMap<T>
key
- The key whose presence in this map is to be tested, which must
be a non-null, non-empty string.public boolean containsValue(Object value)
PersistentMap
containsValue
in interface Map<String,T>
containsValue
in interface PersistentMap<T>
value
- The value whose presence in the map is being tested.public T get(Object key)
PersistentMap
T
, then null will be returned. Use
containsKey
to determine if a mapping
exists.get
in interface Map<String,T>
get
in interface PersistentMap<T>
key
- The key whose associated value is to be returned. This key
must be a non-null, non-empty string.public T put(String key, T value)
PersistentMap
put
in interface Map<String,T>
put
in interface PersistentMap<T>
key
- The key with which the specified value is to be associated,
which must be a non-null, non-empty string.value
- The object to be associated with the key in the map.public T remove(Object key)
PersistentMap
remove
in interface Map<String,T>
remove
in interface PersistentMap<T>
key
- The key associated with the value to remove. The key must be a
non-null, non-empty string.public void putAll(Map<? extends String,? extends T> m)
PersistentMap
put(k, v)
on this map once for each mapping
from key k
to value v
in the other map. The
behavior of this operation is undefined if the other map is modified
while the operation is in progress.public void clear()
PersistentMap
public Set<String> keySet()
PersistentMap
put()
or remove()
on the map while looping over
the set of keys).public Collection<T> values()
PersistentMap
public Set<Map.Entry<String,T>> entrySet()
PersistentMap
Entry
object represents a key together with its
value, and provides getKey()
and getValue()
methods to access them.