/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
public static Predicate filterOnModify(final ResourceResolver resolver) { return new AllPredicate(new Predicate[]{filterExecutionEnabled(true), filterByExecutionMode(ExecutionMode.ON_MODIFY), new Predicate() { @Override public boolean evaluate(Object o) { return ((Script) o).isContentModified(resolver); } }}); }
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); } }}); }
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); } }}); }
public static Predicate filterOnModify(final ResourceResolver resolver) { return new AllPredicate(new Predicate[]{filterExecutionEnabled(true), filterByExecutionMode(ExecutionMode.ON_MODIFY), new Predicate() { @Override public boolean evaluate(Object o) { return ((Script) o).isContentModified(resolver); } }}); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }
public static Predicate filterOnStart(final ResourceResolver resolver) { return new AllPredicate(new Predicate[]{filterExecutionEnabled(true), new OrPredicate(filterByExecutionMode(ExecutionMode.ON_START), filterOnModify(resolver))}); } }
public static Predicate filterOnStart(final ResourceResolver resolver) { return new AllPredicate(new Predicate[]{filterExecutionEnabled(true), new OrPredicate(filterByExecutionMode(ExecutionMode.ON_START), filterOnModify(resolver))}); } }