public class ChainedClosure<E> extends java.lang.Object implements Closure<E>, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
private Closure<? super E>[] |
iClosures
The closures to call in turn
|
private static long |
serialVersionUID
Serial version UID
|
Modifier | Constructor and Description |
---|---|
private |
ChainedClosure(boolean clone,
Closure<? super E>... closures)
Hidden constructor for the use by the static factory methods.
|
|
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(java.util.Collection<Closure<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.
|
private static final long serialVersionUID
private ChainedClosure(boolean clone, Closure<? super E>... closures)
clone
- if true
the input argument will be clonedclosures
- the closures to chain, 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
closurejava.lang.IllegalArgumentException
- if the closures array is nulljava.lang.IllegalArgumentException
- if any closure in the array is nullpublic static <E> Closure<E> chainedClosure(java.util.Collection<Closure<E>> closures)
E
- the type that the closure acts onclosures
- a collection of closures to chainchained
closurejava.lang.IllegalArgumentException
- if the closures collection is nulljava.lang.IllegalArgumentException
- if any closure in the collection is nullpublic void execute(E input)