Class WoolVariableStore


  • public class WoolVariableStore
    extends Object
    Interface class for WoolVariableStore's. A WoolVariableStore implementation acts as an interface between Wool scripts (and the variables used in e.g. "if" and "set" statements therein) and the dialogue execution engine.
    • Constructor Detail

      • WoolVariableStore

        public WoolVariableStore()
    • Method Detail

      • setValue

        public void setValue​(String name,
                             Object value,
                             boolean save,
                             org.joda.time.DateTime time)
        Stores the given value under the given name in this WoolVariableStore.
        Parameters:
        name - the name of the variable to store.
        value - the value of the variable to store.
        save - true if the variable should be saved in the database, false if it can be kept just in memory
        time - the time (in the time zone of the user) that should be stored with this value. This is ignored and can be null if "save" is false
      • getValue

        public Object getValue​(String name)
        Retrieves the variable identified by the given name, or returns null if no such variable is known.
        Parameters:
        name - the name of the variable to retrieve.
        Returns:
        the associated value of the variable (String, Number, Boolean, null)
      • getModifiableMap

        public Map<String,​Object> getModifiableMap​(boolean save,
                                                         org.joda.time.DateTime time)
        Returns a modifiable map for this variable store. If "save" is true, then any modification is saved to the database with the specified time.
        Parameters:
        save - true if the variable should be saved in the database, false if it can be kept just in memory
        time - the time in the time zone of the user. This is ignored and can be null if "save" is false
        Returns:
        the modifiable map