public static class Http.Session
extends java.util.HashMap<java.lang.String,java.lang.String>
Session data are encoded into an HTTP cookie, and can only contain simple String
values.
Modifier and Type | Field and Description |
---|---|
boolean |
isDirty
Deprecated.
Deprecated as of 2.7.0.
|
Constructor and Description |
---|
Session(int initialCapacity)
Deprecated.
Deprecated as of 2.7.0.
Http.Session will not be a subclass of HashMap in future Play releases. |
Session(int initialCapacity,
float loadFactor)
Deprecated.
Deprecated as of 2.7.0.
Http.Session will not be a subclass of HashMap in future Play releases. |
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)
Adds a number of elements provided by the given map object
and returns a new session with the added elements.
|
Http.Session |
adding(java.lang.String key,
java.lang.String value)
Adds a value to the session, and returns a new session.
|
java.util.Optional<java.lang.String> |
apply(java.lang.String key)
Optionally returns the session value associated with a key.
|
play.api.mvc.Session |
asScala()
Convert this session to a Scala session.
|
void |
clear()
Deprecated.
Deprecated as of 2.7.0. Just create a new instance instead.
|
java.lang.Object |
clone()
Deprecated.
Deprecated as of 2.7.0.
Http.Session will not be a subclass of HashMap in future Play releases. |
java.lang.String |
compute(java.lang.String key,
java.util.function.BiFunction<? super java.lang.String,? super java.lang.String,? extends java.lang.String> remappingFunction)
Deprecated.
Deprecated as of 2.7.0.
Http.Session will not be a subclass of HashMap in future Play releases. |
java.lang.String |
computeIfAbsent(java.lang.String key,
java.util.function.Function<? super java.lang.String,? extends java.lang.String> mappingFunction)
Deprecated.
Deprecated as of 2.7.0.
Http.Session will not be a subclass of HashMap in future Play releases. |
java.lang.String |
computeIfPresent(java.lang.String key,
java.util.function.BiFunction<? super java.lang.String,? super java.lang.String,? extends java.lang.String> remappingFunction)
Deprecated.
Deprecated as of 2.7.0.
Http.Session will not be a subclass of HashMap in future Play releases. |
boolean |
containsKey(java.lang.Object key)
Deprecated.
Deprecated as of 2.7.0. Use
getOptional(String) instead. |
boolean |
containsValue(java.lang.Object value)
Deprecated.
Deprecated as of 2.7.0.
Http.Session will not be a subclass of HashMap in future Play releases. |
java.util.Map<java.lang.String,java.lang.String> |
data() |
java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.String>> |
entrySet()
Deprecated.
Deprecated as of 2.7.0.
Http.Session will not be a subclass of HashMap in future Play releases. |
void |
forEach(java.util.function.BiConsumer<? super java.lang.String,? super java.lang.String> action)
Deprecated.
Deprecated as of 2.7.0.
Http.Session will not be a subclass of HashMap in future Play releases. |
java.lang.String |
get(java.lang.Object key)
Deprecated.
Deprecated as of 2.7.0. Use
getOptional(String) instead. |
java.util.Optional<java.lang.String> |
getOptional(java.lang.String key)
Optionally returns the session value associated with a key.
|
java.lang.String |
getOrDefault(java.lang.Object key,
java.lang.String defaultValue)
Deprecated.
Deprecated as of 2.7.0.
Http.Session will not be a subclass of HashMap in future Play releases. |
boolean |
isEmpty()
Deprecated.
Deprecated as of 2.7.0.
Http.Session will not be a subclass of HashMap in future Play releases. |
java.util.Set<java.lang.String> |
keySet()
Deprecated.
Deprecated as of 2.7.0.
Http.Session will not be a subclass of HashMap in future Play releases. |
java.lang.String |
merge(java.lang.String key,
java.lang.String value,
java.util.function.BiFunction<? super java.lang.String,? super java.lang.String,? extends java.lang.String> remappingFunction)
Deprecated.
Deprecated as of 2.7.0.
Http.Session will not be a subclass of HashMap in future Play releases. |
java.lang.String |
put(java.lang.String key,
java.lang.String value)
Deprecated.
Deprecated as of 2.7.0. Use
adding(String, String) instead. |
void |
putAll(java.util.Map<? extends java.lang.String,? extends java.lang.String> values)
Deprecated.
Deprecated as of 2.7.0. Use
adding(Map) instead. |
java.lang.String |
putIfAbsent(java.lang.String key,
java.lang.String value)
Deprecated.
Deprecated as of 2.7.0.
Http.Session will not be a subclass of HashMap in future Play releases. |
java.lang.String |
remove(java.lang.Object key)
Deprecated.
Deprecated as of 2.7.0. Use
remove(String...) instead. |
boolean |
remove(java.lang.Object key,
java.lang.Object value)
Deprecated.
Deprecated as of 2.7.0.
Http.Session will not be a subclass of HashMap in future Play releases. |
Http.Session |
remove(java.lang.String... keys)
Removes any value from the session.
|
java.lang.String |
replace(java.lang.String key,
java.lang.String value)
Deprecated.
Deprecated as of 2.7.0.
Http.Session will not be a subclass of HashMap in future Play releases. |
boolean |
replace(java.lang.String key,
java.lang.String oldValue,
java.lang.String newValue)
Deprecated.
Deprecated as of 2.7.0.
Http.Session will not be a subclass of HashMap in future Play releases. |
void |
replaceAll(java.util.function.BiFunction<? super java.lang.String,? super java.lang.String,? extends java.lang.String> function)
Deprecated.
Deprecated as of 2.7.0.
Http.Session will not be a subclass of HashMap in future Play releases. |
int |
size()
Deprecated.
Deprecated as of 2.7.0.
Http.Session will not be a subclass of HashMap in future Play releases. |
java.util.Collection<java.lang.String> |
values()
Deprecated.
Deprecated as of 2.7.0.
Http.Session will not be a subclass of HashMap in future Play releases. |
public Session(java.util.Map<java.lang.String,java.lang.String> data)
public Session(play.api.mvc.Session underlying)
@Deprecated public Session(int initialCapacity, float loadFactor)
Http.Session
will not be a subclass of HashMap
in future Play releases.@Deprecated public Session(int initialCapacity)
Http.Session
will not be a subclass of HashMap
in future Play releases.public java.util.Map<java.lang.String,java.lang.String> data()
@Deprecated public boolean containsKey(java.lang.Object key)
getOptional(String)
instead.containsKey
in interface java.util.Map<java.lang.String,java.lang.String>
containsKey
in class java.util.HashMap<java.lang.String,java.lang.String>
@Deprecated public java.lang.String get(java.lang.Object key)
getOptional(String)
instead.get
in interface java.util.Map<java.lang.String,java.lang.String>
get
in class java.util.HashMap<java.lang.String,java.lang.String>
public java.util.Optional<java.lang.String> apply(java.lang.String key)
public java.util.Optional<java.lang.String> getOptional(java.lang.String key)
@Deprecated public java.lang.String remove(java.lang.Object key)
remove(String...)
instead.remove
in interface java.util.Map<java.lang.String,java.lang.String>
remove
in class java.util.HashMap<java.lang.String,java.lang.String>
public Http.Session remove(java.lang.String... keys)
@Deprecated public java.lang.String put(java.lang.String key, java.lang.String value)
adding(String, String)
instead.put
in interface java.util.Map<java.lang.String,java.lang.String>
put
in class java.util.HashMap<java.lang.String,java.lang.String>
@Deprecated public void putAll(java.util.Map<? extends java.lang.String,? extends java.lang.String> values)
adding(Map)
instead.putAll
in interface java.util.Map<java.lang.String,java.lang.String>
putAll
in class java.util.HashMap<java.lang.String,java.lang.String>
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)
@Deprecated public void clear()
clear
in interface java.util.Map<java.lang.String,java.lang.String>
clear
in class java.util.HashMap<java.lang.String,java.lang.String>
public play.api.mvc.Session asScala()
@Deprecated public int size()
Http.Session
will not be a subclass of HashMap
in future Play releases.size
in interface java.util.Map<java.lang.String,java.lang.String>
size
in class java.util.HashMap<java.lang.String,java.lang.String>
@Deprecated public boolean isEmpty()
Http.Session
will not be a subclass of HashMap
in future Play releases.isEmpty
in interface java.util.Map<java.lang.String,java.lang.String>
isEmpty
in class java.util.HashMap<java.lang.String,java.lang.String>
@Deprecated public boolean containsValue(java.lang.Object value)
Http.Session
will not be a subclass of HashMap
in future Play releases.containsValue
in interface java.util.Map<java.lang.String,java.lang.String>
containsValue
in class java.util.HashMap<java.lang.String,java.lang.String>
@Deprecated public java.util.Set<java.lang.String> keySet()
Http.Session
will not be a subclass of HashMap
in future Play releases.keySet
in interface java.util.Map<java.lang.String,java.lang.String>
keySet
in class java.util.HashMap<java.lang.String,java.lang.String>
@Deprecated public java.util.Collection<java.lang.String> values()
Http.Session
will not be a subclass of HashMap
in future Play releases.values
in interface java.util.Map<java.lang.String,java.lang.String>
values
in class java.util.HashMap<java.lang.String,java.lang.String>
@Deprecated public java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.String>> entrySet()
Http.Session
will not be a subclass of HashMap
in future Play releases.entrySet
in interface java.util.Map<java.lang.String,java.lang.String>
entrySet
in class java.util.HashMap<java.lang.String,java.lang.String>
@Deprecated public java.lang.String getOrDefault(java.lang.Object key, java.lang.String defaultValue)
Http.Session
will not be a subclass of HashMap
in future Play releases.getOrDefault
in interface java.util.Map<java.lang.String,java.lang.String>
getOrDefault
in class java.util.HashMap<java.lang.String,java.lang.String>
@Deprecated public java.lang.String putIfAbsent(java.lang.String key, java.lang.String value)
Http.Session
will not be a subclass of HashMap
in future Play releases.putIfAbsent
in interface java.util.Map<java.lang.String,java.lang.String>
putIfAbsent
in class java.util.HashMap<java.lang.String,java.lang.String>
@Deprecated public boolean remove(java.lang.Object key, java.lang.Object value)
Http.Session
will not be a subclass of HashMap
in future Play releases.remove
in interface java.util.Map<java.lang.String,java.lang.String>
remove
in class java.util.HashMap<java.lang.String,java.lang.String>
@Deprecated public boolean replace(java.lang.String key, java.lang.String oldValue, java.lang.String newValue)
Http.Session
will not be a subclass of HashMap
in future Play releases.replace
in interface java.util.Map<java.lang.String,java.lang.String>
replace
in class java.util.HashMap<java.lang.String,java.lang.String>
@Deprecated public java.lang.String replace(java.lang.String key, java.lang.String value)
Http.Session
will not be a subclass of HashMap
in future Play releases.replace
in interface java.util.Map<java.lang.String,java.lang.String>
replace
in class java.util.HashMap<java.lang.String,java.lang.String>
@Deprecated public java.lang.String computeIfAbsent(java.lang.String key, java.util.function.Function<? super java.lang.String,? extends java.lang.String> mappingFunction)
Http.Session
will not be a subclass of HashMap
in future Play releases.computeIfAbsent
in interface java.util.Map<java.lang.String,java.lang.String>
computeIfAbsent
in class java.util.HashMap<java.lang.String,java.lang.String>
@Deprecated public java.lang.String computeIfPresent(java.lang.String key, java.util.function.BiFunction<? super java.lang.String,? super java.lang.String,? extends java.lang.String> remappingFunction)
Http.Session
will not be a subclass of HashMap
in future Play releases.computeIfPresent
in interface java.util.Map<java.lang.String,java.lang.String>
computeIfPresent
in class java.util.HashMap<java.lang.String,java.lang.String>
@Deprecated public java.lang.String compute(java.lang.String key, java.util.function.BiFunction<? super java.lang.String,? super java.lang.String,? extends java.lang.String> remappingFunction)
Http.Session
will not be a subclass of HashMap
in future Play releases.compute
in interface java.util.Map<java.lang.String,java.lang.String>
compute
in class java.util.HashMap<java.lang.String,java.lang.String>
@Deprecated public java.lang.String merge(java.lang.String key, java.lang.String value, java.util.function.BiFunction<? super java.lang.String,? super java.lang.String,? extends java.lang.String> remappingFunction)
Http.Session
will not be a subclass of HashMap
in future Play releases.merge
in interface java.util.Map<java.lang.String,java.lang.String>
merge
in class java.util.HashMap<java.lang.String,java.lang.String>
@Deprecated public void forEach(java.util.function.BiConsumer<? super java.lang.String,? super java.lang.String> action)
Http.Session
will not be a subclass of HashMap
in future Play releases.forEach
in interface java.util.Map<java.lang.String,java.lang.String>
forEach
in class java.util.HashMap<java.lang.String,java.lang.String>
@Deprecated public void replaceAll(java.util.function.BiFunction<? super java.lang.String,? super java.lang.String,? extends java.lang.String> function)
Http.Session
will not be a subclass of HashMap
in future Play releases.replaceAll
in interface java.util.Map<java.lang.String,java.lang.String>
replaceAll
in class java.util.HashMap<java.lang.String,java.lang.String>
@Deprecated public java.lang.Object clone()
Http.Session
will not be a subclass of HashMap
in future Play releases.clone
in class java.util.HashMap<java.lang.String,java.lang.String>