Package 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
-
Method Summary
Modifier and TypeMethodDescriptionGets the specified request scoped variable.<T> T
Gets the specified request scoped variable as the specifiedKey
.<T> T
Gets the specified request scoped variable as the specified class.getAll()
Gets all the request scoped variables.getAsJsonObject
(String key) Gets the specified request scoped variable asJsonObject
.getAsString
(String key) Gets the specified request scoped variable as a String.void
Removes a request scoped variable.void
Adds a request scoped variable.void
Adds request scoped variables.
-
Constructor Details
-
SpincastVariablesRequestContextAddon
public SpincastVariablesRequestContextAddon()
-
-
Method Details
-
set
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 interfaceVariablesRequestContextAddon<R extends RequestContext<?>>
-
set
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 interfaceVariablesRequestContextAddon<R extends RequestContext<?>>
-
getAll
Description copied from interface:VariablesRequestContextAddon
Gets all the request scoped variables. The map is immutable.- Specified by:
getAll
in interfaceVariablesRequestContextAddon<R extends RequestContext<?>>
-
getRequestScopedVariables
-
get
Description copied from interface:VariablesRequestContextAddon
Gets the specified request scoped variable.- Specified by:
get
in interfaceVariablesRequestContextAddon<R extends RequestContext<?>>
-
get
Description copied from interface:VariablesRequestContextAddon
Gets the specified request scoped variable as the specified class.- Specified by:
get
in interfaceVariablesRequestContextAddon<R extends RequestContext<?>>
-
get
Description copied from interface:VariablesRequestContextAddon
Gets the specified request scoped variable as the specifiedKey
.- Specified by:
get
in interfaceVariablesRequestContextAddon<R extends RequestContext<?>>
-
getAsJsonObject
Description copied from interface:VariablesRequestContextAddon
Gets the specified request scoped variable asJsonObject
.- Specified by:
getAsJsonObject
in interfaceVariablesRequestContextAddon<R extends RequestContext<?>>
-
getAsString
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 interfaceVariablesRequestContextAddon<R extends RequestContext<?>>
-
remove
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 interfaceVariablesRequestContextAddon<R extends RequestContext<?>>
-