Interface CharPredicate

  • Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface CharPredicate
    A functional interface to test a character value. The default functions negate, and and or are included for consistency with the standard Java library functions.
    Author:
    Peter Wall
    • Method Detail

      • test

        boolean test​(char value)
        Evaluate the predicate against the given argument.
        Parameters:
        value - the char value
        Returns:
        true iff the predicate matches the argument
      • negate

        default CharPredicate negate()
        Create a predicate representing the logical NOT of this predicate.
        Returns:
        a predicate that returns true iff this predicate does NOT match the value
      • and

        default CharPredicate and​(CharPredicate other)
        Create a composed predicate combining this predicate and another testing the same value in an AND relationship.
        Parameters:
        other - the other CharPredicate
        Returns:
        a predicate that returns true iff this predicate AND the other predicate match the value
      • or

        default CharPredicate or​(CharPredicate other)
        Create a composed predicate combining this predicate and another testing the same value in an OR relationship.
        Parameters:
        other - the other CharPredicate
        Returns:
        a predicate that returns true iff this predicate OR the other predicate match the value