private static Predicate and(Predicate lhs, Predicate rhs) { if (lhs == null) { return rhs; } else { return ExpressionUtils.and(lhs, rhs); } }
/** * Create the insertion of this and the given predicate * * @param right * @return */ public BooleanBuilder and(@Nullable Predicate right) { if (right != null) { if (predicate == null) { predicate = right; } else { predicate = ExpressionUtils.and(predicate, right); } } return this; }
/** * Create the intersection of the given arguments * * @param exprs * @return */ @Nullable public static Predicate allOf(Predicate... exprs) { Predicate rv = null; for (Predicate b : exprs) { if (b != null) { rv = rv == null ? b : ExpressionUtils.and(rv,b); } } return rv; }
/** * Create the intersection of the given arguments * * @param exprs * @return */ @Nullable public static Predicate allOf(Collection<Predicate> exprs) { Predicate rv = null; for (Predicate b : exprs) { if (b != null) { rv = rv == null ? b : ExpressionUtils.and(rv,b); } } return rv; }
rhs = (Predicate) transform(expr.getArg(1), filters); return lhs == null ? rhs : (rhs == null ? lhs : ExpressionUtils.and(lhs, rhs)); expr = (Operation<?>) ExpressionUtils.and( PredicateOperation.create(first, expr.getArg(0), expr.getArg(1)), PredicateOperation.create(second, expr.getArg(0), expr.getArg(2)));