public interface

Transformer

org.apache.commons.collections.Transformer
Known Indirect Subclasses

Class Overview

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 invokation, returning a constant, cloning and returning the string value.

Summary

Public Methods
abstract Object transform(Object input)
Transforms the input object (leaving it unchanged) into some output object.

Public Methods

public abstract Object transform (Object input)

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

Parameters
input the object to be transformed, should be left unchanged
Returns
  • a transformed object
Throws
ClassCastException (runtime) if the input is the wrong class
IllegalArgumentException (runtime) if the input is invalid
FunctorException (runtime) if the transform cannot be completed