Package com.persequor.extension.frontend
Class UrlContent
java.lang.Object
com.persequor.extension.frontend.UrlContent
UrlContent is a data structure containing the path variables and query parameters.
All of its methods are chainable, e.g.
UrlContent urlContent = new UrlContent().variable(1, "value1").parameter("param1", "value1");
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the query parameters in the UrlContentGets the path variables in the UrlContentAdds a query parameter to the UrlContent, e.g.Adds a query parameter to the UrlContent, e.g.setParameters
(Map<String, List<String>> parameters) Overrides the query parameters in the UrlContentsetVariables
(List<PathVariable> variables) Overrides the path variables in the UrlContentAdds a path variable to the UrlContent, e.g.
-
Constructor Details
-
UrlContent
public UrlContent()
-
-
Method Details
-
variable
Adds a path variable to the UrlContent, e.g./path/{variable1}
The order of the path variable is used to sort the path variables in the url string.
When sorting negative order values are sorted before positive order values, e.g.
-1, 1, 2, 10
- Parameters:
order
- the order of the path variable, e.g. 1 if it's the first path variable in the url stringvalue
- the value of the path variable, e.g.variable1
- Returns:
- the UrlContent object, for chaining
-
parameter
Adds a query parameter to the UrlContent, e.g./path?param1=value1
See
parameter(String, List)
for more information- Parameters:
name
- the name of the query parameter, e.g.param1
value
- the value of the query parameter, e.g.value1
- Returns:
- the UrlContent object, for chaining
-
parameter
Adds a query parameter to the UrlContent, e.g./path?param1=value1,value2
The values are individually url encoded, using UTF-8 as the encoding charset
If the parameter name has been used before, the new values overwrite the old values
- Parameters:
name
- the name of the query parameter, e.g.param1
value
- the values of the query parameter, e.g.[value1, value2]
- Returns:
- the UrlContent object, for chaining
-
getVariables
Gets the path variables in the UrlContent- Returns:
- the path variables
-
setVariables
Overrides the path variables in the UrlContentShould be used with caution
- Parameters:
variables
- the new path variables- Returns:
- the UrlContent object, for chaining
-
getParameters
Gets the query parameters in the UrlContent- Returns:
- the query parameters
-
setParameters
Overrides the query parameters in the UrlContentShould be used with caution
- Parameters:
parameters
- the new query parameters- Returns:
- the UrlContent object, for chaining
-