Package org.apache.commons.collections4.functors

# Class NonePredicate<T>

java.lang.Object
org.apache.commons.collections4.functors.AbstractPredicate<T>
org.apache.commons.collections4.functors.AbstractQuantifierPredicate<T>
org.apache.commons.collections4.functors.NonePredicate<T>

Type Parameters:
  `T` - The type of the input to the predicate.

All Implemented Interfaces:
  `Serializable`, `Predicate<T>`, `PredicateDecorator<T>`, `Predicate<T>`

public final class NonePredicate<T> extends AbstractQuantifierPredicate<T>
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
See Also:
  - Serialized Form

- ## Field Summary

  ### Fields inherited from class org.apache.commons.collections4.functors.AbstractQuantifierPredicate

  `iPredicates`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `NonePredicate(Predicate<? super T>... predicates)`
  Constructor that performs no validation.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static <T> Predicate<T>`
  `nonePredicate(Collection<? extends Predicate<? super T>> predicates)`
  Creates the predicate.
  `static <T> Predicate<T>`
  `nonePredicate(Predicate<? super T>... predicates)`
  Creates the predicate.
  `boolean`
  `test(T object)`
  Evaluates the predicate returning false if any stored predicate returns false.

  ### Methods inherited from class org.apache.commons.collections4.functors.AbstractQuantifierPredicate

  `getPredicates`

  ### Methods inherited from class org.apache.commons.collections4.functors.AbstractPredicate

  `evaluate`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface java.util.function.Predicate

  `and, negate, or`

  ### Methods inherited from interface org.apache.commons.collections4.Predicate

  `evaluate`

- ## Constructor Details

  - ### NonePredicate

    public NonePredicate(Predicate<? super T>... predicates)
    Constructor that performs no validation. Use `nonePredicate` if you want that.
    Parameters:
      `predicates` - The predicates to check, not cloned, not null

- ## Method Details

  - ### nonePredicate

    public static <T> Predicate<T> nonePredicate(Collection<? extends Predicate<? super T>> predicates)
    Creates the predicate.

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

    Type Parameters:
      `T` - The type that the predicate queries
    Parameters:
      `predicates` - The predicates to check, cloned, not null
    Returns:
      The `one` predicate
    Throws:
      `NullPointerException` - if the predicates array is null
      `NullPointerException` - if any predicate in the array is null

  - ### nonePredicate

    public static <T> Predicate<T> nonePredicate(Predicate<? super T>... predicates)
    Creates the predicate.

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

    Type Parameters:
      `T` - The type that the predicate queries
    Parameters:
      `predicates` - The predicates to check, cloned, not null
    Returns:
      The `any` predicate
    Throws:
      `NullPointerException` - if the predicates array is null
      `NullPointerException` - if any predicate in the array is null

  - ### test

    public boolean test(T object)
    Evaluates the predicate returning false if any stored predicate returns false.
    Parameters:
      `object` - The input object
    Returns:
      true if none of decorated predicates return true