⇒ Index (Frames) |  ⇒ Index (No Frames) |  ⇒ Package |  ⇒ Package Tree |  ⇒ Full Tree 
org.apache.commons.collections.functors

Class PredicateTransformer

java.lang.Object
|
+--org.apache.commons.collections.functors.PredicateTransformer

All Implemented Interfaces:
Transformer, Serializable


public class PredicateTransformer
extends java.lang.Object
implements Transformer, Serializable

Transformer implementation that calls a Predicate using the input object and then returns the input.
Since:
Commons Collections 3.0
Author:
Stephen Colebourne

Constructor Summary

PredicateTransformer(Predicate predicate)

Constructor that performs no validation.

Method Summary

static Transformer

getInstance(Predicate predicate)

Factory method that performs validation.

Object

transform(Object input)

Call the predicate.

Constructor Details

PredicateTransformer

public PredicateTransformer(Predicate predicate)

Constructor that performs no validation. Use getInstance if you want that.

Parameters:
predicate - the predicate to call, not null

Method Details

getInstance

public static Transformer getInstance(Predicate predicate)

Factory method that performs validation.

Parameters:
predicate - the predicate to call, not null
Returns:
the predicate transformer
Throws:
- if the predicate is null

transform

public Object transform(Object input)

Call the predicate.

Parameters:
input