Package org.eclipse.aether
Class DefaultSessionData
- java.lang.Object
-
- org.eclipse.aether.DefaultSessionData
-
- All Implemented Interfaces:
SessionData
public final class DefaultSessionData extends Object implements SessionData
A simple session data storage backed by a thread-safe map.
-
-
Constructor Summary
Constructors Constructor Description DefaultSessionData()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectget(Object key)Gets the session data associated with the specified key.voidset(Object key, Object value)Associates the specified session data with the given key.booleanset(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.
-
-
-
Constructor Detail
-
DefaultSessionData
public DefaultSessionData()
-
-
Method Detail
-
set
public void set(Object key, Object value)
Description copied from interface:SessionDataAssociates the specified session data with the given key.- Specified by:
setin interfaceSessionData- Parameters:
key- The key under which to store the session data, must not benull.value- The data to associate with the key, may benullto remove the mapping.
-
set
public boolean set(Object key, Object oldValue, Object newValue)
Description copied from interface:SessionDataAssociates the specified session data with the given key if the key is currently mapped to the given value. This method provides an atomic compare-and-update of some key's value.- Specified by:
setin interfaceSessionData- Parameters:
key- The key under which to store the session data, must not benull.oldValue- The expected data currently associated with the key, may benull.newValue- The data to associate with the key, may benullto remove the mapping.- Returns:
trueif the key mapping was successfully updated from the old value to the new value,falseif the current key mapping didn't match the expected value and was not updated.
-
get
public Object get(Object key)
Description copied from interface:SessionDataGets the session data associated with the specified key.- Specified by:
getin interfaceSessionData- Parameters:
key- The key for which to retrieve the session data, must not benull.- Returns:
- The session data associated with the key or
nullif none.
-
-