public static class Http.Session
extends java.lang.Object
Session data are encoded into an HTTP cookie, and can only contain simple String
values.
Constructor and Description |
---|
Session() |
Session(java.util.Map<java.lang.String,java.lang.String> data) |
Session(play.api.mvc.Session underlying) |
Modifier and Type | Method and Description |
---|---|
Http.Session |
adding(java.util.Map<java.lang.String,java.lang.String> values)
Returns a new session with the values from the given map added.
|
Http.Session |
adding(java.lang.String key,
java.lang.String value)
Returns a new session with the given key-value pair added.
|
java.util.Optional<java.lang.String> |
apply(java.lang.String key)
Deprecated.
Deprecated as of 2.8.0. Use
get(String) instead. |
play.api.mvc.Session |
asScala()
Convert this session to a Scala session.
|
java.util.Map<java.lang.String,java.lang.String> |
data() |
java.util.Optional<java.lang.String> |
get(java.lang.String key)
Optionally returns the session value associated with a key.
|
java.util.Optional<java.lang.String> |
getOptional(java.lang.String key)
Deprecated.
Deprecated as of 2.8.0. Renamed to
get(String) . |
Http.Session |
removing(java.lang.String... keys)
Returns a new session with the given keys removed.
|
public Session()
public Session(java.util.Map<java.lang.String,java.lang.String> data)
public Session(play.api.mvc.Session underlying)
public java.util.Map<java.lang.String,java.lang.String> data()
public java.util.Optional<java.lang.String> get(java.lang.String key)
@Deprecated public java.util.Optional<java.lang.String> getOptional(java.lang.String key)
get(String)
.@Deprecated public java.util.Optional<java.lang.String> apply(java.lang.String key)
get(String)
instead.public Http.Session removing(java.lang.String... keys)
public Http.Session adding(java.lang.String key, java.lang.String value)
public Http.Session adding(java.util.Map<java.lang.String,java.lang.String> values)
public play.api.mvc.Session asScala()