public static SearchCond getAndCond(final List<SearchCond> conditions) { if (conditions.size() == 1) { return conditions.get(0); } else if (conditions.size() > 2) { SearchCond removed = conditions.remove(0); return getAndCond(removed, getAndCond(conditions)); } else { return getAndCond(conditions.get(0), conditions.get(1)); } }
protected SearchCond buildEffectiveCond(final SearchCond cond, final Set<String> dynRealmKeys) { List<SearchCond> effectiveConds = dynRealmKeys.stream().map(dynRealmKey -> { DynRealmCond dynRealmCond = new DynRealmCond(); dynRealmCond.setDynRealm(dynRealmKey); return SearchCond.getLeafCond(dynRealmCond); }).collect(Collectors.toList()); effectiveConds.add(cond); return SearchCond.getAndCond(effectiveConds); }
private SearchCond visitCompount(final SearchCondition<SearchBean> sc) { List<SearchCond> searchConds = new ArrayList<>(); sc.getSearchConditions().forEach(searchCondition -> { searchConds.add(searchCondition.getStatement() == null ? visitCompount(searchCondition) : visitPrimitive(searchCondition)); }); SearchCond compound; switch (sc.getConditionType()) { case AND: compound = SearchCond.getAndCond(searchConds); break; case OR: compound = SearchCond.getOrCond(searchConds); break; default: throw new IllegalArgumentException( String.format("Condition type %s is not supported", sc.getConditionType().name())); } return compound; }
@Override public SearchCond visitEXPR_AND_EXPR(final SCIMFilterParser.EXPR_AND_EXPRContext ctx) { return SearchCond.getAndCond(visit(ctx.expression(0)), visit(ctx.expression(1))); }
termCond.setExpression(termSearchableValue); searchCond = SearchCond.getAndCond( SearchCond.getLeafCond(assignableCond), SearchCond.getLeafCond(termCond));
: SearchCond.getAndCond(searchConds);
@Override public <T extends Any<?>> boolean matches(final T any, final SearchCond cond) { AnyCond keycond = new AnyCond(AttributeCond.Type.EQ); keycond.setSchema("key"); keycond.setExpression(any.getKey()); return !search(SearchCond.getAndCond(SearchCond.getLeafCond(keycond), cond), any.getType().getKind()).isEmpty(); } }
private SearchCond buildDynMembershipCond(final String baseCondFIQL, final Realm groupRealm) { AssignableCond cond = new AssignableCond(); cond.setRealmFullPath(groupRealm.getFullPath()); cond.setFromGroup(true); return SearchCond.getAndCond(SearchCond.getLeafCond(cond), SearchCondConverter.convert(baseCondFIQL)); }
SearchCond cond = StringUtils.isBlank(this.conf.getAnyObjectMatchingCond()) ? SearchCond.getLeafCond(anyTypeCond) : SearchCond.getAndCond( SearchCond.getLeafCond(anyTypeCond), SearchCondConverter.convert(this.conf.getAnyObjectMatchingCond()));