Matcher(List<Match> matches) { aliases = new HashMap<>(); for (Match match : matches) { if (match.getAlias() != null) { aliases.put(match.getValue(), match.getAlias()); } } exactMatches = matches.stream() .filter(match -> match.getType() == MatchType.EQUALS && match.getValue() != null) .collect(Collectors.toMap(Match::getValue, match -> match.getAlias() != null ? match.getAlias() : match.getValue())); @SuppressWarnings("unchecked") Entry<Pattern, String>[] entries = matches.stream() .filter(match -> match.getType() == MatchType.REGEX && match.getValue() != null) .map(match -> new SimpleEntry<>(Pattern.compile(match.getValue()), match.getAlias())) .toArray(Entry[]::new); regexMatches = entries; }
private List<Match> loadMonitored(String arrayField, JsonObject json) { List<Match> list = new ArrayList<>(); JsonArray monitored = json.getJsonArray(arrayField, new JsonArray()); monitored.forEach(object -> { if (object instanceof JsonObject) list.add(new Match((JsonObject) object)); }); return list; }
((Iterable<Object>)member.getValue()).forEach( item -> { if (item instanceof JsonObject) obj.addMonitoredEventBusHandler(new io.vertx.ext.dropwizard.Match((JsonObject)item)); }); ((Iterable<Object>)member.getValue()).forEach( item -> { if (item instanceof JsonObject) obj.addMonitoredHttpClientEndpoint(new io.vertx.ext.dropwizard.Match((JsonObject)item)); }); ((Iterable<Object>)member.getValue()).forEach( item -> { if (item instanceof JsonObject) obj.addMonitoredHttpClientUri(new io.vertx.ext.dropwizard.Match((JsonObject)item)); }); ((Iterable<Object>)member.getValue()).forEach( item -> { if (item instanceof JsonObject) obj.addMonitoredHttpServerUri(new io.vertx.ext.dropwizard.Match((JsonObject)item)); });