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

public final Class NotPredicate<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

Predicate implementation that returns the opposite of the decorated predicate.
Since
3.0

Field Summary

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

The predicate to decorate

private static final long
serialVersionUID

Serial version UID

Constructor Summary

AccessConstructor and Description
public
NotPredicate(final Predicate<? super T>
the predicate to call after the null check
predicate
)

Constructor that performs no validation.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if predicate returns false
evaluate
(final T
the input object
object
)

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

Evaluates the predicate returning the opposite to the stored predicate.
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 static <
the type that the predicate queries
T
>
Predicate<T>

Returns:

the predicate
notPredicate
(final Predicate<? super T>
the predicate to decorate, not null
predicate
)

Factory to create the not predicate.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

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

The predicate to decorate

serialVersionUIDback to summary
private static final long serialVersionUID

Serial version UID

Constructor Detail

NotPredicateback to summary
public NotPredicate(final Predicate<? super T> predicate)

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

Parameters
predicate:Predicate<? super T>

the predicate to call after the null check

Method Detail

evaluateback to summary
public boolean evaluate(final T object)

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

Evaluates the predicate returning the opposite to the stored predicate.

Parameters
object:T

the input object

Returns:boolean

true if predicate returns false

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
notPredicateback to summary
public static <T> Predicate<T> notPredicate(final Predicate<? super T> predicate)

Factory to create the not predicate.

Parameters
<T>
the type that the predicate queries
predicate:Predicate<? super T>

the predicate to decorate, not null

Returns:Predicate<T>

the predicate

Exceptions
NullPointerException:
if the predicate is null