/** * Factory method that performs validation. * <p> * This factory creates a closure that performs no action when * the predicate is false. * * @param predicate predicate to switch on * @param trueClosure closure used if true * @return the <code>if</code> closure * @throws IllegalArgumentException if either argument is null * @since Commons Collections 3.2 */ public static Closure getInstance(Predicate predicate, Closure trueClosure) { return getInstance(predicate, trueClosure, NOPClosure.INSTANCE); }
/** * Factory method that performs validation. * * @param predicate predicate to switch on * @param trueClosure closure used if true * @param falseClosure closure used if false * @return the <code>if</code> closure * @throws IllegalArgumentException if any argument is null */ public static Closure getInstance(Predicate predicate, Closure trueClosure, Closure falseClosure) { if (predicate == null) { throw new IllegalArgumentException("Predicate must not be null"); } if (trueClosure == null || falseClosure == null) { throw new IllegalArgumentException("Closures must not be null"); } return new IfClosure(predicate, trueClosure, falseClosure); }
/** * Create a new Closure that calls one of two closures depending * on the specified predicate. * * @see org.apache.commons.collections.functors.IfClosure * * @param predicate the predicate to switch on * @param trueClosure the closure called if the predicate is true * @param falseClosure the closure called if the predicate is false * @return the <code>switch</code> closure * @throws IllegalArgumentException if the predicate is null * @throws IllegalArgumentException if either closure is null */ public static Closure ifClosure(Predicate predicate, Closure trueClosure, Closure falseClosure) { return IfClosure.getInstance(predicate, trueClosure, falseClosure); }
/** * Factory method that performs validation. * * @param predicate predicate to switch on * @param trueClosure closure used if true * @param falseClosure closure used if false * @return the <code>if</code> closure * @throws IllegalArgumentException if any argument is null */ public static Closure getInstance(Predicate predicate, Closure trueClosure, Closure falseClosure) { if (predicate == null) { throw new IllegalArgumentException("Predicate must not be null"); } if (trueClosure == null || falseClosure == null) { throw new IllegalArgumentException("Closures must not be null"); } return new IfClosure(predicate, trueClosure, falseClosure); }
/** * Create a new Closure that calls another closure based on the * result of the specified predicate. * * @see org.apache.commons.collections.functors.IfClosure * * @param predicate the validating predicate * @param trueClosure the closure called if the predicate is true * @return the <code>if</code> closure * @throws IllegalArgumentException if the predicate is null * @throws IllegalArgumentException if the closure is null * @since Commons Collections 3.2 */ public static Closure ifClosure(Predicate predicate, Closure trueClosure) { return IfClosure.getInstance(predicate, trueClosure); }
/** * Factory method that performs validation. * * @param predicate predicate to switch on * @param trueClosure closure used if true * @param falseClosure closure used if false * @return the <code>if</code> closure * @throws IllegalArgumentException if any argument is null */ public static Closure getInstance(Predicate predicate, Closure trueClosure, Closure falseClosure) { if (predicate == null) { throw new IllegalArgumentException("Predicate must not be null"); } if (trueClosure == null || falseClosure == null) { throw new IllegalArgumentException("Closures must not be null"); } return new IfClosure(predicate, trueClosure, falseClosure); }
/** * Create a new Closure that calls one of two closures depending * on the specified predicate. * * @see org.apache.commons.collections.functors.IfClosure * * @param predicate the predicate to switch on * @param trueClosure the closure called if the predicate is true * @param falseClosure the closure called if the predicate is false * @return the <code>switch</code> closure * @throws IllegalArgumentException if the predicate is null * @throws IllegalArgumentException if either closure is null */ public static Closure ifClosure(Predicate predicate, Closure trueClosure, Closure falseClosure) { return IfClosure.getInstance(predicate, trueClosure, falseClosure); }
/** * Factory method that performs validation. * * @param predicate predicate to switch on * @param trueClosure closure used if true * @param falseClosure closure used if false * @return the <code>if</code> closure * @throws IllegalArgumentException if any argument is null */ public static Closure getInstance(Predicate predicate, Closure trueClosure, Closure falseClosure) { if (predicate == null) { throw new IllegalArgumentException("Predicate must not be null"); } if (trueClosure == null || falseClosure == null) { throw new IllegalArgumentException("Closures must not be null"); } return new IfClosure(predicate, trueClosure, falseClosure); }
/** * Create a new Closure that calls another closure based on the * result of the specified predicate. * * @see org.apache.commons.collections.functors.IfClosure * * @param predicate the validating predicate * @param trueClosure the closure called if the predicate is true * @return the <code>if</code> closure * @throws IllegalArgumentException if the predicate is null * @throws IllegalArgumentException if the closure is null * @since Commons Collections 3.2 */ public static Closure ifClosure(Predicate predicate, Closure trueClosure) { return IfClosure.getInstance(predicate, trueClosure); }
/** * Factory method that performs validation. * * @param predicate predicate to switch on * @param trueClosure closure used if true * @param falseClosure closure used if false * @return the <code>if</code> closure * @throws IllegalArgumentException if any argument is null */ public static Closure getInstance(Predicate predicate, Closure trueClosure, Closure falseClosure) { if (predicate == null) { throw new IllegalArgumentException("Predicate must not be null"); } if (trueClosure == null || falseClosure == null) { throw new IllegalArgumentException("Closures must not be null"); } return new IfClosure(predicate, trueClosure, falseClosure); }
/** * Factory method that performs validation. * <p> * This factory creates a closure that performs no action when * the predicate is false. * * @param predicate predicate to switch on * @param trueClosure closure used if true * @return the <code>if</code> closure * @throws IllegalArgumentException if either argument is null * @since Commons Collections 3.2 */ public static Closure getInstance(Predicate predicate, Closure trueClosure) { return getInstance(predicate, trueClosure, NOPClosure.INSTANCE); }
/** * Factory method that performs validation. * * @param predicate predicate to switch on * @param trueClosure closure used if true * @param falseClosure closure used if false * @return the <code>if</code> closure * @throws IllegalArgumentException if any argument is null */ public static Closure getInstance(Predicate predicate, Closure trueClosure, Closure falseClosure) { if (predicate == null) { throw new IllegalArgumentException("Predicate must not be null"); } if (trueClosure == null || falseClosure == null) { throw new IllegalArgumentException("Closures must not be null"); } return new IfClosure(predicate, trueClosure, falseClosure); }
/** * Factory method that performs validation. * <p> * This factory creates a closure that performs no action when * the predicate is false. * * @param predicate predicate to switch on * @param trueClosure closure used if true * @return the <code>if</code> closure * @throws IllegalArgumentException if either argument is null * @since Commons Collections 3.2 */ public static Closure getInstance(Predicate predicate, Closure trueClosure) { return getInstance(predicate, trueClosure, NOPClosure.INSTANCE); }
/** * Factory method that performs validation. * * @param predicate predicate to switch on * @param trueClosure closure used if true * @param falseClosure closure used if false * @return the <code>if</code> closure * @throws IllegalArgumentException if any argument is null */ public static Closure getInstance(Predicate predicate, Closure trueClosure, Closure falseClosure) { if (predicate == null) { throw new IllegalArgumentException("Predicate must not be null"); } if (trueClosure == null || falseClosure == null) { throw new IllegalArgumentException("Closures must not be null"); } return new IfClosure(predicate, trueClosure, falseClosure); }
/** * Factory method that performs validation. * <p> * This factory creates a closure that performs no action when * the predicate is false. * * @param predicate predicate to switch on * @param trueClosure closure used if true * @return the <code>if</code> closure * @throws IllegalArgumentException if either argument is null * @since Commons Collections 3.2 */ public static Closure getInstance(Predicate predicate, Closure trueClosure) { return getInstance(predicate, trueClosure, NOPClosure.INSTANCE); }
/** * Factory method that performs validation. * <p> * This factory creates a closure that performs no action when * the predicate is false. * * @param predicate predicate to switch on * @param trueClosure closure used if true * @return the <code>if</code> closure * @throws IllegalArgumentException if either argument is null * @since Commons Collections 3.2 */ public static Closure getInstance(Predicate predicate, Closure trueClosure) { return getInstance(predicate, trueClosure, NOPClosure.INSTANCE); }
/** * Create a new Closure that calls another closure based on the * result of the specified predicate. * * @see org.apache.commons.collections.functors.IfClosure * * @param predicate the validating predicate * @param trueClosure the closure called if the predicate is true * @return the <code>if</code> closure * @throws IllegalArgumentException if the predicate is null * @throws IllegalArgumentException if the closure is null * @since Commons Collections 3.2 */ public static Closure ifClosure(Predicate predicate, Closure trueClosure) { return IfClosure.getInstance(predicate, trueClosure); }
/** * Create a new Closure that calls one of two closures depending * on the specified predicate. * * @see org.apache.commons.collections.functors.IfClosure * * @param predicate the predicate to switch on * @param trueClosure the closure called if the predicate is true * @param falseClosure the closure called if the predicate is false * @return the <code>switch</code> closure * @throws IllegalArgumentException if the predicate is null * @throws IllegalArgumentException if either closure is null */ public static Closure ifClosure(Predicate predicate, Closure trueClosure, Closure falseClosure) { return IfClosure.getInstance(predicate, trueClosure, falseClosure); }
/** * Create a new Closure that calls another closure based on the * result of the specified predicate. * * @see org.apache.commons.collections.functors.IfClosure * * @param predicate the validating predicate * @param trueClosure the closure called if the predicate is true * @return the <code>if</code> closure * @throws IllegalArgumentException if the predicate is null * @throws IllegalArgumentException if the closure is null * @since Commons Collections 3.2 */ public static Closure ifClosure(Predicate predicate, Closure trueClosure) { return IfClosure.getInstance(predicate, trueClosure); }
/** * Factory method that performs validation. * <p> * This factory creates a closure that performs no action when * the predicate is false. * * @param predicate predicate to switch on * @param trueClosure closure used if true * @return the <code>if</code> closure * @throws IllegalArgumentException if either argument is null * @since Commons Collections 3.2 */ public static Closure getInstance(Predicate predicate, Closure trueClosure) { return getInstance(predicate, trueClosure, NOPClosure.INSTANCE); }