java.io.Serializable
, Transformer<T,T>
public class ClosureTransformer<T> extends java.lang.Object implements Transformer<T,T>, java.io.Serializable
Constructor | Description |
---|---|
ClosureTransformer(Closure<? super T> closure) |
Constructor that performs no validation.
|
Modifier and Type | Method | Description |
---|---|---|
static <T> Transformer<T,T> |
closureTransformer(Closure<? super T> closure) |
Factory method that performs validation.
|
Closure<? super T> |
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 transformclosure
- the closure to call, not nullclosure
transformerjava.lang.NullPointerException
- if the closure is nullpublic T transform(T input)
transform
in interface Transformer<T,T>
input
- the input object to transformCopyright © 2001-2019 - Apache Software Foundation