public interface VariablesRequestContextAddon<R extends RequestContext<?>>
| Modifier and Type | Method and Description |
|---|---|
void |
add(Map<String,Object> variables)
Adds request scoped variables.
|
void |
add(String key,
Object obj)
Adds a request scoped variable.
|
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 add(String key, Object obj)
key with the name of your class
(for example : this.getClass().getName()),
so it doesn't clash with other keys!void add(Map<String,Object> variables)
keys with the name of your class
(for example : this.getClass().getName()),
so they don't clash with other keys!<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 © 2018. All rights reserved.