Class ChainedTransformer
- java.lang.Object
-
- org.apache.commons.collections.functors.ChainedTransformer
-
- All Implemented Interfaces:
java.io.Serializable
,Transformer
@Deprecated public class ChainedTransformer extends java.lang.Object implements Transformer, java.io.Serializable
Deprecated.Please use Apache Commons Collections 4 instead.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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ChainedTransformer(Transformer[] transformers)
Deprecated.Constructor that performs no validation.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static Transformer
getInstance(java.util.Collection transformers)
Deprecated.Create a new Transformer that calls each transformer in turn, passing the result into the next transformer.static Transformer
getInstance(Transformer[] transformers)
Deprecated.Factory method that performs validation and copies the parameter array.static Transformer
getInstance(Transformer transformer1, Transformer transformer2)
Deprecated.Factory method that performs validation.Transformer[]
getTransformers()
Deprecated.Gets the transformers, do not modify the array.java.lang.Object
transform(java.lang.Object object)
Deprecated.Transforms the input to result via each decorated transformer
-
-
-
Constructor Detail
-
ChainedTransformer
public ChainedTransformer(Transformer[] transformers)
Deprecated.Constructor that performs no validation. UsegetInstance
if you want that.- Parameters:
transformers
- the transformers to chain, not copied, no nulls
-
-
Method Detail
-
getInstance
public static Transformer getInstance(Transformer[] transformers)
Deprecated.Factory method that performs validation and copies the parameter array.- Parameters:
transformers
- the transformers to chain, copied, no nulls- Returns:
- the
chained
transformer - Throws:
java.lang.IllegalArgumentException
- if the transformers array is nulljava.lang.IllegalArgumentException
- if any transformer in the array is null
-
getInstance
public static Transformer getInstance(java.util.Collection transformers)
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
chained
transformer - Throws:
java.lang.IllegalArgumentException
- if the transformers collection is nulljava.lang.IllegalArgumentException
- if any transformer in the collection is null
-
getInstance
public static Transformer getInstance(Transformer transformer1, Transformer transformer2)
Deprecated.Factory method that performs validation.- Parameters:
transformer1
- the first transformer, not nulltransformer2
- the second transformer, not null- Returns:
- the
chained
transformer - Throws:
java.lang.IllegalArgumentException
- if either transformer is null
-
transform
public java.lang.Object transform(java.lang.Object object)
Deprecated.Transforms the input to result via each decorated transformer- Specified by:
transform
in interfaceTransformer
- Parameters:
object
- the input object passed to the first transformer- Returns:
- the transformed result
-
getTransformers
public Transformer[] getTransformers()
Deprecated.Gets the transformers, do not modify the array.- Returns:
- the transformers
- Since:
- Commons Collections 3.1
-
-