Interface Variables
public interface Variables
Holds a set of name/value pairs where each value can be a
String or a List<String> or a Map<String, String>.-
Method Summary
Modifier and TypeMethodDescriptionaddAll(JsonObject json) Populates with a JSON object:nullare conservedJsonArrayis converted toList<String>JsonObjectis converted toMap<String, String>any other value is converted to a string Note that nested JSON elements are converted to a string, so { "user": { "first_name": "John", "last_name": "Doe", "address" : { "city": "Paris", etc... } } } flattens the JSON "address" to the string "{\"city\":\"Paris\",etc...}".clear()names()Set a single variable.Set a list variable.Set a map variable.default VariablessetAll(JsonObject json) LikeaddAll(JsonObject)but overwrites previous variables.static Variablesstatic Variablesvariables(JsonObject json) Create an instance populated from a JSON object:nullare conservedJsonArrayis converted toList<String>JsonObjectis converted toMap<String, String>any other value is converted to a string Note that nested JSON elements are converted to a string, so { "user": { "first_name": "John", "last_name": "Doe", "address" : { "city": "Paris", etc... } } } flattens the JSON "address" to the string "{\"city\":\"Paris\",etc...}".
-
Method Details
-
variables
- Returns:
- an empty instance
-
variables
Create an instance populated from a JSON object:nullare conservedJsonArrayis converted toList<String>JsonObjectis converted toMap<String, String>- any other value is converted to a string
- Parameters:
json- the json that populates the returned variables- Returns:
- an instance populated from a JSON object
-
set
-
set
-
set
-
setAll
LikeaddAll(JsonObject)but overwrites previous variables. -
addAll
Populates with a JSON object:nullare conservedJsonArrayis converted toList<String>JsonObjectis converted toMap<String, String>- any other value is converted to a string
- Parameters:
json- the json that populates the returned variables- Returns:
- a reference to this, so the API can be used fluently
-
clear
Variables clear() -
names
-
get
-
getSingle
-
getList
-
getMap
-