Package org.apache.commons.collections4
Interface Transformer<T,R>
-
- Type Parameters:
T- the type of the input to the function.R- the type of the result of the function.
- All Superinterfaces:
java.util.function.Function<T,R>
- All Known Implementing Classes:
ChainedTransformer,CloneTransformer,ClosureTransformer,ConstantTransformer,ExceptionTransformer,FactoryTransformer,IfTransformer,InstantiateTransformer,InvokerTransformer,MapTransformer,NOPTransformer,PredicateTransformer,StringValueTransformer,SwitchTransformer
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@Deprecated @FunctionalInterface public interface Transformer<T,R> extends java.util.function.Function<T,R>
Deprecated.UseFunction.Defines a functor interface implemented by classes that transform one object into another.A
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.- Since:
- 1.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default Rapply(T t)Deprecated.Rtransform(T input)Deprecated.Transforms the input object into some output object.
-
-
-
Method Detail
-
transform
R transform(T input)
Deprecated.Transforms the input object into some output object.The input object SHOULD be left unchanged.
- Parameters:
input- the object to be transformed, should be left unchanged- Returns:
- a transformed object
- Throws:
java.lang.ClassCastException- (runtime) if the input is the wrong classjava.lang.IllegalArgumentException- (runtime) if the input is invalidFunctorException- (runtime) if the transform cannot be completed
-
-