T
- the type of the closure parameterpublic final class ConsumerClosure<T>
extends groovy.lang.Closure<java.lang.Void>
Closure
which calls a given Consumer
function with
a passed parameter and returns no value.
It it required that the Consumer
function is serializable. See ConsumerClosure.Action
for
a serializable consumer.
Modifier and Type | Class and Description |
---|---|
static interface |
ConsumerClosure.Action<T>
An action to execute upon the closure argument.
|
Modifier and Type | Method and Description |
---|---|
static <T> ConsumerClosure<T> |
closure(ConsumerClosure.Action<? super T> action)
Creates a new closure with the given action.
|
asWritable, call, call, call, clone, curry, curry, dehydrate, getDelegate, getDirective, getMaximumNumberOfParameters, getOwner, getParameterTypes, getProperty, getResolveStrategy, getThisObject, isCase, leftShift, leftShift, memoize, memoizeAtLeast, memoizeAtMost, memoizeBetween, ncurry, ncurry, rcurry, rcurry, rehydrate, rightShift, run, setDelegate, setDirective, setProperty, setResolveStrategy, throwRuntimeException, trampoline, trampoline
public static <T> ConsumerClosure<T> closure(ConsumerClosure.Action<? super T> action)
T
- the type of the closure argumentaction
- the action to execute upon the closure argument