- Type Parameters:
I- the input type to the transformer
O- the output type from the transformer
- All Known Implementing Classes:
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface Transformer<I,O>Defines a functor interface implemented by classes that transform one object into another.
Transformerconverts the input object to the output object. The input object should be left unchanged. Transformers are typically used for type conversions, or extracting data from an object.
Standard implementations of common transformers are provided by
TransformerUtils. These include method invocation, returning a constant, cloning and returning the string value.
transformTransforms the input object (leaving it unchanged) into some output object.
input- the object to be transformed, should be left unchanged
- a transformed object
ClassCastException- (runtime) if the input is the wrong class
IllegalArgumentException- (runtime) if the input is invalid
FunctorException- (runtime) if the transform cannot be completed