/** * 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. * * @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. * * @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. * * @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. * * @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. * * @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. * * @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); }