public class ParameterizedString extends Object
Hello ${user}
.Modifier and Type | Class and Description |
---|---|
class |
ParameterizedString.Builder |
Modifier | Constructor and Description |
---|---|
protected |
ParameterizedString() |
|
ParameterizedString(String pattern) |
Modifier and Type | Method and Description |
---|---|
static ParameterizedString |
asis(String constant)
Obtain a string which has no parameters and always produces the value.
|
String[] |
bind(Map<String,String> params)
Convert a map of parameters into a value array for binding.
|
List<String> |
getParameterNames()
Get the list of parameter names, ordered by appearance in the pattern.
|
String |
getPattern()
Get the original pattern given to the constructor.
|
String |
getRawPattern()
Get the pattern with variables replaced with {0}, {1}, ...
|
String |
replace(Map<String,String> params)
Format this string by performing the variable replacements.
|
ParameterizedString.Builder |
replace(String name,
String value) |
String |
toString() |
protected ParameterizedString()
public ParameterizedString(String pattern)
public static ParameterizedString asis(String constant)
public String getPattern()
public String getRawPattern()
public List<String> getParameterNames()
public String[] bind(Map<String,String> params)
public String replace(Map<String,String> params)
public ParameterizedString.Builder replace(String name, String value)