Interface Predicate<T>

Type Parameters:
T - the argument type
All Superinterfaces:
Predicate<T>
All Known Implementing Classes:
Predicate.SimplePredicate

public interface Predicate<T> extends Predicate<T>
A Predicate extension that supports mapping.
Author:
Paul Ferraro
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Predicate<?>
     
    static final Predicate<?>
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> Predicate<T>
    Returns a predicate that always accepts its argument.
    default Predicate<T>
    and(Predicate<? super T> other)
     
    static <T> Predicate<T>
    isEqual(T object)
    Returns a predicate that evaluates to true if and only if the argument is equals to the specified object.
    default <V> Predicate<V>
    map(Function<V,T> mapper)
    Returns a predicate that applies the specified mapping to its argument before evaluating.
    default Predicate<T>
     
    static <T> Predicate<T>
    Returns a predicate that never accepts its argument.
    static <T> Predicate<T>
    not(Predicate<? super T> predicate)
    Returns a predicate that evaluates to the negation of the specified predicate.
    default Predicate<T>
    or(Predicate<? super T> other)
     
    static <T> Predicate<T>
    same(T object)
    Returns a predicate that evaluates to true if and only if the argument references the specified object.

    Methods inherited from interface java.util.function.Predicate

    test
  • Field Details

  • Method Details

    • always

      static <T> Predicate<T> always()
      Returns a predicate that always accepts its argument.
      Type Parameters:
      T - the argument type
      Returns:
      a predicate that always accepts its argument.
    • never

      static <T> Predicate<T> never()
      Returns a predicate that never accepts its argument.
      Type Parameters:
      T - the argument type
      Returns:
      a predicate that never accepts its argument.
    • isEqual

      static <T> Predicate<T> isEqual(T object)
      Returns a predicate that evaluates to true if and only if the argument is equals to the specified object.
      Type Parameters:
      T - the argument type
      Parameters:
      object - the object whose reference must match the predicate argument
      Returns:
      a predicate that evaluates to true if and only if the argument is equals to the specified object.
    • same

      static <T> Predicate<T> same(T object)
      Returns a predicate that evaluates to true if and only if the argument references the specified object.
      Type Parameters:
      T - the argument type
      Parameters:
      object - the object whose reference must match the predicate argument
      Returns:
      a predicate that evaluates to true if and only if the argument references the specified object.
    • not

      static <T> Predicate<T> not(Predicate<? super T> predicate)
      Returns a predicate that evaluates to the negation of the specified predicate.
      Type Parameters:
      T - the argument type
      Parameters:
      predicate - the predicate to negate
      Returns:
      a predicate that evaluates to the negation of the specified predicate.
    • map

      default <V> Predicate<V> map(Function<V,T> mapper)
      Returns a predicate that applies the specified mapping to its argument before evaluating.
      Type Parameters:
      V - the mapped type
      Parameters:
      mapper -
      Returns:
      a mapped predicate
    • and

      default Predicate<T> and(Predicate<? super T> other)
      Specified by:
      and in interface Predicate<T>
    • negate

      default Predicate<T> negate()
      Specified by:
      negate in interface Predicate<T>
    • or

      default Predicate<T> or(Predicate<? super T> other)
      Specified by:
      or in interface Predicate<T>