/** * Factory to create the predicate. * * @param predicate1 the first predicate to check, not null * @param predicate2 the second predicate to check, not null * @return the <code>and</code> predicate * @throws IllegalArgumentException if either predicate is null */ public static Predicate getInstance(Predicate predicate1, Predicate predicate2) { if (predicate1 == null || predicate2 == null) { throw new IllegalArgumentException("Predicate must not be null"); } return new OrPredicate(predicate1, predicate2); }
/** * Create a new Predicate that returns true if either of the specified * predicates are true. * * @see org.apache.commons.collections.functors.OrPredicate * * @param predicate1 the first predicate, may not be null * @param predicate2 the second predicate, may not be null * @return the <code>or</code> predicate * @throws IllegalArgumentException if either predicate is null */ public static Predicate orPredicate(Predicate predicate1, Predicate predicate2) { return OrPredicate.getInstance(predicate1, predicate2); }
void visit(OrPredicate p) throws IOException { String op = ") || "; for (int i = 0; i < p.getPredicates().length; i++) { Predicate innerP = p.getPredicates()[i]; append('('); doVisit(innerP); if (i < p.getPredicates().length - 1) { append(op); } else { append(')'); } } }
/** * Factory to create the predicate. * * @param predicate1 the first predicate to check, not null * @param predicate2 the second predicate to check, not null * @return the <code>and</code> predicate * @throws IllegalArgumentException if either predicate is null */ public static Predicate getInstance(Predicate predicate1, Predicate predicate2) { if (predicate1 == null || predicate2 == null) { throw new IllegalArgumentException("Predicate must not be null"); } return new OrPredicate(predicate1, predicate2); }
/** * Create a new Predicate that returns true if either of the specified * predicates are true. * * @see org.apache.commons.collections.functors.OrPredicate * * @param predicate1 the first predicate, may not be null * @param predicate2 the second predicate, may not be null * @return the <code>or</code> predicate * @throws IllegalArgumentException if either predicate is null */ public static Predicate orPredicate(Predicate predicate1, Predicate predicate2) { return OrPredicate.getInstance(predicate1, predicate2); }
/** * Factory to create the predicate. * * @param predicate1 the first predicate to check, not null * @param predicate2 the second predicate to check, not null * @return the <code>and</code> predicate * @throws IllegalArgumentException if either predicate is null */ public static Predicate getInstance(Predicate predicate1, Predicate predicate2) { if (predicate1 == null || predicate2 == null) { throw new IllegalArgumentException("Predicate must not be null"); } return new OrPredicate(predicate1, predicate2); }
/** * Create a new Predicate that returns true if either of the specified * predicates are true. * * @see org.apache.commons.collections.functors.OrPredicate * * @param predicate1 the first predicate, may not be null * @param predicate2 the second predicate, may not be null * @return the <code>or</code> predicate * @throws IllegalArgumentException if either predicate is null */ public static Predicate orPredicate(Predicate predicate1, Predicate predicate2) { return OrPredicate.getInstance(predicate1, predicate2); }
/** * Factory to create the predicate. * * @param predicate1 the first predicate to check, not null * @param predicate2 the second predicate to check, not null * @return the <code>and</code> predicate * @throws IllegalArgumentException if either predicate is null */ public static Predicate getInstance(Predicate predicate1, Predicate predicate2) { if (predicate1 == null || predicate2 == null) { throw new IllegalArgumentException("Predicate must not be null"); } return new OrPredicate(predicate1, predicate2); }
/** * Create a new Predicate that returns true if either of the specified * predicates are true. * * @see org.apache.commons.collections.functors.OrPredicate * * @param predicate1 the first predicate, may not be null * @param predicate2 the second predicate, may not be null * @return the <code>or</code> predicate * @throws IllegalArgumentException if either predicate is null */ public static Predicate orPredicate(Predicate predicate1, Predicate predicate2) { return OrPredicate.getInstance(predicate1, predicate2); }
/** * Factory to create the predicate. * * @param predicate1 the first predicate to check, not null * @param predicate2 the second predicate to check, not null * @return the <code>and</code> predicate * @throws IllegalArgumentException if either predicate is null */ public static Predicate getInstance(Predicate predicate1, Predicate predicate2) { if (predicate1 == null || predicate2 == null) { throw new IllegalArgumentException("Predicate must not be null"); } return new OrPredicate(predicate1, predicate2); }
/** * Create a new Predicate that returns true if either of the specified * predicates are true. * * @see org.apache.commons.collections.functors.OrPredicate * * @param predicate1 the first predicate, may not be null * @param predicate2 the second predicate, may not be null * @return the <code>or</code> predicate * @throws IllegalArgumentException if either predicate is null */ public static Predicate orPredicate(Predicate predicate1, Predicate predicate2) { return OrPredicate.getInstance(predicate1, predicate2); }
/** * Factory to create the predicate. * * @param predicate1 the first predicate to check, not null * @param predicate2 the second predicate to check, not null * @return the <code>and</code> predicate * @throws IllegalArgumentException if either predicate is null */ public static Predicate getInstance(Predicate predicate1, Predicate predicate2) { if (predicate1 == null || predicate2 == null) { throw new IllegalArgumentException("Predicate must not be null"); } return new OrPredicate(predicate1, predicate2); }
/** * Create a new Predicate that returns true if either of the specified * predicates are true. * * @see org.apache.commons.collections.functors.OrPredicate * * @param predicate1 the first predicate, may not be null * @param predicate2 the second predicate, may not be null * @return the <code>or</code> predicate * @throws IllegalArgumentException if either predicate is null */ public static Predicate orPredicate(Predicate predicate1, Predicate predicate2) { return OrPredicate.getInstance(predicate1, predicate2); }
/** * Factory to create the predicate. * * @param predicate1 the first predicate to check, not null * @param predicate2 the second predicate to check, not null * @return the <code>and</code> predicate * @throws IllegalArgumentException if either predicate is null */ public static Predicate getInstance(Predicate predicate1, Predicate predicate2) { if (predicate1 == null || predicate2 == null) { throw new IllegalArgumentException("Predicate must not be null"); } return new OrPredicate(predicate1, predicate2); }
/** * Create a new Predicate that returns true if either of the specified * predicates are true. * * @see org.apache.commons.collections.functors.OrPredicate * * @param predicate1 the first predicate, may not be null * @param predicate2 the second predicate, may not be null * @return the <code>or</code> predicate * @throws IllegalArgumentException if either predicate is null */ public static Predicate orPredicate(Predicate predicate1, Predicate predicate2) { return OrPredicate.getInstance(predicate1, predicate2); }
public static Predicate filterOnStart(final ResourceResolver resolver) { return new AllPredicate(new Predicate[]{filterExecutionEnabled(true), new OrPredicate(filterByExecutionMode(ExecutionMode.ON_START), filterOnModify(resolver))}); } }
andTest = false; } else if (orTest) { predicate1 = OrPredicate.getInstance(predicate1, predicate2); orTest = false;
public static Predicate filterOnStart(final ResourceResolver resolver) { return new AllPredicate(new Predicate[]{filterExecutionEnabled(true), new OrPredicate(filterByExecutionMode(ExecutionMode.ON_START), filterOnModify(resolver))}); } }