public class ClosureTransformer<T> extends Objectimplements Transformer <T ,T>, Serializable
| Constructor and Description |
|---|
ClosureTransformer(Closure
Constructor that performs no validation.
|
| Modifier and Type | Method and Description |
|---|---|
static <T> Transformer |
closureTransformer(Closure
Factory method that performs validation.
|
Closure |
getClosure()
Gets the closure.
|
T |
transform(T input)
Transforms the input to result by executing a closure.
|
public static <T> Transformer<T ,T> closureTransformer(Closure <? super T> closure)
T - the type of the object to transform
closure - the closure to call, not null
closure transformer
NullPointerException - if the closure is null
public T transform(T input)
transform in interface
Transformer<T,T>
input - the input object to transform