public interface VariablesRequestContextAddon<R extends RequestContext<?>>
| Modifier and Type | Method and Description |
|---|---|
Object |
get(String key)
Gets the specified request scoped variable.
|
<T> T |
get(String key,
Class<T> clazz)
Gets the specified request scoped variable as the
specified class.
|
<T> T |
get(String key,
com.google.inject.Key<T> typeKey)
Gets the specified request scoped variable as the
specified
Key. |
Map<String,Object> |
getAll()
Gets all the request scoped variables.
|
JsonObject |
getAsJsonObject(String key)
Gets the specified request scoped variable as
JsonObject. |
String |
getAsString(String key)
Gets the specified request scoped variable as a String.
|
void |
remove(String key)
Removes a request scoped variable.
|
void |
set(Map<String,Object> variables)
Adds request scoped variables.
|
void |
set(String key,
Object obj)
Adds a request scoped variable.
|
void set(String key, Object obj)
It is recommended that you prefixe the name of the
key with the name of your class
(for example : this.getClass().getName()),
so it doesn't clash with other keys!
If the variable already exists, it is overwritten.
void set(Map<String,Object> variables)
It is recommended that you prefixe the name of the
keys with the name of your class
(for example : this.getClass().getName()),
so they don't clash with other keys!
If some variables already exist, they are overwritten.
<T> T get(String key, Class<T> clazz)
an - exception is the object is not
of the specified class.<T> T get(String key, com.google.inject.Key<T> typeKey)
Key.an - exception is the object is not
of the specified Key.JsonObject getAsJsonObject(String key)
JsonObject.String getAsString(String key)
toString will be called on the Object.void remove(String key)
Copyright © 2019. All rights reserved.