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);//差集
Set<String> differenceSet = Sets.union(bigMapKey, smallMapKey);//并集
for (String key : differenceSet)
{
resMap.put(key, bigMap.get(key)); }
}

浙公网安备 33010602011771号