/** * Filter a given list of flows based on the existing content filter. * * @param flows list of flows to filter * @return further filtered list of flows */ private List<FlowEntry> filterFlows(List<FlowEntry> flows) { return flows.stream(). filter(f -> contentFilter.filter(f)).collect(Collectors.toList()); }
/** * Filters data according to a set of restrictions and a specific strategy. * * @param data Object with data to filter * @return true if data honours the filters, false otherwise */ public boolean filter(Object data) { if (strategy == Strategy.OR) { return filterOr(data); } else { return filterAnd(data); } } }
contentFilter = new StringFilter(filter, StringFilter.Strategy.AND); contentFilter = new StringFilter(filter, StringFilter.Strategy.AND); IntentRemoveCommand intentRemoveCmd = new IntentRemoveCommand(); if (!remove.isEmpty()) { StringBuilder detailsIntentFormat = detailsFormat(intent, state); String formatted = intentFormat.append(detailsIntentFormat).toString(); if (contentFilter.filter(formatted)) { print("%s\n", formatted);
DeviceService deviceService = get(DeviceService.class); FlowRuleService service = get(FlowRuleService.class); contentFilter = new StringFilter(filter, StringFilter.Strategy.AND); if (!remove.isEmpty()) { filter.add(remove); contentFilter = new StringFilter(filter, StringFilter.Strategy.AND);
/** * Filter a given list of intents based on the existing content filter. * * @param intents Iterable of intents * @return further filtered list of intents */ private List<Intent> filterIntents(Iterable<Intent> intents) { return Tools.stream(intents) .filter(i -> contentFilter.filter(i)).collect(Collectors.toList()); }
private JsonNode json(Iterable<Intent> intents) { ObjectMapper mapper = new ObjectMapper(); ArrayNode result = mapper.createArrayNode(); Tools.stream(intents) .filter(intent -> contentFilter.filter(jsonForEntity(intent, Intent.class).toString())) .forEach(intent -> result.add(jsonForEntity(intent, Intent.class))); return result; } }
/** * Creates {@link IntentSummary} initialized with given {@code intent}. * * @param intent to initialize with */ IntentSummary(Intent intent) { // remove "Intent" from intentType label this(intentType(intent)); if (contentFilter.filter(intent)) { update(service.getIntentState(intent.key())); } }
.stream().filter(i -> contentFilter.filter(i)) .collect(Collectors.toList()); if (showInstallable && installable != null && !installable.isEmpty()) {