List of utility methods to do Map Merge
void | mergeEnv(Map merge Env if (env != null) {
env.forEach((k, v) -> newEnv.put(k, v));
|
void | mergeEnvironmentVariables(Map merge Environment Variables if (environmentSource == null) { return; if (environmentSource.containsKey(environmentVariable)) { environmentDestination.put(environmentVariable, environmentDestination.get(environmentVariable) + ":" + environmentSource.get(environmentVariable)); |
void | mergeFamilies(Map merge Families if (familySource == null) { return; for (K key : familySource.keySet()) { if (!familyTarget.containsKey(key)) { familyTarget.put(key, familySource.get(key)); } else { if (familyTarget.get(key).getClass() == Integer.class) { ... |
Map | mergeFixedValueConditions(Map merge Fixed Value Conditions right.keySet().forEach(columnName -> { Set<Object> newValues = right.get(columnName); if (newValues != null) { left.merge(columnName, newValues, (l, r) -> new HashSet<Object>() { addAll(l); addAll(r); }); }); return left; |
void | mergeIfAbsent(Map Add all values of a map to another map, but onlfy if not already existing. for (Map.Entry<String, String> entry : toMerge.entrySet()) {
putIfAbsent(map, entry.getKey(), entry.getValue());
;
|
Map | mergeImportedPermissionsWithExistingPermissions( Map merge Imported Permissions With Existing Permissions Map<Long, String[]> mergedRoleIdsToActionIds = new HashMap<>(); for (Map.Entry<Long, Set<String>> roleIdsToActionIds : existingRoleIdsToActionIds.entrySet()) { long roleId = roleIdsToActionIds.getKey(); if (importedRoleIdsToActionIds.containsKey(roleId)) { String[] actionIds = importedRoleIdsToActionIds.remove(roleId); mergedRoleIdsToActionIds.put(roleId, actionIds); } else { mergedRoleIdsToActionIds.put(roleId, new String[0]); ... |
Map | mergeListWithMap(List merge List With Map for (Integer value : from) { Integer count = to.get(value); to.put(value, (count != null ? count + 1 : 1)); return to; |
Map | mergeMap(Map map, Object[]... pairs) Merges the map with the new value and returns a new map. if (map == null) { map = new HashMap(); Map newMap = new HashMap(map); for (Object[] pair : pairs) { newMap.put(pair[0], pair[1]); return newMap; ... |
Properties | mergeMap(Map primaryValues, Map defaultValues) Create a list of Properties containing all keys from two lists of given Propertiess. Properties result = new Properties(); if (defaultValues != null) { result.putAll(defaultValues); if (primaryValues != null) { result.putAll(primaryValues); return result; ... |
Map | mergeMap(Map Merge in one map to another -all entries in the second map are merged into the first -overwriting any duplicate keys. first.putAll(second);
return first;
|