/** * Factory method that performs validation. * * @param predicate the predicate used to evaluate when the loop terminates, not null * @param closure the closure the execute, not null * @param doLoop true to act as a do-while loop, always executing the closure once * @return the <code>while</code> closure * @throws IllegalArgumentException if the predicate or closure is null */ public static Closure getInstance(Predicate predicate, Closure closure, boolean doLoop) { if (predicate == null) { throw new IllegalArgumentException("Predicate must not be null"); } if (closure == null) { throw new IllegalArgumentException("Closure must not be null"); } return new WhileClosure(predicate, closure, doLoop); }
public Object makeObject() { return new WhileClosure(FalsePredicate.INSTANCE, NOPClosure.INSTANCE, true); }
/** * Factory method that performs validation. * * @param predicate the predicate used to evaluate when the loop terminates, not null * @param closure the closure the execute, not null * @param doLoop true to act as a do-while loop, always executing the closure once * @return the <code>while</code> closure * @throws IllegalArgumentException if the predicate or closure is null */ public static Closure getInstance(Predicate predicate, Closure closure, boolean doLoop) { if (predicate == null) { throw new IllegalArgumentException("Predicate must not be null"); } if (closure == null) { throw new IllegalArgumentException("Closure must not be null"); } return new WhileClosure(predicate, closure, doLoop); }
/** * Factory method that performs validation. * * @param predicate the predicate used to evaluate when the loop terminates, not null * @param closure the closure the execute, not null * @param doLoop true to act as a do-while loop, always executing the closure once * @return the <code>while</code> closure * @throws IllegalArgumentException if the predicate or closure is null */ public static Closure getInstance(Predicate predicate, Closure closure, boolean doLoop) { if (predicate == null) { throw new IllegalArgumentException("Predicate must not be null"); } if (closure == null) { throw new IllegalArgumentException("Closure must not be null"); } return new WhileClosure(predicate, closure, doLoop); }
/** * Factory method that performs validation. * * @param predicate the predicate used to evaluate when the loop terminates, not null * @param closure the closure the execute, not null * @param doLoop true to act as a do-while loop, always executing the closure once * @return the <code>while</code> closure * @throws IllegalArgumentException if the predicate or closure is null */ public static Closure getInstance(Predicate predicate, Closure closure, boolean doLoop) { if (predicate == null) { throw new IllegalArgumentException("Predicate must not be null"); } if (closure == null) { throw new IllegalArgumentException("Closure must not be null"); } return new WhileClosure(predicate, closure, doLoop); }
/** * Factory method that performs validation. * * @param predicate the predicate used to evaluate when the loop terminates, not null * @param closure the closure the execute, not null * @param doLoop true to act as a do-while loop, always executing the closure once * @return the <code>while</code> closure * @throws IllegalArgumentException if the predicate or closure is null */ public static Closure getInstance(Predicate predicate, Closure closure, boolean doLoop) { if (predicate == null) { throw new IllegalArgumentException("Predicate must not be null"); } if (closure == null) { throw new IllegalArgumentException("Closure must not be null"); } return new WhileClosure(predicate, closure, doLoop); }
/** * Factory method that performs validation. * * @param predicate the predicate used to evaluate when the loop terminates, not null * @param closure the closure the execute, not null * @param doLoop true to act as a do-while loop, always executing the closure once * @return the <code>while</code> closure * @throws IllegalArgumentException if the predicate or closure is null */ public static Closure getInstance(Predicate predicate, Closure closure, boolean doLoop) { if (predicate == null) { throw new IllegalArgumentException("Predicate must not be null"); } if (closure == null) { throw new IllegalArgumentException("Closure must not be null"); } return new WhileClosure(predicate, closure, doLoop); }
/** * Factory method that performs validation. * * @param predicate the predicate used to evaluate when the loop terminates, not null * @param closure the closure the execute, not null * @param doLoop true to act as a do-while loop, always executing the closure once * @return the <code>while</code> closure * @throws IllegalArgumentException if the predicate or closure is null */ public static Closure getInstance(Predicate predicate, Closure closure, boolean doLoop) { if (predicate == null) { throw new IllegalArgumentException("Predicate must not be null"); } if (closure == null) { throw new IllegalArgumentException("Closure must not be null"); } return new WhileClosure(predicate, closure, doLoop); }