Class ChainedTransformer
java.lang.Object
org.apache.commons.collections.functors.ChainedTransformer
- All Implemented Interfaces:
Serializable,Transformer
@Deprecated(since="2021-04-30")
public class ChainedTransformer
extends Object
implements Transformer, Serializable
Deprecated.
Apache Commons Collections version 3.x is being deprecated from AEMaaCS. The upgraded version 4.4 of Commons Collections is already included as replacement. Customers are advised to upgrade to this version of the library. Please note: the package name was changed to org.apache.commons.collections4. Further note that there are AEM APIs currently exposing the old collections classes; these will be updated in upcoming releases.
Transformer implementation that chains the specified transformers together.
The input object is passed to the first transformer. The transformed result is passed to the second transformer and so on.
- Since:
- Commons Collections 3.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionChainedTransformer(Transformer[] transformers) Deprecated.Constructor that performs no validation. -
Method Summary
Modifier and TypeMethodDescriptionstatic TransformergetInstance(Collection transformers) Deprecated.Create a new Transformer that calls each transformer in turn, passing the result into the next transformer.static TransformergetInstance(Transformer[] transformers) Deprecated.Factory method that performs validation and copies the parameter array.static TransformergetInstance(Transformer transformer1, Transformer transformer2) Deprecated.Factory method that performs validation.Deprecated.Gets the transformers, do not modify the array.Deprecated.Transforms the input to result via each decorated transformer
-
Constructor Details
-
ChainedTransformer
Deprecated.Constructor that performs no validation. UsegetInstanceif you want that.- Parameters:
transformers- the transformers to chain, not copied, no nulls
-
-
Method Details
-
getInstance
Deprecated.Factory method that performs validation and copies the parameter array.- Parameters:
transformers- the transformers to chain, copied, no nulls- Returns:
- the
chainedtransformer - Throws:
IllegalArgumentException- if the transformers array is nullIllegalArgumentException- if any transformer in the array is null
-
getInstance
Deprecated.Create a new Transformer that calls each transformer in turn, passing the result into the next transformer. The ordering is that of the iterator() method on the collection.- Parameters:
transformers- a collection of transformers to chain- Returns:
- the
chainedtransformer - Throws:
IllegalArgumentException- if the transformers collection is nullIllegalArgumentException- if any transformer in the collection is null
-
getInstance
Deprecated.Factory method that performs validation.- Parameters:
transformer1- the first transformer, not nulltransformer2- the second transformer, not null- Returns:
- the
chainedtransformer - Throws:
IllegalArgumentException- if either transformer is null
-
transform
Deprecated.Transforms the input to result via each decorated transformer- Specified by:
transformin interfaceTransformer- Parameters:
object- the input object passed to the first transformer- Returns:
- the transformed result
-
getTransformers
Deprecated.Gets the transformers, do not modify the array.- Returns:
- the transformers
- Since:
- Commons Collections 3.1
-