All Downloads are FREE. Search and download functionalities are using the official Maven repository.

public.javadoc.org.spincast.core.exchange.VariablesRequestContextAddon.html Maven / Gradle / Ivy

There is a newer version: 2.2.0
Show newest version






VariablesRequestContextAddon (org.spincast:spincast-framework 1.0.0 API)












org.spincast.core.exchange

Interface VariablesRequestContextAddon<R extends RequestContext<?>>

    • Method Detail

      • set

        void set(String key,
                 Object obj)
        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.

      • set

        void set(Map<String,Object> variables)
        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.

      • getAll

        Map<String,Object> getAll()
        Gets all the request scoped variables. The map is immutable.
      • get

        Object get(String key)
        Gets the specified request scoped variable.
      • get

        <T> T get(String key,
                  Class<T> clazz)
        Gets the specified request scoped variable as the specified class.
        Throws:
        an - exception is the object is not of the specified class.
      • get

        <T> T get(String key,
                  com.google.inject.Key<T> typeKey)
        Gets the specified request scoped variable as the specified Key.
        Throws:
        an - exception is the object is not of the specified Key.
      • getAsJsonObject

        JsonObject getAsJsonObject(String key)
        Gets the specified request scoped variable as JsonObject.
      • getAsString

        String getAsString(String key)
        Gets the specified request scoped variable as a String. toString will be called on the Object.
      • remove

        void remove(String key)
        Removes a request scoped variable. Note: Spincast uses some request scoped variables for internal purposes. Do not try to remove all variables!

Copyright © 2019. All rights reserved.





© 2015 - 2024 Weber Informatics LLC | Privacy Policy