Package cx.syndeo.script
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 Summary
Modifier and TypeMethodDescriptionvoidAdds a new variable with the given key and value.voidaddVariable(String key_p, Variable variable_p) Adds or replaces a fullVariableunder the given key.voidclear()Clears all stored variables.voidRemoves a variable by key.Retrieves the raw value of a variable.getAll()Returns a map of all variable values (not the DTOs).Returns the full variable definitions.Direct access to internal param DTO map.getVariable(String key_p) Retrieves the fullVariablefor the given key.voidSets the value of an existing variable or creates a new one.voidSets a variable with sensitivity flag.voidSets a variable with sensitivity and remembered flags.voidReplaces all variables with the given plain values.voidReplaces the internal map of transfer variable DTOs.intsize()Returns number of stored variables.
-
Method Details
-
size
int size()Returns number of stored variables.- Returns:
- the size, zero if none
-
clear
void clear()Clears all stored variables. -
add
Adds a new variable with the given key and value. If the key already exists, it is overwritten.- Parameters:
key_p- the variable namevalue_p- the value to store
-
addVariable
Adds or replaces a fullVariableunder the given key.- Parameters:
key_p- the variable namevariable_p- the DTO to store
-
set
Sets the value of an existing variable or creates a new one.- Parameters:
key_p- the variable namevalue_p- the value to set
-
set
Sets a variable with sensitivity flag.- Parameters:
key_p- the variable namevalue_p- the value to setsensitive_p- whether the value is sensitive
-
set
Sets a variable with sensitivity and remembered flags.- Parameters:
key_p- the variable namevalue_p- the value to setsensitive_p- whether the value is sensitiveremembered_p- whether the value should be remembered
-
get
Retrieves the raw value of a variable.- Parameters:
key_p- the variable name- Returns:
- the value, or
nullif missing
-
getVariable
Retrieves the fullVariablefor the given key.- Parameters:
key_p- the variable name- Returns:
- the DTO, or
nullif missing
-
getAll
Returns a map of all variable values (not the DTOs).- Returns:
- map from key to raw value
-
getAllVariables
Returns the full variable definitions.- Returns:
- internal map of key to
Variable
-
setAll
Replaces all variables with the given plain values. Existing state is cleared.- Parameters:
params_p- map of key to raw value
-
destroy
Removes a variable by key.- Parameters:
key_p- the variable name to destroy
-
getParams
Direct access to internal param DTO map.- Returns:
- the map of transfer variable DTOs
-
setParams
Replaces the internal map of transfer variable DTOs.- Parameters:
params- the new map of transfer variables
-