in dubbo-admin-server/src/main/java/org/apache/dubbo/admin/common/util/RouteUtils.java [479:495]
public static RouteUtils copyWithRemove(RouteUtils copy, Set<String> whenParams, Set<String> thenParams) {
Map<String, MatchPair> when = new HashMap<String, MatchPair>();
for (Entry<String, MatchPair> entry : copy.getWhenCondition().entrySet()) {
if (whenParams == null || !whenParams.contains(entry.getKey())) {
when.put(entry.getKey(), entry.getValue());
}
}
Map<String, MatchPair> then = new HashMap<String, MatchPair>();
for (Entry<String, MatchPair> entry : copy.getThenCondition().entrySet()) {
if (thenParams == null || !thenParams.contains(entry.getKey())) {
then.put(entry.getKey(), entry.getValue());
}
}
return new RouteUtils(when, then);
}