Package io.vertx.uritemplate
Interface Variables
-
public interface Variables
Holds a set of name/value pairs where each value can be aString
or aList<String>
or aMap<String, String>
.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Variables
addAll(JsonObject json)
Populates with a JSON object:null
are conservedJsonArray
is converted toList<String>
JsonObject
is 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...Variables
clear()
Object
get(String name)
List<String>
getList(String name)
Map<String,String>
getMap(String name)
String
getSingle(String name)
Set<String>
names()
Variables
set(String name, String value)
Set a single variable.Variables
set(String name, List<String> value)
Set a list variable.Variables
set(String name, Map<String,String> value)
Set a map variable.default Variables
setAll(JsonObject json)
LikeaddAll(JsonObject)
but overwrites previous variables.static Variables
variables()
static Variables
variables(JsonObject json)
Create an instance populated from a JSON object:null
are conservedJsonArray
is converted toList<String>
JsonObject
is 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...
-
-
-
Method Detail
-
variables
static Variables variables()
- Returns:
- an empty instance
-
variables
static Variables variables(JsonObject json)
Create an instance populated from a JSON object:null
are conservedJsonArray
is converted toList<String>
JsonObject
is 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
Variables set(String name, String value)
Set a single variable.- Parameters:
name
- the variable namevalue
- the variable value- Returns:
- a reference to this, so the API can be used fluently
-
set
Variables set(String name, List<String> value)
Set a list variable.- Parameters:
name
- the variable namevalue
- the variable value- Returns:
- a reference to this, so the API can be used fluently
-
set
Variables set(String name, Map<String,String> value)
Set a map variable.- Parameters:
name
- the variable namevalue
- the variable value- Returns:
- a reference to this, so the API can be used fluently
-
setAll
default Variables setAll(JsonObject json)
LikeaddAll(JsonObject)
but overwrites previous variables.
-
addAll
Variables addAll(JsonObject json)
Populates with a JSON object:null
are conservedJsonArray
is converted toList<String>
JsonObject
is 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()
-
-