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

public final Class NonePredicate<T>

extends AbstractQuantifierPredicate<T>
Class Inheritance
Imports
java.util.Collection, org.apache.commons.collections4.Predicate

Predicate implementation that returns true if none of the predicates return true. If the array of predicates is empty, then this predicate returns true.

Note

In versions prior to 3.2 an array size of zero or one threw an exception.

Since
3.0

Field Summary

Modifier and TypeField and Description
private static final long
Inherited from org.apache.commons.collections4.functors.AbstractQuantifierPredicate:
iPredicates

Constructor Summary

AccessConstructor and Description
public
NonePredicate(final Predicate<? super T>...
the predicates to check, not cloned, not null
predicates
)

Constructor that performs no validation.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if none of decorated predicates return true
evaluate
(final T
the input object
object
)

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

Evaluates the predicate returning false if any stored predicate returns false.
public static <
the type that the predicate queries
T
>
Predicate<T>

Returns:

the any predicate
nonePredicate
(final Predicate<? super T>...
the predicates to check, cloned, not null
predicates
)

Factory to create the predicate.

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

Returns:

the one predicate
nonePredicate
(final Collection<? extends Predicate<? super T>>
the predicates to check, cloned, not null
predicates
)

Factory to create the predicate.

Inherited from org.apache.commons.collections4.functors.AbstractQuantifierPredicate:
getPredicates

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides org.apache.commons.collections4.functors.AbstractQuantifierPredicate.serialVersionUID.

Serial version UID

Constructor Detail

NonePredicateback to summary
public NonePredicate(final Predicate<? super T>... predicates)

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

Parameters
predicates:Predicate<? super T>[]

the predicates to check, not cloned, not null

Method Detail

evaluateback to summary
public boolean evaluate(final T object)

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

Evaluates the predicate returning false if any stored predicate returns false.

Parameters
object:T

the input object

Returns:boolean

true if none of decorated predicates return true

Annotations
@Override
nonePredicateback to summary
public static <T> Predicate<T> nonePredicate(final Predicate<? super T>... predicates)

Factory to create the predicate.

If the array is size zero, the predicate always returns true.

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

the predicates to check, cloned, not null

Returns:Predicate<T>

the any predicate

Exceptions
NullPointerException:
  • if the predicates array is null
  • if any predicate in the array is null
nonePredicateback to summary
public static <T> Predicate<T> nonePredicate(final Collection<? extends Predicate<? super T>> predicates)

Factory to create the predicate.

If the collection is size zero, the predicate always returns true.

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

the predicates to check, cloned, not null

Returns:Predicate<T>

the one predicate

Exceptions
NullPointerException:
  • if the predicates array is null
  • if any predicate in the array is null