List of utility methods to do Map Remove
void | removeTrailingNumber(Map names) remove Trailing Number boolean same = true; String lastChar = null; Iterator it = names.keySet().iterator(); while (it.hasNext()) { String key = (String) it.next(); String value = (String) names.get(key); if (lastChar == null) { lastChar = value.substring(value.length() - 1, value.length()); ... |
void | removeValue(final Map map, final Object key, final Object value) remove a value from a value list in a Map. List values; if ((values = (List) map.get(key)) == null) { return; values.remove(value); if (!values.isEmpty()) { map.put(key, values); } else { ... |
void | removeValue(Map remove Value final List<Object> values = new ArrayList<Object>(); if (subject.get(property) instanceof List) { for (final Object e : ((List) subject.get(property))) { if (!(value.equals(e))) { values.add(value); } else { ... |
void | removeValueFromAll(final Map map, final Object value) remove a value from all keys where it occurs. final Object[] keys = map.keySet().toArray(); for (int i = 0; i < keys.length; i++) { List list = (List) map.get(keys[i]); list.remove(value); if (list.isEmpty()) { map.remove(keys[i]); |
List | removeValueList(final Map Centralizes the map removing that containing list collections List<V> result = null; if (map != null) { result = map.get(key); if (result != null) { result.remove(value); return result; ... |
void | removeValuesFromMap(Map remove Values From Map Iterator<Entry<K, V>> it = map.entrySet().iterator(); while (it.hasNext()) { Entry<K, V> e = it.next(); if (removed.contains(e.getValue())) { it.remove(); |
Map | removeVersionSelector(Map remove Version Selector Map<String, String> answer = new HashMap<>(selector); answer.remove("version"); return answer; |
Map | removeWireAttributes(Map Remove the wire attributes from the specified map of message attributes (headers). final Map<String, String> wireAttrs = new HashMap<String, String>(); for (Iterator<Map.Entry<String, String>> it = map.entrySet().iterator(); it.hasNext();) { final Map.Entry<String, String> entry = it.next(); final String key = entry.getKey(); if (key.startsWith(WIRE_ATTR_PREFIX)) { final String value = entry.getValue(); final String newKey = key.substring(WIRE_ATTR_PREFIX.length()); wireAttrs.put(newKey, value); ... |
Map | splitEachArrayElementAndCreateMap(String[] array, String delimiter, String removeCharacters) Takes an array of String s, and for each element removes any instances of removeCharacter , and splits the element based on the delimiter .
if ((array == null) || (array.length == 0)) { return null; Map map = new HashMap(); for (int i = 0; i < array.length; i++) { String postRemove; if (removeCharacters == null) { postRemove = array[i]; ... |