List of utility methods to do Map Replace
Map | replaceKeyCharacter(Map replace Key Character final Map<String, Object> result = new HashMap<>(map.size()); for (Map.Entry<String, Object> entry : map.entrySet()) { final String key = entry.getKey().replace(oldChar, newChar); final Object value = entry.getValue(); result.put(key, value); return result; |
String | replaceKeyword(String messageTemplate, Map replace Keyword Object value = args.get(key); if (value == null) value = ""; return messageTemplate.replaceAll("\\$\\{" + regExpescape(key) + "\\}", regExpescape(String.valueOf(value))); |
String | replaceMap(String inStr, Map replaceMap) We substitute string character according to a substitution map. String str = inStr; Iterator itr = replaceMap.keySet().iterator(); while (itr.hasNext()) { String key = (String) itr.next(); String value = (String) replaceMap.get(key); if (key != null && value != null) { str = replaceStr(str, key, value); return str; |
String | replaceMethodUriWithValues(String methodUri, Map Replace input parameters in the URL with correct values String uri = methodUri; for (String key : urlParameterKeyValues.keySet()) { uri = uri.replace(new String(key), new String(urlParameterKeyValues.get(key))); return uri; |
Map | replaceNode(Map replace Node Map<String, Object> m = map; Map<String, Object> subm = m; String name = null; if (pathItems.isEmpty()) return replacement; for (String pathItem : pathItems) { name = pathItem; m = subm; ... |
String | replaceNotContainedWithReplaced(String sentStr, Map replace Not Contained With Replaced for (String notContained : mapNotContainedReplaced.keySet()) { sentStr = sentStr.replace(notContained, mapNotContainedReplaced.get(notContained)); return sentStr; |
String | replaceOpcodeNames(HashMap replacementValues, final String input) replace Opcode Names String retVal = input; for (Iterator iter = replacementValues.entrySet().iterator(); iter.hasNext();) { Map.Entry entry = (Entry) iter.next(); String key = (String) entry.getKey(); String value = (String) entry.getValue(); retVal = retVal.replaceAll("(^|\\s)" + key + "($|\\s)", "$1" + value + "$2"); return retVal; ... |
String | replaceParameters(final String value, final Map replace Parameters final StringBuilder sb = new StringBuilder(); int paramStart = -1; char[] chars = value.toCharArray(); for (int i = 0; i < chars.length; i++) { switch (chars[i]) { case '\\': if (paramStart == -1) { if (i + 1 < chars.length && (chars[i + 1] == '\\' || chars[i + 1] == '$')) { ... |
void | replaceParameters(Map Utility method that uppercases the original parameters, adds the default parameters in the map if missing, and replaces the parameters contained in the hards map. for (String def : defaults.keySet()) { String key = def.toUpperCase(); if (originals.containsKey(key)) { map.put(key, originals.get(key)); } else { map.put(def, defaults.get(def)); for (Entry<String, String> e : hards.entrySet()) { if (map.containsKey(e.getKey().toLowerCase())) { map.put(e.getKey().toLowerCase(), e.getValue()); } else map.put(e.getKey(), e.getValue()); |
String | replaceParameters(String query, Map replace Parameters if (parameters != null) { for (String parameter : parameters.keySet()) { String value = parameters.get(parameter); if (value == null) value = ""; query = query.replaceAll("(?i)\\$\\{" + parameter + "\\}", value); return query; |