Java Map Merge mergeFixedValueConditions(Map> left, Map> right)

Here you can find the source of mergeFixedValueConditions(Map> left, Map> right)

Description

merge Fixed Value Conditions

License

Apache License

Declaration

public static Map<String, Set<Object>> mergeFixedValueConditions(Map<String, Set<Object>> left,
            Map<String, Set<Object>> right) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.*;

public class Main {
    public static Map<String, Set<Object>> mergeFixedValueConditions(Map<String, Set<Object>> left,
            Map<String, Set<Object>> right) {
        right.keySet().forEach(columnName -> {
            Set<Object> newValues = right.get(columnName);
            if (newValues != null) {
                left.merge(columnName, newValues, (l, r) -> new HashSet<Object>() {
                    {/*ww w. j a v  a2  s. co m*/
                        addAll(l);
                        addAll(r);
                    }
                });
            }
        });
        return left;
    }
}

Related

  1. mergeDefaults(Map content, Map defaults)
  2. mergeEntries( Map dest, Iterable> entries)
  3. mergeEnv(Map newEnv, Map env)
  4. mergeEnvironmentVariables(Map environmentSource, Map environmentDestination, String environmentVariable)
  5. mergeFamilies(Map familySource, Map familyTarget)
  6. mergeIfAbsent(Map map, Map toMerge)
  7. mergeImportedPermissionsWithExistingPermissions( Map> existingRoleIdsToActionIds, Map importedRoleIdsToActionIds)
  8. mergeListWithMap(List from, Map to)
  9. mergeMap(Map map, Object[]... pairs)