Set<Capability> matches = new HashSet<>(); if (sf.getOperation() == SimpleFilter.MATCH_ALL) { matches.addAll(caps); } else if (sf.getOperation() == SimpleFilter.AND) { caps = matches; } else if (sf.getOperation() == SimpleFilter.OR) { matches.addAll(match(caps, sf1)); } else if (sf.getOperation() == SimpleFilter.NOT) { if ((sf.getOperation() == SimpleFilter.EQ) && (index != null)) { Set<Capability> existingCaps = index.get(sf.getValue()); if (existingCaps != null) { Object lhs = cap.getAttributes().get(sf.getName()); if (lhs != null) { if (compare(lhs, sf.getValue(), sf.getOperation())) { matches.add(cap);
boolean matched = true; if (sf.getOperation() == SimpleFilter.MATCH_ALL) { matched = true; } else if (sf.getOperation() == SimpleFilter.AND) { matched = matchesInternal(cap, sfs.get(i)); } else if (sf.getOperation() == SimpleFilter.OR) { matched = matchesInternal(cap, sfs.get(i)); } else if (sf.getOperation() == SimpleFilter.NOT) { Object lhs = cap.getAttributes().get(sf.getName()); if (lhs != null) { matched = compare(lhs, sf.getValue(), sf.getOperation());
boolean matched = true; if (sf.getOperation() == SimpleFilter.MATCH_ALL) { matched = true; } else if (sf.getOperation() == SimpleFilter.AND) { matched = matchesInternal(cap, sfs.get(i)); } else if (sf.getOperation() == SimpleFilter.OR) { matched = matchesInternal(cap, sfs.get(i)); } else if (sf.getOperation() == SimpleFilter.NOT) { Object lhs = cap.getAttributes().get(sf.getName()); if (lhs != null) { matched = compare(lhs, sf.getValue(), sf.getOperation());
Set<Capability> matches = new HashSet<>(); if (sf.getOperation() == SimpleFilter.MATCH_ALL) { matches.addAll(caps); } else if (sf.getOperation() == SimpleFilter.AND) { caps = matches; } else if (sf.getOperation() == SimpleFilter.OR) { matches.addAll(match(caps, sf1)); } else if (sf.getOperation() == SimpleFilter.NOT) { if ((sf.getOperation() == SimpleFilter.EQ) && (index != null)) { Set<Capability> existingCaps = index.get(sf.getValue()); if (existingCaps != null) { Object lhs = cap.getAttributes().get(sf.getName()); if (lhs != null) { if (compare(lhs, sf.getValue(), sf.getOperation())) { matches.add(cap);
private static boolean matchMandatoryAttribute(String attrName, SimpleFilter sf) { if ((sf.getName() != null) && sf.getName().equals(attrName)) { return true; } else if (sf.getOperation() == SimpleFilter.AND) { List list = (List) sf.getValue(); for (Object aList : list) { SimpleFilter sf2 = (SimpleFilter) aList; if ((sf2.getName() != null) && sf2.getName().equals(attrName)) { return true; } } } return false; }
private static boolean matchMandatoryAttribute(String attrName, SimpleFilter sf) { if ((sf.getName() != null) && sf.getName().equals(attrName)) { return true; } else if (sf.getOperation() == SimpleFilter.AND) { List list = (List) sf.getValue(); for (Object aList : list) { SimpleFilter sf2 = (SimpleFilter) aList; if ((sf2.getName() != null) && sf2.getName().equals(attrName)) { return true; } } } return false; }