List of utility methods to do Map Replace
String | replaceParameters(String str, Map Returns a named string, replacing parameters with the values set. if (str != null && parameters != null) { StringBuffer replaceBuffer = new StringBuffer(64); for (Map.Entry<String, String> entry : parameters.entrySet()) { replaceBuffer.setLength(0); replaceBuffer.append("${").append(entry.getKey()).append("}"); str = substituteSubString(str, replaceBuffer.toString(), entry.getValue()); return str; |
String | replaceParams(String str, Map replace Params for (String key : map.keySet()) { str = str.replaceAll("\\$\\{" + key + "\\}", map.get(key) == null ? "" : map.get(key)); return str; |
String | replacePlaceholders(String script, Map replace Placeholders for (Map.Entry<String, String> configuration : configurations.entrySet()) { script = script.replaceAll("\\$\\{" + configuration.getKey() + "\\}", configuration.getValue()); return script; |
String | replacePlaceholders(String string, Map values) Replaces placeholders of the form ${key} in the supplied string using key / value pairs from the Map provided. if (string == null || values == null) { return string; StringBuffer buffer = new StringBuffer(string); int start = buffer.indexOf(PLACEHOLDER_PREFIX); int end = buffer.indexOf(PLACEHOLDER_SUFFIX); while (start != -1 && end != -1) { String placeholder = buffer.substring(start + PLACEHOLDER_PREFIX.length(), end); ... |
String | replaceProperties(final CharSequence string, final Map replace Properties if (string == null) { return null; } else { final StringBuilder buffer = new StringBuilder(); for (int i = 0; i < string.length(); ++i) { char c = string.charAt(i); switch (c) { case '$': ... |
String | replaceQueryParameterInUrl(String fullUrl, Map Replaces query parameters found in a URL string with specified parameters. Map<String, String> parameter = urlToQueryParameterMap(fullUrl);
parameter.putAll(newParameter);
String url = splitUrlParameter(fullUrl)[0];
return addQueryParameterToUrl(url, parameter);
|
String | replaceSeparator(String value, String separator, Map replace Separator if (map == null || map.size() == 0) { return value; StringBuilder sb = new StringBuilder(); String[] valueSplit = value.split(separator); for (int i = 0; i < valueSplit.length; i++) { String replace = map.get(valueSplit[i]); if (null != replace && !"".equals(replace)) { ... |
String | replaceString(Map replace String for (Map.Entry<String, Object> entrySet : bodyToReplace.entrySet()) { System.out.println(entrySet.getKey() + "\n\n String to replace\n\n" + entrySet.getValue()); replacingContent = replacingContent.replace(entrySet.getKey(), String.valueOf(entrySet.getValue())); return replacingContent; |
String | replaceString(String source, Map args) Replace string int startIndex = 0; int openIndex = source.indexOf('{', startIndex); if (openIndex == -1) { return source; int closeIndex = source.indexOf('}', startIndex); if ((closeIndex == -1) || (openIndex > closeIndex)) { return source; ... |
String | replaceString(String uri, String baseURI, Map ===================================================================================== Shorten an URI by removing all bases or using its prefixes if (baseURI != null && uri.startsWith(baseURI)) { return uri.replace(baseURI, ""); } else { if (prefixes != null) { for (Entry<String, String> prefix : prefixes.entrySet()) uri = uri.replace(prefix.getValue(), prefix.getKey()); return uri; ... |