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

Class NotPredicate

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

All Implemented Interfaces:
Predicate, Serializable


public final class NotPredicate
extends java.lang.Object
implements Predicate, Serializable

Predicate implementation that returns the opposite of the decorated predicate.
Since:
Commons Collections 3.0
Author:
Stephen Colebourne

Constructor Summary

NotPredicate(Predicate predicate)

Constructor that performs no validation.

Method Summary

boolean

evaluate(Object object)

Return the negated predicate result.

static Predicate

getInstance(Predicate predicate)

Factory to create the not predicate.

Constructor Details

NotPredicate

public NotPredicate(Predicate predicate)

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

Parameters:
predicate - the predicate to call after the null check

Method Details

evaluate

public boolean evaluate(Object object)

Return the negated predicate result.

Parameters:
object

getInstance

public static Predicate getInstance(Predicate predicate)

Factory to create the not predicate.

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