public final class DefaultSessionData extends java.lang.Object implements SessionData
Modifier and Type | Field and Description |
---|---|
private java.util.concurrent.ConcurrentMap<java.lang.Object,java.lang.Object> |
data |
Constructor and Description |
---|
DefaultSessionData() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
get(java.lang.Object key)
Gets the session data associated with the specified key.
|
void |
set(java.lang.Object key,
java.lang.Object value)
Associates the specified session data with the given key.
|
boolean |
set(java.lang.Object key,
java.lang.Object oldValue,
java.lang.Object newValue)
Associates the specified session data with the given key if the key is currently mapped to the given value.
|
private final java.util.concurrent.ConcurrentMap<java.lang.Object,java.lang.Object> data
public void set(java.lang.Object key, java.lang.Object value)
SessionData
set
in interface SessionData
key
- The key under which to store the session data, must not be null
.value
- The data to associate with the key, may be null
to remove the mapping.public boolean set(java.lang.Object key, java.lang.Object oldValue, java.lang.Object newValue)
SessionData
set
in interface SessionData
key
- The key under which to store the session data, must not be null
.oldValue
- The expected data currently associated with the key, may be null
.newValue
- The data to associate with the key, may be null
to remove the mapping.true
if the key mapping was successfully updated from the old value to the new value,
false
if the current key mapping didn't match the expected value and was not updated.public java.lang.Object get(java.lang.Object key)
SessionData
get
in interface SessionData
key
- The key for which to retrieve the session data, must not be null
.null
if none.