Top Description Methods
org.apache.commons.collections4

public Interface Transformer<I, O>

Known Direct Implementers
org.apache.commons.collections4.functors.ChainedTransformer, org.apache.commons.collections4.functors.CloneTransformer, org.apache.commons.collections4.functors.ClosureTransformer, org.apache.commons.collections4.functors.ConstantTransformer, org.apache.commons.collections4.functors.ExceptionTransformer, org.apache.commons.collections4.functors.FactoryTransformer, org.apache.commons.collections4.functors.IfTransformer, org.apache.commons.collections4.functors.InstantiateTransformer, org.apache.commons.collections4.functors.InvokerTransformer, org.apache.commons.collections4.functors.MapTransformer, org.apache.commons.collections4.functors.NOPTransformer, org.apache.commons.collections4.functors.PredicateTransformer, org.apache.commons.collections4.functors.StringValueTransformer, org.apache.commons.collections4.functors.SwitchTransformer, org.apache.commons.collections4.multimap.AbstractMultiValuedMap.KeysMultiSet.MapEntryTransformer
Annotations
@FunctionalInterface
Type Parameters
<I>
the input type to the transformer
<O>
the output type from the transformer

Defines a functor interface implemented by classes that transform one object into another.

A Transformer converts 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

Modifier and TypeMethod and Description
public O

Returns:

a transformed object
transform
(I
the object to be transformed, should be left unchanged
input
)

Transforms the input object (leaving it unchanged) into some output object.

Method Detail

transformback to summary
public O transform(I input)

Transforms the input object (leaving it unchanged) into some output object.

Parameters
input:I

the object to be transformed, should be left unchanged

Returns:O

a transformed object

Exceptions
ClassCastException:
(runtime) if the input is the wrong class
IllegalArgumentException:
(runtime) if the input is invalid
FunctorException:
(runtime) if the transform cannot be completed