public interface Session extends Serializable
| Modifier and Type | Method and Description |
|---|---|
boolean |
existsVariable(String name)
Returns
true if a session variable named name exists. |
<T> T |
getVariable(Class<T> cls,
String name)
Returns the value of the session variable.
|
<T> T |
getVariable(Class<T> cls,
String name,
T defaultValue)
Returns the value of the session variable or
defaultValue if not found. |
<T> T |
getVariable(String name)
Returns the value of the session variable.
|
<T> T |
getVariable(String name,
T defaultValue)
Returns the value of the session variable or
defaultValue if not found. |
void |
removeVariable(String name)
Removes a session variable.
|
void |
setVariable(String name,
Object value)
Sets session variable value.
|
<T> void |
setVariableIfNone(String name,
Supplier<T> supplier)
Sets the session variable if not set already.
|
void |
updateVariable(String name)
Updates the session variable.
|
void setVariable(String name, Object value)
name - variable name.value - variable value.<T> T getVariable(String name)
T - variable.name - variable name.<T> T getVariable(Class<T> cls, String name)
T - variable.cls - variable class.name - variable name.<T> T getVariable(String name, T defaultValue)
defaultValue if not found.T - variable.name - variable name.defaultValue - default value.<T> T getVariable(Class<T> cls, String name, T defaultValue)
defaultValue if not found.T - variable.cls - variable class.name - variable name.defaultValue - default value.void removeVariable(String name)
name - variable name.boolean existsVariable(String name)
true if a session variable named name exists.name - variable name.true if a session variable named name exists.<T> void setVariableIfNone(String name, Supplier<T> supplier)
T - variable.name - variable name.supplier - variable value supplier.void updateVariable(String name)
name - variable name.Copyright © 2016–2018 Softelnet. All rights reserved.