/** * Create a new Predicate that returns true if any of the specified * predicates are true. * If the array of predicates is empty, then this predicate returns false. * * @see org.apache.commons.collections.functors.AnyPredicate * * @param predicates an array of predicates to check, may not be null * @return the <code>any</code> predicate * @throws IllegalArgumentException if the predicates array is null * @throws IllegalArgumentException if any predicate in the array is null */ public static Predicate anyPredicate(Predicate[] predicates) { return AnyPredicate.getInstance(predicates); }
/** * Factory to create the predicate. * <p> * If the collection is size zero, the predicate always returns false. * 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 FalsePredicate.INSTANCE; } if (preds.length == 1) { return preds[0]; } return new AnyPredicate(preds); }
/** * Create a new Predicate that returns true if any of the specified * predicates are true. The predicates are checked in iterator order. * If the collection of predicates is empty, then this predicate returns false. * * @see org.apache.commons.collections.functors.AnyPredicate * * @param predicates a collection of predicates to check, may not be null * @return the <code>any</code> predicate * @throws IllegalArgumentException if the predicates collection is null * @throws IllegalArgumentException if any predicate in the collection is null */ public static Predicate anyPredicate(Collection predicates) { return AnyPredicate.getInstance(predicates); }
/** * Factory to create the predicate. * <p> * If the collection is size zero, the predicate always returns false. * 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 FalsePredicate.INSTANCE; } if (preds.length == 1) { return preds[0]; } return new AnyPredicate(preds); }
/** * Create a new Predicate that returns true if any of the specified * predicates are true. * If the array of predicates is empty, then this predicate returns false. * * @see org.apache.commons.collections.functors.AnyPredicate * * @param predicates an array of predicates to check, may not be null * @return the <code>any</code> predicate * @throws IllegalArgumentException if the predicates array is null * @throws IllegalArgumentException if any predicate in the array is null */ public static Predicate anyPredicate(Predicate[] predicates) { return AnyPredicate.getInstance(predicates); }
/** * Factory to create the predicate. * <p> * If the array is size zero, the predicate always returns false. * If the array is size one, then that predicate is returned. * * @param predicates the predicates to check, cloned, not null * @return the <code>any</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 FalsePredicate.INSTANCE; } if (predicates.length == 1) { return predicates[0]; } return new AnyPredicate(FunctorUtils.copy(predicates)); }
/** * Create a new Predicate that returns true if any of the specified * predicates are true. The predicates are checked in iterator order. * If the collection of predicates is empty, then this predicate returns false. * * @see org.apache.commons.collections.functors.AnyPredicate * * @param predicates a collection of predicates to check, may not be null * @return the <code>any</code> predicate * @throws IllegalArgumentException if the predicates collection is null * @throws IllegalArgumentException if any predicate in the collection is null */ public static Predicate anyPredicate(Collection predicates) { return AnyPredicate.getInstance(predicates); }
/** * Factory to create the predicate. * <p> * If the array is size zero, the predicate always returns false. * If the array is size one, then that predicate is returned. * * @param predicates the predicates to check, cloned, not null * @return the <code>any</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 FalsePredicate.INSTANCE; } if (predicates.length == 1) { return predicates[0]; } return new AnyPredicate(FunctorUtils.copy(predicates)); }
/** * Create a new Predicate that returns true if any of the specified * predicates are true. The predicates are checked in iterator order. * If the collection of predicates is empty, then this predicate returns false. * * @see org.apache.commons.collections.functors.AnyPredicate * * @param predicates a collection of predicates to check, may not be null * @return the <code>any</code> predicate * @throws IllegalArgumentException if the predicates collection is null * @throws IllegalArgumentException if any predicate in the collection is null */ public static Predicate anyPredicate(Collection predicates) { return AnyPredicate.getInstance(predicates); }
/** * Factory to create the predicate. * <p> * If the collection is size zero, the predicate always returns false. * 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 FalsePredicate.INSTANCE; } if (preds.length == 1) { return preds[0]; } return new AnyPredicate(preds); }
/** * Create a new Predicate that returns true if any of the specified * predicates are true. * If the array of predicates is empty, then this predicate returns false. * * @see org.apache.commons.collections.functors.AnyPredicate * * @param predicates an array of predicates to check, may not be null * @return the <code>any</code> predicate * @throws IllegalArgumentException if the predicates array is null * @throws IllegalArgumentException if any predicate in the array is null */ public static Predicate anyPredicate(Predicate[] predicates) { return AnyPredicate.getInstance(predicates); }
/** * Factory to create the predicate. * <p> * If the collection is size zero, the predicate always returns false. * 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 FalsePredicate.INSTANCE; } if (preds.length == 1) { return preds[0]; } return new AnyPredicate(preds); }
/** * Create a new Predicate that returns true if any of the specified * predicates are true. The predicates are checked in iterator order. * If the collection of predicates is empty, then this predicate returns false. * * @see org.apache.commons.collections.functors.AnyPredicate * * @param predicates a collection of predicates to check, may not be null * @return the <code>any</code> predicate * @throws IllegalArgumentException if the predicates collection is null * @throws IllegalArgumentException if any predicate in the collection is null */ public static Predicate anyPredicate(Collection predicates) { return AnyPredicate.getInstance(predicates); }
/** * Factory to create the predicate. * <p> * If the collection is size zero, the predicate always returns false. * 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 FalsePredicate.INSTANCE; } if (preds.length == 1) { return preds[0]; } return new AnyPredicate(preds); }
/** * Create a new Predicate that returns true if any of the specified * predicates are true. * If the array of predicates is empty, then this predicate returns false. * * @see org.apache.commons.collections.functors.AnyPredicate * * @param predicates an array of predicates to check, may not be null * @return the <code>any</code> predicate * @throws IllegalArgumentException if the predicates array is null * @throws IllegalArgumentException if any predicate in the array is null */ public static Predicate anyPredicate(Predicate[] predicates) { return AnyPredicate.getInstance(predicates); }
/** * Factory to create the predicate. * <p> * If the collection is size zero, the predicate always returns false. * 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 FalsePredicate.INSTANCE; } if (preds.length == 1) { return preds[0]; } return new AnyPredicate(preds); }
/** * Create a new Predicate that returns true if any of the specified * predicates are true. * If the array of predicates is empty, then this predicate returns false. * * @see org.apache.commons.collections.functors.AnyPredicate * * @param predicates an array of predicates to check, may not be null * @return the <code>any</code> predicate * @throws IllegalArgumentException if the predicates array is null * @throws IllegalArgumentException if any predicate in the array is null */ public static Predicate anyPredicate(Predicate[] predicates) { return AnyPredicate.getInstance(predicates); }
/** * Factory to create the predicate. * <p> * If the collection is size zero, the predicate always returns false. * 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 FalsePredicate.INSTANCE; } if (preds.length == 1) { return preds[0]; } return new AnyPredicate(preds); }
/** * Create a new Predicate that returns true if any of the specified * predicates are true. The predicates are checked in iterator order. * If the collection of predicates is empty, then this predicate returns false. * * @see org.apache.commons.collections.functors.AnyPredicate * * @param predicates a collection of predicates to check, may not be null * @return the <code>any</code> predicate * @throws IllegalArgumentException if the predicates collection is null * @throws IllegalArgumentException if any predicate in the collection is null */ public static Predicate anyPredicate(Collection predicates) { return AnyPredicate.getInstance(predicates); }
/** * Factory to create the predicate. * <p> * If the array is size zero, the predicate always returns false. * If the array is size one, then that predicate is returned. * * @param predicates the predicates to check, cloned, not null * @return the <code>any</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 FalsePredicate.INSTANCE; } if (predicates.length == 1) { return predicates[0]; } return new AnyPredicate(FunctorUtils.copy(predicates)); }