编程语言
首页 > 编程语言> > java map差集

java map差集

作者:互联网

public static void getDifferenceSetByGuava(Map<String, Object> bigMap, Map<String, String> smallMap, Map<String, Object> resMap) {
    Set<String> bigMapKey = bigMap.keySet();
    Set<String> smallMapKey = smallMap.keySet();
    Set<String> differenceSet = Sets.difference(bigMapKey, smallMapKey);
    for (String key : differenceSet) {
        resMap.put(key, bigMap.get(key));
    }
}

标签:map,Set,java,Map,差集,keySet,smallMap,key,bigMap
来源: https://www.cnblogs.com/y155/p/16523621.html