/** * Create a new Closure that calls each closure in turn, passing the * result into the next closure. * * @see org.apache.commons.collections4.functors.ChainedClosure * * @param <E> the type that the closure acts on * @param closures an array of closures to chain * @return the <code>chained</code> closure * @throws NullPointerException if the closures array is null * @throws NullPointerException if any closure in the array is null */ public static <E> Closure<E> chainedClosure(final Closure<? super E>... closures) { return ChainedClosure.chainedClosure(closures); }
/** * Create a new Closure that calls each closure in turn, passing the * result into the next closure. The ordering is that of the iterator() * method on the collection. * * @see org.apache.commons.collections4.functors.ChainedClosure * * @param <E> the type that the closure acts on * @param closures a collection of closures to chain * @return the <code>chained</code> closure * @throws NullPointerException if the closures collection is null * @throws NullPointerException if any closure in the collection is null * @throws IllegalArgumentException if the closures collection is empty */ public static <E> Closure<E> chainedClosure(final Collection<? extends Closure<? super E>> closures) { return ChainedClosure.chainedClosure(closures); }