Class ClosureTransformer<T>
java.lang.Object
org.apache.commons.collections4.functors.ClosureTransformer<T>
- All Implemented Interfaces:
Serializable, Transformer<T,T>
Transformer implementation that calls a Closure using the input object
and then returns the input.
- Since:
- 3.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe closure to wrapprivate static final longSerial version UID -
Constructor Summary
ConstructorsConstructorDescriptionClosureTransformer(Closure<? super T> closure) Constructor that performs no validation. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Transformer<T, T> closureTransformer(Closure<? super T> closure) Factory method that performs validation.Gets the closure.Transforms the input to result by executing a closure.
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerial version UID- See Also:
-
iClosure
-
-
Constructor Details
-
ClosureTransformer
-
-
Method Details
-
closureTransformer
Factory method that performs validation.- Type Parameters:
T- the type of the object to transform- Parameters:
closure- the closure to call, not null- Returns:
- the
closuretransformer - Throws:
NullPointerException- if the closure is null
-
transform
-
getClosure
-