Top Description Interfaces Classes
[default module]

Package org.apache.commons.collections4.functors


This package contains implementations of the Closure, Predicate, Transformer and Factory interfaces. These provide simple callbacks for processing with collections.

Warning

from v4.1 onwards several unsafe classes in this package will not be serializable anymore in order to prevent potential remote code execution exploits.

Classes considered to be unsafe are:

Interface Summary

Modifier and TypeInterface and Description
public interface
PredicateDecorator<T>

Defines a predicate that decorates one or more other predicates.

Class Summary

Modifier and TypeClass and Description
public abstract class
AbstractQuantifierPredicate<T>

Abstract base class for quantification predicates, e.g. All, Any, None.

public class
AllPredicate<T>

Predicate implementation that returns true if all the predicates return true.

public class
AndPredicate<T>

Predicate implementation that returns true if both the predicates return true.

public class
AnyPredicate<T>

Predicate implementation that returns true if any of the predicates return true.

public abstract class
CatchAndRethrowClosure<E>

Closure that catches any checked exception and re-throws it as a FunctorException runtime exception.

public class
ChainedClosure<E>

Closure implementation that chains the specified closures together.

public class
ChainedTransformer<T>

Transformer implementation that chains the specified transformers together.

public class
CloneTransformer<T>

Transformer implementation that returns a clone of the input object.

public class
ClosureTransformer<T>

Transformer implementation that calls a Closure using the input object and then returns the input.

public class
ComparatorPredicate<T>

Predicate that compares the input object with the one stored in the predicate using a comparator.

public class
ConstantFactory<T>

Factory implementation that returns the same constant each time.

public class
ConstantTransformer<I, O>

Transformer implementation that returns the same constant each time.

public class
DefaultEquator<
the types of object this Equator can evaluate.
T
>

Default Equator implementation.

public class
EqualPredicate<T>

Predicate implementation that returns true if the input is the same object as the one stored in this predicate by equals.

public class
ExceptionClosure<E>

Closure implementation that always throws an exception.

public class
ExceptionFactory<T>

Factory implementation that always throws an exception.

public class
ExceptionPredicate<T>

Predicate implementation that always throws an exception.

public class
ExceptionTransformer<I, O>

Transformer implementation that always throws an exception.

public class
FactoryTransformer<I, O>

Transformer implementation that calls a Factory and returns the result.

public class
FalsePredicate<T>

Predicate implementation that always returns false.

public class
ForClosure<E>

Closure implementation that calls another closure n times, like a for loop.

pack-priv class
FunctorUtils

Internal utilities for functors.

public class
IdentityPredicate<T>

Predicate implementation that returns true if the input is the same object as the one stored in this predicate.

public class
IfClosure<E>

Closure implementation acts as an if statement calling one or other closure based on a predicate.

public class
IfTransformer<
The input type for the transformer
I
,
The output type for the transformer
O
>

Transformer implementation that will call one of two closures based on whether a predicate evaluates as true or false.

public class
InstanceofPredicate

Predicate implementation that returns true if the input is an instanceof the type stored in this predicate.

public class
InstantiateFactory<T>

Factory implementation that creates a new object instance by reflection.

public class
InstantiateTransformer<T>

Transformer implementation that creates a new object instance by reflection.

public class
InvokerTransformer<I, O>

Transformer implementation that creates a new object instance by reflection.

public class
MapTransformer<I, O>

Transformer implementation that returns the value held in a specified map using the input parameter as a key.

public class
NonePredicate<T>

Predicate implementation that returns true if none of the predicates return true.

public class
NOPClosure<E>

Closure implementation that does nothing.

public class
NOPTransformer<T>

Transformer implementation that does nothing.

public class
NotNullPredicate<T>

Predicate implementation that returns true if the input is not null.

public class
NotPredicate<T>

Predicate implementation that returns the opposite of the decorated predicate.

public class
NullIsExceptionPredicate<T>

Predicate implementation that throws an exception if the input is null.

public class
NullIsFalsePredicate<T>

Predicate implementation that returns false if the input is null.

public class
NullIsTruePredicate<T>

Predicate implementation that returns true if the input is null.

public class
NullPredicate<T>

Predicate implementation that returns true if the input is null.

public class
OnePredicate<T>

Predicate implementation that returns true if only one of the predicates return true.

public class
OrPredicate<T>

Predicate implementation that returns true if either of the predicates return true.

public class
PredicateTransformer<T>

Transformer implementation that calls a Predicate using the input object and then returns the result.

public class
PrototypeFactory

Factory implementation that creates a new instance each time based on a prototype.

public class
StringValueTransformer<T>

Transformer implementation that returns the result of calling String.valueOf on the input object.

public class
SwitchClosure<E>

Closure implementation calls the closure whose predicate returns true, like a switch statement.

public class
SwitchTransformer<I, O>

Transformer implementation calls the transformer whose predicate returns true, like a switch statement.

public class
TransformedPredicate<T>

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

public class
TransformerClosure<E>

Closure implementation that calls a Transformer using the input object and ignore the result.

public class
TransformerPredicate<T>

Predicate implementation that returns the result of a transformer.

public class
TruePredicate<T>

Predicate implementation that always returns true.

public class
UniquePredicate<T>

Predicate implementation that returns true the first time an object is passed into the predicate.

public class
WhileClosure<E>

Closure implementation that executes a closure repeatedly until a condition is met, like a do-while or while loop.