Class TransformerClosure<E>
java.lang.Object
org.apache.commons.collections4.functors.TransformerClosure<E>
- All Implemented Interfaces:
Serializable
,Consumer<E>
,Closure<E>
Closure implementation that calls a Transformer using the input object
and ignore the result.
- Since:
- 3.0
- See Also:
-
Constructor Summary
ConstructorDescriptionTransformerClosure
(Transformer<? super E, ?> transformer) Constructor that performs no validation. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Executes the closure by calling the decorated transformer.Transformer<? super E,
?> Gets the transformer.static <E> Closure<E>
transformerClosure
(Transformer<? super E, ?> transformer) Factory method that performs validation.
-
Constructor Details
-
TransformerClosure
Constructor that performs no validation. UsetransformerClosure
if you want that.- Parameters:
transformer
- the transformer to call, not null
-
-
Method Details
-
transformerClosure
Factory method that performs validation.A null transformer will return the
NOPClosure
.- Type Parameters:
E
- the type that the closure acts on- Parameters:
transformer
- the transformer to call, null means nop- Returns:
- the
transformer
closure
-
execute
Executes the closure by calling the decorated transformer. -
getTransformer
Gets the transformer.- Returns:
- the transformer
- Since:
- 3.1
-