Class Parameters
-
- All Implemented Interfaces:
-
io.zenoh.query.IntoParameters
public final class Parameters implements IntoParameters
Parameters of the Selector.
When in string form, the
parametersshould be encoded like the query section of a URL:parameters are separated by
;,the parameter name and value are separated by the first
=,in the absence of
=, the parameter value is considered to be the empty string,both name and value should use percent-encoding to escape characters,
defining a value for the same parameter name twice is considered undefined behavior and an error result is returned.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classParameters.Companion
-
Field Summary
Fields Modifier and Type Field Description public final static Parameters.CompanionCompanion
-
Method Summary
Modifier and Type Method Description StringtoString()Parametersinto()final BooleanisEmpty()Returns empty if no parameters were provided. final BooleancontainsKey(String key)Returns true if the key is contained. final Stringget(String key)Returns the value of the key if present. final StringgetOrDefault(String key, String default)Returns the value of the key if present, or if not, the default value provided. final List<String>values(String key)Returns the values of the key if present. final Stringinsert(String key, String value)Inserts the key-value pair into the parameters, returning the old value in case of it being already present. final Stringremove(String key)Removes the key parameter, returning its value. final Unitextend(IntoParameters parameters)Extends the parameters with the parameters provided, overwriting any conflicting params. final Unitextend(Map<String, String> parameters)Extends the parameters with the parameters provided, overwriting any conflicting params. final Map<String, String>toMap()Returns a map with the key value pairs of the parameters. -
-
Method Detail
-
into
Parameters into()
-
containsKey
final Boolean containsKey(String key)
Returns true if the key is contained.
-
getOrDefault
final String getOrDefault(String key, String default)
-
values
final List<String> values(String key)
Returns the values of the key if present.
Example:
var parameters = Parameters.from("a=1;b=2;c=1|2|3"); assertEquals(List.of("1", "2", "3"), parameters.values("c"))
-
insert
final String insert(String key, String value)
Inserts the key-value pair into the parameters, returning the old value in case of it being already present.
-
extend
final Unit extend(IntoParameters parameters)
Extends the parameters with the parameters provided, overwriting any conflicting params.
-
extend
final Unit extend(Map<String, String> parameters)
Extends the parameters with the parameters provided, overwriting any conflicting params.
-
-
-
-