
public.javadoc.org.spincast.plugins.variables.SpincastVariablesRequestContextAddon.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spincast-website Show documentation
Show all versions of spincast-website Show documentation
Source code for the https://www.spincast.org website.
SpincastVariablesRequestContextAddon (org.spincast:spincast-framework 1.14.0 API)
org.spincast.plugins.variables
Class SpincastVariablesRequestContextAddon<R extends RequestContext<?>>
- java.lang.Object
-
- org.spincast.plugins.variables.SpincastVariablesRequestContextAddon<R>
-
- All Implemented Interfaces:
- VariablesRequestContextAddon<R>
public class SpincastVariablesRequestContextAddon<R extends RequestContext<?>>
extends Object
implements VariablesRequestContextAddon<R>
-
-
Constructor Summary
Constructors
Constructor and Description
SpincastVariablesRequestContextAddon()
-
Method Summary
All Methods Instance Methods Concrete Methods
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.
protected Map<String,Object>
getRequestScopedVariables()
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.
-
-
Constructor Detail
-
SpincastVariablesRequestContextAddon
public SpincastVariablesRequestContextAddon()
-
Method Detail
-
set
public void set(String key,
Object obj)
Description copied from interface: VariablesRequestContextAddon
Adds a request scoped variable.
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.
- Specified by:
set
in interface VariablesRequestContextAddon<R extends RequestContext<?>>
-
set
public void set(Map<String,Object> variables)
Description copied from interface: VariablesRequestContextAddon
Adds request scoped 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.
- Specified by:
set
in interface VariablesRequestContextAddon<R extends RequestContext<?>>
-
getAll
public Map<String,Object> getAll()
Description copied from interface: VariablesRequestContextAddon
Gets all the request scoped variables.
The map is immutable.
- Specified by:
getAll
in interface VariablesRequestContextAddon<R extends RequestContext<?>>
-
get
public Object get(String key)
Description copied from interface: VariablesRequestContextAddon
Gets the specified request scoped variable.
- Specified by:
get
in interface VariablesRequestContextAddon<R extends RequestContext<?>>
-
get
public <T> T get(String key,
Class<T> clazz)
Description copied from interface: VariablesRequestContextAddon
Gets the specified request scoped variable as the
specified class.
- Specified by:
get
in interface VariablesRequestContextAddon<R extends RequestContext<?>>
-
get
public <T> T get(String key,
com.google.inject.Key<T> typeKey)
Description copied from interface: VariablesRequestContextAddon
Gets the specified request scoped variable as the
specified Key
.
- Specified by:
get
in interface VariablesRequestContextAddon<R extends RequestContext<?>>
-
getAsJsonObject
public JsonObject getAsJsonObject(String key)
Description copied from interface: VariablesRequestContextAddon
Gets the specified request scoped variable as JsonObject
.
- Specified by:
getAsJsonObject
in interface VariablesRequestContextAddon<R extends RequestContext<?>>
-
getAsString
public String getAsString(String key)
Description copied from interface: VariablesRequestContextAddon
Gets the specified request scoped variable as a String.
toString
will be called on the Object.
- Specified by:
getAsString
in interface VariablesRequestContextAddon<R extends RequestContext<?>>
-
remove
public void remove(String key)
Description copied from interface: VariablesRequestContextAddon
Removes a request scoped variable.
Note: Spincast uses some request scoped variables for
internal purposes. Do not try to remove all
variables!
- Specified by:
remove
in interface VariablesRequestContextAddon<R extends RequestContext<?>>
Copyright © 2019. All rights reserved.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy