Top Description Fields Constructors Methods
org.apache.commons.collections4.functors

public final Class TransformedPredicate<T>

extends Object
implements PredicateDecorator<T>, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, org.apache.commons.collections4.functors.PredicateDecorator, org.apache.commons.collections4.Predicate
Imports
java.io.Serializable, org.apache.commons.collections4.Predicate, .Transformer

Predicate implementation that transforms the given object before invoking another Predicate.
Since
3.1

Field Summary

Modifier and TypeField and Description
private final Predicate<? super T>
iPredicate

The predicate to call

private final Transformer<? super T, ? extends T>
iTransformer

The transformer to call

private static final long
serialVersionUID

Serial version UID

Constructor Summary

AccessConstructor and Description
public
TransformedPredicate(final Transformer<? super T, ? extends T>
the transformer to use
transformer
,
final Predicate<? super T>
the predicate to decorate
predicate
)

Constructor that performs no validation.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if decorated predicate returns true
evaluate
(final T
the input object which will be transformed
object
)

Implements org.apache.commons.collections4.Predicate.evaluate.

Evaluates the predicate returning the result of the decorated predicate once the input has been transformed
public Predicate<? super T>[]

Returns:

the predicate as the only element in an array
getPredicates
()

Implements org.apache.commons.collections4.functors.PredicateDecorator.getPredicates.

Gets the predicate being decorated.
public Transformer<? super T, ? extends T>

Returns:

the transformer
getTransformer
()

Gets the transformer in use.

public static <
the type that the predicate queries
T
>
Predicate<T>

Returns:

the predicate
transformedPredicate
(final Transformer<? super T, ? extends T>
the transformer to call
transformer
,
final Predicate<? super T>
the predicate to call with the result of the transform
predicate
)

Factory to create the predicate.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

iPredicateback to summary
private final Predicate<? super T> iPredicate

The predicate to call

iTransformerback to summary
private final Transformer<? super T, ? extends T> iTransformer

The transformer to call

serialVersionUIDback to summary
private static final long serialVersionUID

Serial version UID

Constructor Detail

TransformedPredicateback to summary
public TransformedPredicate(final Transformer<? super T, ? extends T> transformer, final Predicate<? super T> predicate)

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

Parameters
transformer:Transformer<? super T, ? extends T>

the transformer to use

predicate:Predicate<? super T>

the predicate to decorate

Method Detail

evaluateback to summary
public boolean evaluate(final T object)

Implements org.apache.commons.collections4.Predicate.evaluate.

Evaluates the predicate returning the result of the decorated predicate once the input has been transformed

Parameters
object:T

the input object which will be transformed

Returns:boolean

true if decorated predicate returns true

Annotations
@Override
getPredicatesback to summary
public Predicate<? super T>[] getPredicates()

Implements org.apache.commons.collections4.functors.PredicateDecorator.getPredicates.

Gets the predicate being decorated.

Returns:Predicate<? super T>[]

the predicate as the only element in an array

Annotations
@Override
@SuppressWarnings:unchecked
Since
3.1
getTransformerback to summary
public Transformer<? super T, ? extends T> getTransformer()

Gets the transformer in use.

Returns:Transformer<? super T, ? extends T>

the transformer

transformedPredicateback to summary
public static <T> Predicate<T> transformedPredicate(final Transformer<? super T, ? extends T> transformer, final Predicate<? super T> predicate)

Factory to create the predicate.

Parameters
<T>
the type that the predicate queries
transformer:Transformer<? super T, ? extends T>

the transformer to call

predicate:Predicate<? super T>

the predicate to call with the result of the transform

Returns:Predicate<T>

the predicate

Exceptions
NullPointerException:
if the transformer or the predicate is null