List of utility methods to do Map Merge
void | mergeBootArgumentsIntoMap(String[] args, Map map) merge Boot Arguments Into Map if (map == null) { throw new IllegalArgumentException("Map must not be null"); for (String arg : args) { if (arg.startsWith("--") && arg.length() > 4) { String[] split = arg.substring(2).split("="); if (split.length == 2) { map.put(split[0], split[1]); ... |
void | mergeCompactedValue(Map merge Compacted Value if (obj == null) { return; final Object prop = obj.get(key); if (prop == null) { obj.put(key, value); return; if (!(prop instanceof List)) { final List<Object> tmp = new ArrayList<Object>(); tmp.add(prop); if (value instanceof List) { ((List<Object>) prop).addAll((List<Object>) value); } else { ((List<Object>) prop).add(value); |
Map | mergeCompositions(Map merge Compositions if (source == null || target == null) { return target; for (String key : source.keySet()) { Integer value = target.get(key); if (value == null) { target.put(key, source.get(key)); else { target.put(key, value + source.get(key)); return target; |
Map | mergeConfig(Map Produce a map where the reference values are overridden with user values. Map<String, Object> config = new HashMap<>(referenceConfig); config.putAll(userConfig); return config; |
void | mergeCounterMap(Map map, String key, Object value) merge Counter Map if (value instanceof Map) { mergeCounterMap(map, key, (Map) value); } else { mergeCounterMap(map, key, (Number) value); |
void | mergeCountMaps(Map Merge two count maps of type for (Entry<K, Integer> entry : other.entrySet()) { K key = entry.getKey(); Integer value = entry.getValue(); if (base.get(key) == null) { base.put(key, value); } else { base.put(key, base.get(key) + value); |
void | mergeCounts(Map merge Counts if (counter.containsKey(key)) { Integer count = counter.get(key); counter.put(key, ++count); } else { counter.put(key, 1); |
Map | mergeCustomProperties(Map merge Custom Properties if (copyTo == null) { return copyFrom; } else if (copyFrom != null && !copyFrom.isEmpty()) { copyTo.putAll(copyFrom); return copyTo; |
void | mergeDefaults(Map Merge defaults. for (Map.Entry<String, Object> defaultEntry : defaults.entrySet()) { if (!content.containsKey(defaultEntry.getKey())) { content.put(defaultEntry.getKey(), defaultEntry.getValue()); } else { if (content.get(defaultEntry.getKey()) instanceof Map && defaultEntry.getValue() instanceof Map) { mergeDefaults((Map<String, Object>) content.get(defaultEntry.getKey()), (Map<String, Object>) defaultEntry.getValue()); } else if (content.get(defaultEntry.getKey()) instanceof List ... |
Map | mergeEntries(Map Merge a set of entries into a map. for (Map.Entry<String, String> entry : entries) { dest.put(entry.getKey(), entry.getValue()); return dest; |