public class UrlTemplateFormatter extends Object
Constructor and Description |
---|
UrlTemplateFormatter() |
Modifier and Type | Method and Description |
---|---|
String |
formatUrlTemplate(String urlTemplate,
Map<String,String> variableValues)
Expands variable references in
urlTemplate with variableValues . |
String |
patternForVariableNamed(String variableName) |
public String formatUrlTemplate(String urlTemplate, Map<String,String> variableValues)
urlTemplate
with variableValues
.
The variable references look like "${foo}" and will be replaced with the value matching the that key from
variableValues
. The inserted value will be encoded suitably for a URL query parameter. The names may not
contain '}' characters but are otherwise unconstrained. Variables which do not have associated values in the
request are replaced with the empty string. There is no syntax to escape this expansion.
urlTemplate
- the template to expand.variableValues
- the variable values to use when expanding the templatepublic String patternForVariableNamed(String variableName)
variableName
- name of the variable of interestformatUrlTemplate(String, java.util.Map)
in order to replace a variable called
variableName
.Copyright © 2021 Atlassian. All rights reserved.