Java Utililty Methods Map Remove

List of utility methods to do Map Remove

Description

The list of methods to do Map Remove are organized into topic(s).

Method

voidremoveTrailingNumber(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());
...
voidremoveValue(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 {
...
voidremoveValue(Map subject, String property, Map value, boolean propertyIsArray)
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 {
...
voidremoveValueFromAll(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]);
ListremoveValueList(final Map> map, final K key, final V value)
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;
...
voidremoveValuesFromMap(Map map, Collection removed)
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();
MapremoveVersionSelector(Map selector)
remove Version Selector
Map<String, String> answer = new HashMap<>(selector);
answer.remove("version");
return answer;
MapremoveWireAttributes(Map 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);
...
MapsplitEachArrayElementAndCreateMap(String[] array, String delimiter, String removeCharacters)
Takes an array of Strings, 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];
...