Interface IntPredicate
- All Superinterfaces:
IntPredicate
An enhanced integer predicate.
- Author:
- Paul Ferraro
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final IntPredicateA predicate that always returns truestatic final IntPredicateA predicate that returns true if the parameter is less than zero.static final IntPredicateA predicate that always returns falsestatic final IntPredicateA predicate that returns true if the parameter is greater than zero.static final IntPredicateA predicate that returns true if the parameter is zero. -
Method Summary
Modifier and TypeMethodDescriptiondefault IntPredicateand(IntPredicate other) default <V> Predicate<V> compose(ToIntFunction<V> composer) Returns a predicate that applies the specified mapping to its argument before evaluating.default DoublePredicatecomposeDouble(DoubleToIntFunction composer) Returns a predicate that applies the specified function to its argument before evaluating.default IntPredicatecomposeInt(IntUnaryOperator composer) Returns a predicate that applies the specified function to its argument before evaluating.default LongPredicatecomposeLong(LongToIntFunction composer) Returns a predicate that applies the specified function to its argument before evaluating.static IntPredicateequalTo(int base) Returns a predicate that evaluates to true if and only if the argument is equals to the specified object.static IntPredicategreaterThan(int base) Returns a predicate that evaluates to true if and only if the argument is equals to the specified object.static IntPredicatelessThan(int base) Returns a predicate that evaluates to true if and only if the argument is equals to the specified object.default IntPredicatenegate()static IntPredicateof(boolean result) Returns a predicate that always evaluates to the specified result.static IntPredicateof(IntConsumer consumer, BooleanSupplier supplier) Returns a predicate that accepts its parameter via the specified consumer and returns the result of the specified supplier.default IntPredicateor(IntPredicate other) default IntPredicatexor(IntPredicate other) Returns a predicate returning the exclusive disjunction of this predicate with the specified predicate.Methods inherited from interface IntPredicate
test
-
Field Details
-
ALWAYS
A predicate that always returns true -
NEVER
A predicate that always returns false -
POSITIVE
A predicate that returns true if the parameter is greater than zero. -
ZERO
A predicate that returns true if the parameter is zero. -
NEGATIVE
A predicate that returns true if the parameter is less than zero.
-
-
Method Details
-
compose
Returns a predicate that applies the specified mapping to its argument before evaluating.- Type Parameters:
V- the mapped type- Parameters:
composer- a composing function- Returns:
- a mapped predicate
-
composeDouble
Returns a predicate that applies the specified function to its argument before evaluating.- Parameters:
composer- a composing function- Returns:
- a mapped predicate
-
composeInt
Returns a predicate that applies the specified function to its argument before evaluating.- Parameters:
composer- a composing operator- Returns:
- a mapped predicate
-
composeLong
Returns a predicate that applies the specified function to its argument before evaluating.- Parameters:
composer- a composing function- Returns:
- a mapped predicate
-
and
- Specified by:
andin interfaceIntPredicate
-
negate
- Specified by:
negatein interfaceIntPredicate
-
or
- Specified by:
orin interfaceIntPredicate
-
xor
Returns a predicate returning the exclusive disjunction of this predicate with the specified predicate.- Parameters:
other- another predicate- Returns:
- a predicate returning the exclusive disjunction of this predicate with the specified predicate.
-
of
Returns a predicate that always evaluates to the specified result.- Parameters:
result- the fixed result- Returns:
- a predicate that always evaluates to the specified value.
-
of
Returns a predicate that accepts its parameter via the specified consumer and returns the result of the specified supplier.- Parameters:
consumer- the predicate parameter consumersupplier- the predicate result supplier- Returns:
- a predicate that accepts its parameter via the specified consumer and returns the result of the specified supplier.
-
lessThan
Returns a predicate that evaluates to true if and only if the argument is equals to the specified object.- Parameters:
base- the comparison value- Returns:
- a predicate that evaluates to true if and only if the argument is equals to the specified object.
-
equalTo
Returns a predicate that evaluates to true if and only if the argument is equals to the specified object.- Parameters:
base- the comparison value- Returns:
- a predicate that evaluates to true if and only if the argument is equals to the specified object.
-
greaterThan
Returns a predicate that evaluates to true if and only if the argument is equals to the specified object.- Parameters:
base- the comparison value- Returns:
- a predicate that evaluates to true if and only if the argument is equals to the specified object.
-