/** * Factory to create the predicate. * <p> * If the collection is size zero, the predicate always returns true. * If the collection is size one, then that predicate is returned. * * @param predicates the predicates to check, cloned, not null * @return the <code>all</code> predicate * @throws IllegalArgumentException if the predicates array is null * @throws IllegalArgumentException if any predicate in the array is null */ public static Predicate getInstance(Collection predicates) { Predicate[] preds = FunctorUtils.validate(predicates); if (preds.length == 0) { return TruePredicate.INSTANCE; } if (preds.length == 1) { return preds[0]; } return new AllPredicate(preds); }
/** * Create a new Predicate that returns true only if all of the specified * predicates are true. * If the array of predicates is empty, then this predicate returns true. * * @see org.apache.commons.collections.functors.AllPredicate * * @param predicates an array of predicates to check, may not be null * @return the <code>all</code> predicate * @throws IllegalArgumentException if the predicates array is null * @throws IllegalArgumentException if any predicate in the array is null */ public static Predicate allPredicate(Predicate[] predicates) { return AllPredicate.getInstance(predicates); }
/** * Factory to create the predicate. * <p> * If the collection is size zero, the predicate always returns true. * If the collection is size one, then that predicate is returned. * * @param predicates the predicates to check, cloned, not null * @return the <code>all</code> predicate * @throws IllegalArgumentException if the predicates array is null * @throws IllegalArgumentException if any predicate in the array is null */ public static Predicate getInstance(Collection predicates) { Predicate[] preds = FunctorUtils.validate(predicates); if (preds.length == 0) { return TruePredicate.INSTANCE; } if (preds.length == 1) { return preds[0]; } return new AllPredicate(preds); }
/** * Create a new Predicate that returns true only if all of the specified * predicates are true. The predicates are checked in iterator order. * If the collection of predicates is empty, then this predicate returns true. * * @see org.apache.commons.collections.functors.AllPredicate * * @param predicates a collection of predicates to check, may not be null * @return the <code>all</code> predicate * @throws IllegalArgumentException if the predicates collection is null * @throws IllegalArgumentException if any predicate in the collection is null */ public static Predicate allPredicate(Collection predicates) { return AllPredicate.getInstance(predicates); }
/** * Factory to create the predicate. * <p> * If the array is size zero, the predicate always returns true. * If the array is size one, then that predicate is returned. * * @param predicates the predicates to check, cloned, not null * @return the <code>all</code> predicate * @throws IllegalArgumentException if the predicates array is null * @throws IllegalArgumentException if any predicate in the array is null */ public static Predicate getInstance(Predicate[] predicates) { FunctorUtils.validate(predicates); if (predicates.length == 0) { return TruePredicate.INSTANCE; } if (predicates.length == 1) { return predicates[0]; } predicates = FunctorUtils.copy(predicates); return new AllPredicate(predicates); }
/** * Create a new Predicate that returns true only if all of the specified * predicates are true. The predicates are checked in iterator order. * If the collection of predicates is empty, then this predicate returns true. * * @see org.apache.commons.collections.functors.AllPredicate * * @param predicates a collection of predicates to check, may not be null * @return the <code>all</code> predicate * @throws IllegalArgumentException if the predicates collection is null * @throws IllegalArgumentException if any predicate in the collection is null */ public static Predicate allPredicate(Collection predicates) { return AllPredicate.getInstance(predicates); }
/** * Factory to create the predicate. * <p> * If the array is size zero, the predicate always returns true. * If the array is size one, then that predicate is returned. * * @param predicates the predicates to check, cloned, not null * @return the <code>all</code> predicate * @throws IllegalArgumentException if the predicates array is null * @throws IllegalArgumentException if any predicate in the array is null */ public static Predicate getInstance(Predicate[] predicates) { FunctorUtils.validate(predicates); if (predicates.length == 0) { return TruePredicate.INSTANCE; } if (predicates.length == 1) { return predicates[0]; } predicates = FunctorUtils.copy(predicates); return new AllPredicate(predicates); }
/** * Create a new Predicate that returns true only if all of the specified * predicates are true. * If the array of predicates is empty, then this predicate returns true. * * @see org.apache.commons.collections.functors.AllPredicate * * @param predicates an array of predicates to check, may not be null * @return the <code>all</code> predicate * @throws IllegalArgumentException if the predicates array is null * @throws IllegalArgumentException if any predicate in the array is null */ public static Predicate allPredicate(Predicate[] predicates) { return AllPredicate.getInstance(predicates); }
/** * Factory to create the predicate. * <p> * If the collection is size zero, the predicate always returns true. * If the collection is size one, then that predicate is returned. * * @param predicates the predicates to check, cloned, not null * @return the <code>all</code> predicate * @throws IllegalArgumentException if the predicates array is null * @throws IllegalArgumentException if any predicate in the array is null */ public static Predicate getInstance(Collection predicates) { Predicate[] preds = FunctorUtils.validate(predicates); if (preds.length == 0) { return TruePredicate.INSTANCE; } if (preds.length == 1) { return preds[0]; } return new AllPredicate(preds); }
/** * Create a new Predicate that returns true only if all of the specified * predicates are true. The predicates are checked in iterator order. * If the collection of predicates is empty, then this predicate returns true. * * @see org.apache.commons.collections.functors.AllPredicate * * @param predicates a collection of predicates to check, may not be null * @return the <code>all</code> predicate * @throws IllegalArgumentException if the predicates collection is null * @throws IllegalArgumentException if any predicate in the collection is null */ public static Predicate allPredicate(Collection predicates) { return AllPredicate.getInstance(predicates); }
/** * Factory to create the predicate. * <p> * If the collection is size zero, the predicate always returns true. * If the collection is size one, then that predicate is returned. * * @param predicates the predicates to check, cloned, not null * @return the <code>all</code> predicate * @throws IllegalArgumentException if the predicates array is null * @throws IllegalArgumentException if any predicate in the array is null */ public static Predicate getInstance(Collection predicates) { Predicate[] preds = FunctorUtils.validate(predicates); if (preds.length == 0) { return TruePredicate.INSTANCE; } if (preds.length == 1) { return preds[0]; } return new AllPredicate(preds); }
/** * Create a new Predicate that returns true only if all of the specified * predicates are true. * If the array of predicates is empty, then this predicate returns true. * * @see org.apache.commons.collections.functors.AllPredicate * * @param predicates an array of predicates to check, may not be null * @return the <code>all</code> predicate * @throws IllegalArgumentException if the predicates array is null * @throws IllegalArgumentException if any predicate in the array is null */ public static Predicate allPredicate(Predicate[] predicates) { return AllPredicate.getInstance(predicates); }
/** * Factory to create the predicate. * <p> * If the collection is size zero, the predicate always returns true. * If the collection is size one, then that predicate is returned. * * @param predicates the predicates to check, cloned, not null * @return the <code>all</code> predicate * @throws IllegalArgumentException if the predicates array is null * @throws IllegalArgumentException if any predicate in the array is null */ public static Predicate getInstance(Collection predicates) { Predicate[] preds = FunctorUtils.validate(predicates); if (preds.length == 0) { return TruePredicate.INSTANCE; } if (preds.length == 1) { return preds[0]; } return new AllPredicate(preds); }
/** * Create a new Predicate that returns true only if all of the specified * predicates are true. The predicates are checked in iterator order. * If the collection of predicates is empty, then this predicate returns true. * * @see org.apache.commons.collections.functors.AllPredicate * * @param predicates a collection of predicates to check, may not be null * @return the <code>all</code> predicate * @throws IllegalArgumentException if the predicates collection is null * @throws IllegalArgumentException if any predicate in the collection is null */ public static Predicate allPredicate(Collection predicates) { return AllPredicate.getInstance(predicates); }
/** * Factory to create the predicate. * <p> * If the collection is size zero, the predicate always returns true. * If the collection is size one, then that predicate is returned. * * @param predicates the predicates to check, cloned, not null * @return the <code>all</code> predicate * @throws IllegalArgumentException if the predicates array is null * @throws IllegalArgumentException if any predicate in the array is null */ public static Predicate getInstance(Collection predicates) { Predicate[] preds = FunctorUtils.validate(predicates); if (preds.length == 0) { return TruePredicate.INSTANCE; } if (preds.length == 1) { return preds[0]; } return new AllPredicate(preds); }
/** * Create a new Predicate that returns true only if all of the specified * predicates are true. * If the array of predicates is empty, then this predicate returns true. * * @see org.apache.commons.collections.functors.AllPredicate * * @param predicates an array of predicates to check, may not be null * @return the <code>all</code> predicate * @throws IllegalArgumentException if the predicates array is null * @throws IllegalArgumentException if any predicate in the array is null */ public static Predicate allPredicate(Predicate[] predicates) { return AllPredicate.getInstance(predicates); }
/** * Factory to create the predicate. * <p> * If the collection is size zero, the predicate always returns true. * If the collection is size one, then that predicate is returned. * * @param predicates the predicates to check, cloned, not null * @return the <code>all</code> predicate * @throws IllegalArgumentException if the predicates array is null * @throws IllegalArgumentException if any predicate in the array is null */ public static Predicate getInstance(Collection predicates) { Predicate[] preds = FunctorUtils.validate(predicates); if (preds.length == 0) { return TruePredicate.INSTANCE; } if (preds.length == 1) { return preds[0]; } return new AllPredicate(preds); }
/** * Create a new Predicate that returns true only if all of the specified * predicates are true. The predicates are checked in iterator order. * If the collection of predicates is empty, then this predicate returns true. * * @see org.apache.commons.collections.functors.AllPredicate * * @param predicates a collection of predicates to check, may not be null * @return the <code>all</code> predicate * @throws IllegalArgumentException if the predicates collection is null * @throws IllegalArgumentException if any predicate in the collection is null */ public static Predicate allPredicate(Collection predicates) { return AllPredicate.getInstance(predicates); }
public static Predicate filterOnSchedule(final Date date) { return new AllPredicate(new Predicate[]{filterExecutionEnabled(true), filterByExecutionMode(ExecutionMode.ON_SCHEDULE), new Predicate() { @Override public boolean evaluate(Object o) { final Script script = (Script) o; return (script.getExecutionLast() == null) && script.getExecutionSchedule().before(date); } }}); }
/** * Create a new Predicate that returns true only if all of the specified * predicates are true. * If the array of predicates is empty, then this predicate returns true. * * @see org.apache.commons.collections.functors.AllPredicate * * @param predicates an array of predicates to check, may not be null * @return the <code>all</code> predicate * @throws IllegalArgumentException if the predicates array is null * @throws IllegalArgumentException if any predicate in the array is null */ public static Predicate allPredicate(Predicate[] predicates) { return AllPredicate.getInstance(predicates); }