org.modeshape.common.function

## Class Predicate<T>

- java.lang.Object
- - org.modeshape.common.function.Predicate<T>

- Type Parameters:
    `T` - the type of input for the `test(Object)` method

      public abstract class Predicate<T>
      extends Object

  A simple predicate that takes a single argument.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Predicate()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <T> Predicate<T>` | `always()` Return a predicate that is always satisfied.
    `Predicate<T>` | `and(Predicate<T> other)` Obtain a new predicate that performs the logical AND of this predicate and the supplied predicate.
    `static <T> Predicate<T>` | `isEqual(Object obj)` Return a predicate that is equivalent to `Objects.equals(Object, Object)` called with the supplied object and the object passed as a parameter to the `test(Object)` method.
    `Predicate<T>` | `negate()` Obtain a new predicate that performs the logical NOT of this predicate.
    `static <T> Predicate<T>` | `never()` Return a predicate that is never satisfied.
    `Predicate<T>` | `or(Predicate<T> other)` Obtain a new predicate that performs the logical OR of this predicate and the supplied predicate.
    `abstract boolean` | `test(T input)`

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

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

- - ### Constructor Detail

    - #### Predicate

          public Predicate()

  - ### Method Detail

    - #### test

          public abstract boolean test(T input)

    - #### and

          public Predicate<T> and(Predicate<T> other)

      Obtain a new predicate that performs the logical AND of this predicate and the supplied predicate.
      Parameters:
        `other` - the other predicate
      Returns:
        the composed predicate; never null

    - #### or

          public Predicate<T> or(Predicate<T> other)

      Obtain a new predicate that performs the logical OR of this predicate and the supplied predicate.
      Parameters:
        `other` - the other predicate
      Returns:
        the composed predicate; never null

    - #### negate

          public Predicate<T> negate()

      Obtain a new predicate that performs the logical NOT of this predicate.
      Returns:
        the composed predicate; never null

    - #### never

          public static <T> Predicate<T> never()

      Return a predicate that is never satisfied.
      Returns:
        the predicate; never null

    - #### always

          public static <T> Predicate<T> always()

      Return a predicate that is always satisfied.
      Returns:
        the predicate; never null

    - #### isEqual

          public static <T> Predicate<T> isEqual(Object obj)

      Return a predicate that is equivalent to `Objects.equals(Object, Object)` called with the supplied object and the object passed as a parameter to the `test(Object)` method.
      Parameters:
        `obj` - the object to compare the test parameters
      Returns:
        the new predicate; never null

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.