public class ChainedClosure<E> extends Object implements Closure<E>, Serializable
Constructor and Description |
---|
ChainedClosure(Closure<? super E>... closures)
Constructor that performs no validation.
|
Modifier and Type | Method and Description |
---|---|
static <E> Closure<E> |
chainedClosure(Closure<? super E>... closures)
Factory method that performs validation and copies the parameter array.
|
static <E> Closure<E> |
chainedClosure(Collection<? extends Closure<? super E>> closures)
Create a new Closure that calls each closure in turn, passing the
result into the next closure.
|
void |
execute(E input)
Execute a list of closures.
|
Closure<? super E>[] |
getClosures()
Gets the closures.
|
public ChainedClosure(Closure<? super E>... closures)
chainedClosure
if you want that.closures
- the closures to chain, copied, no nullspublic static <E> Closure<E> chainedClosure(Closure<? super E>... closures)
E
- the type that the closure acts onclosures
- the closures to chain, copied, no nullschained
closureNullPointerException
- if the closures array is nullNullPointerException
- if any closure in the array is nullpublic static <E> Closure<E> chainedClosure(Collection<? extends Closure<? super E>> closures)
E
- the type that the closure acts onclosures
- a collection of closures to chainchained
closureNullPointerException
- if the closures collection is nullNullPointerException
- if any closure in the collection is nullpublic Closure<? super E>[] getClosures()
Copyright © 2001–2018 The Apache Software Foundation. All rights reserved.