final Result onMismatch = Result.toResult(mismatch);
final Map<String, Level> map = new HashMap<String, Level>();
for (final KeyValuePair pair : pairs) {
map.put(pair.getKey(), Level.toLevel(pair.getValue()));
}
final Level level = Level.toLevel(levelName, Level.ERROR);
return new DynamicThresholdFilter(key, map, level, onMatch, onMismatch);
}