Applies the function {@code fx} to each of the
{@link BELUtilities#entries(Map) entries} within the supplied map.

@param map Non-null {@link Map}
@param fx Non-null {@link MapFunction} to apply
420656
public static <K, V> void mapfx(Map<K, V> map, MapFunction<K, V> fx) {
        Set<Entry<K, V>> entries = entries(map);
        for (final Entry<K, V> entry : entries) {
            K key = entry.getKey();
            V value = entry.getValue();
            fx.apply(key, value);
        }
    }
1189712
@Override
    public List<String> applyToMap( Map<String, Object> inputMap ) {
        if ( inputMap == null ) {
            return null;
        }

        List<String> keysToBeRemoved = new LinkedList<>();

        if ( pathElement instanceof LiteralPathElement ) {

            // if we are a literal, check to see if we match
            if ( inputMap.containsKey( pathElement.getRawKey() ) ) {
                keysToBeRemoved.add( pathElement.getRawKey() );
            }
        }
        else if ( pathElement instanceof StarPathElement ) {

            StarPathElement star = (StarPathElement) pathElement;

            // if we are a wildcard, check each input key to see if it matches us
            for( String key : inputMap.keySet() ) {

                if ( star.stringMatch( key ) ) {
                    keysToBeRemoved.add( key );
                }
            }
        }

        return keysToBeRemoved;
    }
454924
public void append(Map<?, ?> map) {
		if (map == null || map.size() == 0)
			return;

		for (Map.Entry<?, ?> entry : map.entrySet()) {
			put(StringConverter.toString(entry.getKey()), StringConverter.toNullableString(entry.getValue()));
		}
	}
986363
public void setApplicationMap(final Map<String, Object> applicationMap) {
		JKThreadLocal.setValue(JKContextConstants.APPLICATION_MAP, applicationMap);
	}
1189502
public void filterValues(Map<?, String> map) {

        // For each map entry
        for (Map.Entry<?, String> entry : map.entrySet()) {

            // If value is non-null, filter value through this TokenFilter
            String value = entry.getValue();
            if (value != null)
                entry.setValue(filter(value));
            
        }
        
    }
187557
private void putAllIfAbsent(final Map<String, String> baseMap, final Map<String, String> map) {
		for (Map.Entry<String, String> entry : map.entrySet()) {
			if (!baseMap.containsKey(entry.getKey())) {
				baseMap.put(entry.getKey(), entry.getValue());
			}
		}
	}
1222117
public void putAllWriteable(BeanMap<T> map) {
        map.types.keySet().stream().filter(key -> getWriteInvoker(key) != null).forEach(key -> this.put(key, map.get(key)));
    }
638589
public void putMap (Map<String,String> map) {                                                       //SIB0163.comms.1
     if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "putMap", "map="+map);

     if (map != null) {
       final Set<String> keys = map.keySet();
       putShort(keys.size()); // Number of entries
       for (String k: keys) {
         putString(k);
         putString(map.get(k));
       }
     } else {
       putShort(0);
     }

     if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "putMap");
   }
713709
private static void mapAdd(Map<String, List<String>> map, String key, String val) {
    List<String> list = map.get(key);
    if (list == null) {
      list = new ArrayList<>();
      map.put(key, list);
    }
    list.add(val);
  }
731874
public void addJavaScriptValues(Map<String, String> parameterMap) {
        for (Map.Entry<String, String> entry : parameterMap.entrySet()) {
            String parameterName = entry.getKey();
            String parameterValue = entry.getValue();
            this.javascriptExpressions.put(parameterName, parameterValue);
        }
    }
165453
public static <K, V> void putAllIntoListMap(K key, Collection<? extends V> values, Map<? super K, List<V>> map) {
		List<V> list = map.get(key);
		if (list == null) {
			list = Lists.newArrayList(values);
			map.put(key, list);
		} else {
			list.addAll(values);
		}
	}
637856
public void mapInPlace(Function<Double, Double> fn) {
    for (int i = 0; i < pointers.length; i++) {
      if (pointers[i] == null) continue;

      if (copyOnWrite[i]) {
        copyOnWrite[i] = false;
        pointers[i] = pointers[i].clone();
      }

      if (sparse[i]) {
        for (int j = 0; j < pointers[i].length / 2; j++) {
          pointers[i][(j * 2) + 1] = fn.apply(pointers[i][(j * 2) + 1]);
        }
      } else {
        for (int j = 0; j < pointers[i].length; j++) {
          pointers[i][j] = fn.apply(pointers[i][j]);
        }
      }
    }
  }
101091
private static void writeMap(Map<?, ?> map, CharBuf buffer) {
        if (!map.isEmpty()) {
            buffer.addChar('{');
            boolean firstItem = true;
            for (Map.Entry<?, ?> entry : map.entrySet()) {
                if (entry.getKey() == null) {
                    throw new IllegalArgumentException("Maps with null keys can\'t be converted to JSON");
                }

                if (!firstItem) {
                    buffer.addChar(',');
                } else {
                    firstItem = false;
                }

                buffer.addJsonFieldName(entry.getKey().toString());
                writeObject(entry.getValue(), buffer);
            }
            buffer.addChar('}');
        } else {
            buffer.addChars(EMPTY_MAP_CHARS);
        }
    }
1161581
@Modified
    protected void modified(Map<String, Object> map) {

        // Build up the list of filters in a local list, then convert that to an array
        // and assign to the static reference. This is done to avoid creating an iterator
        // in the main path in `process`.
        List<SpanFilter> filters = new ArrayList<SpanFilter>();

        /*
         * Removing filter processing until microprofile spec for it is approved. Expect to add this code
         * back in in 1Q18 - smf
         */
//        processFilters(filters, map, configAdmin, "excludeSpans", ExcludeFilter.class);
//        processFilters(filters, map, configAdmin, "includeSpans", IncludeFilter.class);

        SpanFilter[] finalFilters = new SpanFilter[filters.size()];
        filters.toArray(finalFilters);

        allFilters = finalFilters;
    }
479782
private void read(final Map<String, String> map) {
        String name, value;
        for (final Entry<String, String> entry : entries(map)) {
            name = entry.getKey();
            value = entry.getValue();
            cfgMap.put(name, valueSubstitution(value));
        }
    }
1146509
public static <K, V, A> A ifPresentApply(
            Map<K, V> map,
            K key,
            Function<? super V, ? extends A> function)
    {
        if (map instanceof UnsortedMapIterable)
        {
            return ((MapIterable<K, V>) map).ifPresentApply(key, function);
        }
        V result = map.get(key);
        return MapIterate.isAbsent(result, map, key) ? null : function.valueOf(result);
    }
1260109
public static <K, V> boolean remove(final Map<K, V> map, Map.Entry<?, ?> entry) {
        return remove(map, entry.getKey(), entry.getValue());
    }