public final class Session extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Session.Builder
Builder for Session.
|
static class |
Session.Key<T>
A class representing the key for a session.
|
Modifier and Type | Field and Description |
---|---|
static Session |
EMPTY_SESSION
An instance of an empty session.
|
Modifier and Type | Method and Description |
---|---|
static Session.Builder |
builder()
Create a new instance of builder.
|
<T> T |
get(@NotNull Session.Key<T> key)
Returns the session variable from the store.
|
static <T> Session |
singleton(@NotNull Session.Key<T> key,
T value)
Constructs a singleton session.
|
public static final Session EMPTY_SESSION
public static <T> Session singleton(@NotNull @NotNull Session.Key<T> key, @Nullable T value)
T
- the type of the value of the session variablekey
- an unique identifier of the session variablevalue
- the value of the session variablepublic static Session.Builder builder()
public <T> T get(@NotNull @NotNull Session.Key<T> key)
T
- the type of the value of the session variable being retrievedkey
- the name of the session variable to retrieveCopyright © 2019. All rights reserved.