public final class DefaultSessionData extends Object implements SessionData
| Constructor and Description |
|---|
DefaultSessionData() |
| Modifier and Type | Method and Description |
|---|---|
Object |
computeIfAbsent(Object key,
Supplier<Object> supplier)
Retrieve of compute the data associated with the specified key.
|
Object |
get(Object key)
Gets the session data associated with the specified key.
|
void |
set(Object key,
Object value)
Associates the specified session data with the given key.
|
boolean |
set(Object key,
Object oldValue,
Object newValue)
Associates the specified session data with the given key if the key is currently mapped to the given value.
|
public DefaultSessionData()
public void set(Object key, Object value)
SessionDataset in interface SessionDatakey - 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(Object key, Object oldValue, Object newValue)
SessionDataset in interface SessionDatakey - 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 Object get(Object key)
SessionDataget in interface SessionDatakey - The key for which to retrieve the session data, must not be null.null if none.public Object computeIfAbsent(Object key, Supplier<Object> supplier)
SessionDatacomputeIfAbsent in interface SessionDatakey - The key for which to retrieve the session data, must not be null.supplier - The supplier will compute the new value.Copyright © 2010–2022 The Apache Software Foundation. All rights reserved.