Package net.pwall.text
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 functionsnegate,andandorare included for consistency with the standard Java library functions.- Author:
- Peter Wall
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default CharPredicateand(CharPredicate other)Create a composed predicate combining this predicate and another testing the same value in an AND relationship.default CharPredicatenegate()Create a predicate representing the logical NOT of this predicate.default CharPredicateor(CharPredicate other)Create a composed predicate combining this predicate and another testing the same value in an OR relationship.booleantest(char value)Evaluate the predicate against the given argument.
-
-
-
Method Detail
-
test
boolean test(char value)
Evaluate the predicate against the given argument.- Parameters:
value- thecharvalue- Returns:
trueiff the predicate matches the argument
-
negate
default CharPredicate negate()
Create a predicate representing the logical NOT of this predicate.- Returns:
- a predicate that returns
trueiff 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 otherCharPredicate- Returns:
- a predicate that returns
trueiff 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 otherCharPredicate- Returns:
- a predicate that returns
trueiff this predicate OR the other predicate match the value
-
-