Interface Variables


public interface Variables
Interface for a container of variables. Each variable is wrapped in a Variable which carries metadata like sensitivity, and remembered status.
  • Method Details

    • size

      int size()
      Returns number of stored variables.
      Returns:
      the size, zero if none
    • clear

      void clear()
      Clears all stored variables.
    • add

      void add(String key_p, Object value_p)
      Adds a new variable with the given key and value. If the key already exists, it is overwritten.
      Parameters:
      key_p - the variable name
      value_p - the value to store
    • addVariable

      void addVariable(String key_p, Variable variable_p)
      Adds or replaces a full Variable under the given key.
      Parameters:
      key_p - the variable name
      variable_p - the DTO to store
    • set

      void set(String key_p, Object value_p)
      Sets the value of an existing variable or creates a new one.
      Parameters:
      key_p - the variable name
      value_p - the value to set
    • set

      void set(String key_p, Object value_p, Boolean sensitive_p)
      Sets a variable with sensitivity flag.
      Parameters:
      key_p - the variable name
      value_p - the value to set
      sensitive_p - whether the value is sensitive
    • set

      void set(String key_p, Object value_p, Boolean sensitive_p, Boolean remembered_p)
      Sets a variable with sensitivity and remembered flags.
      Parameters:
      key_p - the variable name
      value_p - the value to set
      sensitive_p - whether the value is sensitive
      remembered_p - whether the value should be remembered
    • get

      Object get(String key_p)
      Retrieves the raw value of a variable.
      Parameters:
      key_p - the variable name
      Returns:
      the value, or null if missing
    • getVariable

      Variable getVariable(String key_p)
      Retrieves the full Variable for the given key.
      Parameters:
      key_p - the variable name
      Returns:
      the DTO, or null if missing
    • getAll

      Map<String,Object> getAll()
      Returns a map of all variable values (not the DTOs).
      Returns:
      map from key to raw value
    • getAllVariables

      Map<String,Variable> getAllVariables()
      Returns the full variable definitions.
      Returns:
      internal map of key to Variable
    • setAll

      void setAll(Map<String,Object> params_p)
      Replaces all variables with the given plain values. Existing state is cleared.
      Parameters:
      params_p - map of key to raw value
    • destroy

      void destroy(String key_p)
      Removes a variable by key.
      Parameters:
      key_p - the variable name to destroy
    • getParams

      Map<String,Variable> getParams()
      Direct access to internal param DTO map.
      Returns:
      the map of transfer variable DTOs
    • setParams

      void setParams(Map<String,Variable> params)
      Replaces the internal map of transfer variable DTOs.
      Parameters:
      params - the new map of transfer variables