- All Superinterfaces:
IntPredicate
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
An extension of
IntPredicate that acts as a bridge between
IntPredicate and the relational interfaces in this package. It enables the
composition of new tests from any number of instances of Predicate,
IntPredicate, Relation, IntRelation and
IntObjRelation. ComposableIntPredicate extends
IntPredicate with a set of default methods that allow the
composition to take place. For more information, see ComposablePredicate.-
Method Summary
Modifier and TypeMethodDescriptiondefault ComposableIntPredicateand(boolean test) Returns a new test combining this test with the specified free-form test.default ComposableIntPredicateand(int subject, IntRelation relation, Quantifier quantifier, int... objects) Returns a new test combining this test and the specified test.default ComposableIntPredicateand(IntRelation relation, Quantifier quantifier, int... objects) Returns a new test combining this test and the specified test.default <S,O, P extends O>
ComposableIntPredicateand(S subject, Relation<S, O> relation, Quantifier quantifier, P... objects) Returns a new test combining this test and the specified test.default ComposableIntPredicateandAlso(IntPredicate test) Returns a new test combining this test and the specified test.default ComposableIntPredicateandAlso(IntRelation relation, int object) Returns a new test combining this test and the specified test.default ComposableIntPredicateReturns a new test combining this test with the free-form test supplied by the specifiedSupplier.default ComposableIntPredicateandNot(int value, IntPredicate test) Returns a new test combining this test and the specified test.default ComposableIntPredicateandNot(int subject, IntRelation relation, int object) Returns a new test combining this test and the specified test.default ComposableIntPredicateandNot(IntPredicate test) Returns a new test combining this test and the specified test.default ComposableIntPredicateandNot(IntRelation relation, int object) Returns a new test combining this test and the specified test.default <S,O> ComposableIntPredicate Returns a new test combining this test and the specified test.default <T> ComposableIntPredicateReturns a new test combining this test and the specified test.default ComposableIntPredicateandThat(int value, IntPredicate test) Returns a new test combining this test and the specified test.default ComposableIntPredicateandThat(int subject, IntRelation relation, int object) Returns a new test combining this test and the specified test.default <S,O> ComposableIntPredicate Returns a new test combining this test and the specified test.default <T> ComposableIntPredicateReturns a new test combining this test and the specified test.default ComposableIntPredicatenegated()Returns the negation of this predicate.default ComposableIntPredicateor(boolean test) Returns a new test combining this test with the specified free-form test.default ComposableIntPredicateor(int subject, IntRelation relation, Quantifier quantifier, int... objects) Returns a new test combining this test and the specified test.default ComposableIntPredicateor(IntRelation relation, Quantifier quantifier, int... objects) Returns a new test combining this test and the specified test.default <S,O, P extends O>
ComposableIntPredicateor(S subject, Relation<S, O> relation, Quantifier quantifier, P... objects) Returns a new test combining this test and the specified test.default ComposableIntPredicateorElse(IntPredicate test) Returns a new test combining this test and the specified test.default ComposableIntPredicateorElse(IntRelation relation, int object) Returns a new test combining this test and the specified test.default ComposableIntPredicateReturns a new test combining this test with the free-form test supplied by the specifiedSupplier.default ComposableIntPredicateorNot(int value, IntPredicate test) Returns a new test combining this test and the specified test.default ComposableIntPredicateorNot(IntPredicate test) Returns a new test combining this test and the specified test.default ComposableIntPredicateorNot(IntRelation relation, int object) Returns a new test combining this test and the specified test.default <S,O> ComposableIntPredicate Returns a new test combining this test and the specified test.default <T> ComposableIntPredicateReturns a new test combining this test and the specified test.default ComposableIntPredicateorThat(int value, IntPredicate test) Returns a new test combining this test and the specified test.default ComposableIntPredicateorThat(int subject, IntRelation relation, int object) Returns a new test combining this test and the specified test.default <S,O> ComposableIntPredicate Returns a new test combining this test and the specified test.default <T> ComposableIntPredicateReturns a new test combining this test and the specified test.Methods inherited from interface java.util.function.IntPredicate
and, negate, or, test
-
Method Details
-
negated
Returns the negation of this predicate.- Returns:
- the negation of this predicate
-
orElse
Returns a new test combining this test and the specified test. A value will pass the new test if it passes this test or the specified test.- Parameters:
test- the test to combine this test with- Returns:
- a new test combining this test and the specified test
-
orElse
Returns a new test combining this test and the specified test. A value will pass the new test if it passes this test or if it has the specified relation to the specified value.Check.that("foo bar").is(empty().orElse(hasSubstring(), "foo"));- Parameters:
relation- the relationship test to combine this test withobject- the object of the specified relation, with the value of thisComposablePredicatenow becoming the subject of that relation- Returns:
- a new test combining this test and the specified test
-
orNot
Returns a new test combining this test and the specified test. A value will pass the new test if it passes this test or the negation of the specified test.- Parameters:
test- the test to combine this test with- Returns:
- a new test combining this test and the specified test
-
orNot
Returns a new test combining this test and the specified test. A value will pass the new test if it passes this test or if it does not have the specified relation to the specified value.- Parameters:
relation- the relationship test to combine this test withobject- the object of the specified relation, with the value of thisComposablePredicatenow becoming the subject of that relation- Returns:
- a new test combining this test and the specified test
-
or
Returns a new test combining this test and the specified test. A value will pass the new test if it passes this test or if it has a particular relation to the specified set of values.- Parameters:
relation- the relationship test to combine this test withquantifier- a logical quantifier modulating the relationshipobjects- the set of values to test the value against- Returns:
- a new test combining this test and the specified test
-
orThat
Returns a new test combining this test and the specified test. It combines two checks on two different values. A value will pass the new test if it passes this test or if another value manages to pass the other test.- Type Parameters:
T- the type of the value tested by the predicate- Parameters:
value- the value to be tested by the specified testtest- the test to combine this test with- Returns:
- a new test combining this test and the specified test
-
orThat
Returns a new test combining this test and the specified test. It combines two checks on two different values. A value will pass the new test if it passes this test or if another value manages to pass the other test.- Parameters:
value- the value to be tested by the specified testtest- the test to combine this test with- Returns:
- a new test combining this test and the specified test
-
orThat
Returns a new test combining this test and the specified test. It combines two checks on two different values. A value will pass the new test if it passes this test or if another value manages to pass the other test.- Type Parameters:
S- the type of the subject of the specified relationO- the type of the object of the specified relation- Parameters:
subject- the subject of the specified relationrelation- the relationship test to combine this test withobject- the object of the specified relation- Returns:
- a new test combining this test and the specified test
-
orThat
Returns a new test combining this test and the specified test. It combines two checks on two different values. A value will pass the new test if it passes this test or if another value manages to pass the other test.- Parameters:
subject- the subject of the specified relationrelation- the relationship test to combine this test withobject- the object of the specified relation- Returns:
- a new test combining this test and the specified test
-
orNot
Returns a new test combining this test and the specified test. It combines two checks on two different values. A value will pass the new test if it passes this test or if another value manages to pass the negation of the other test.- Type Parameters:
T- the type of values being tested by the specified predicate- Parameters:
value- the value to be tested by the specified predicatetest- the test to combine this test with- Returns:
- a new test combining this test and the specified test
-
orNot
Returns a new test combining this test and the specified test. It combines two checks on two different values. A value will pass the new test if it passes this test or if another value manages to pass the negation of the other test.- Parameters:
value- the value to be tested by the specified predicatetest- the test to combine this test with- Returns:
- a new test combining this test and the specified test
-
orNot
Returns a new test combining this test and the specified test. It combines two checks on two different values. A value will pass the new test if it passes this test or if another value manages to pass the negation of the other test.- Type Parameters:
S- the type of the subject of the specified relationO- the type of the object of the specified relation- Parameters:
subject- the subject of the specified relationrelation- the relationship test to combine this test withobject- the object of the specified relation- Returns:
- a new test combining this test and the specified test
-
or
default <S,O, ComposableIntPredicate orP extends O> (S subject, Relation<S, O> relation, Quantifier quantifier, P... objects) Returns a new test combining this test and the specified test. It combines two checks on two different values. A value will pass the new test if it passes this test or if another value (subject) has a particular relation to the specified set of values.- Type Parameters:
S- the type of the subject of the relationO- the type of the object of the relationP- the type of the values fed as "objects" into the relation- Parameters:
subject- the subject of the specifiedRelationrelation- the relationship test to combine this test withquantifier- a logical quantifier modulating the relationshipobjects- the set of values to test the subject against- Returns:
- a new test combining this test and the specified test
-
or
default ComposableIntPredicate or(int subject, IntRelation relation, Quantifier quantifier, int... objects) Returns a new test combining this test and the specified test. It combines two checks on two different values. A value will pass the new test if it passes this test and if another value (subject) has a particular relation to the specified set of values.- Parameters:
subject- the subject of the relationrelation- the relationship test to combine this test withquantifier- a logical quantifier modulating the relationshipobjects- the set of values to test the subject against- Returns:
- a new test combining this test and the specified test
-
or
Returns a new test combining this test with the specified free-form test. A value will pass the new test if it passes this test or if the provided expression evaluates totrue.- Parameters:
test- the boolean expression to evaluate if the value fails to pass this test- Returns:
- a new test combining this test and the specified free-form test
-
orEval
Returns a new test combining this test with the free-form test supplied by the specifiedSupplier. A value will pass the new test if it passes this test or if the expression supplied by theSupplierevaluates totrue. The supplier'sget()method will only be called if the value fails to pass this test. Useful if evaluating the expression could be expensive.- Parameters:
test- the supplier of a boolean expression- Returns:
- a new test combining this test and the specified free-form test
-
andAlso
Returns a new test combining this test and the specified test. A value will pass the new test if it passes both this test and the specified test.- Parameters:
test- the test to combine this test with- Returns:
- a new test combining this test and the specified test
-
andAlso
Returns a new test combining this test and the specified test. A value will pass the new test if it passes this test and if it has the specified relation to the specified value.- Parameters:
relation- the relationship test to combine this test withobject- the object of the relation, with the value being tested now becoming the subject of the relation- Returns:
- a new test combining this test and the specified test
-
and
Returns a new test combining this test with the specified free-form test. A value will pass the new test if it passes this test and if the provided expression evaluates totrue.- Parameters:
test- the boolean expression to evaluate if the value fails to pass this test- Returns:
- a new test combining this test and the specified free-form test
-
andEval
Returns a new test combining this test with the free-form test supplied by the specifiedSupplier. A value will pass the new test if it passes this test and if the expression supplied by theSupplierevaluates totrue. The supplier'sget()method will only be called if the value passes this test. Useful if evaluating the boolean expression could be expensive.- Parameters:
test- the supplier of a boolean expression- Returns:
- a new test combining this test and the specified free-form test
-
andNot
Returns a new test combining this test and the specified test. A value will pass the new test if it passes both this test and the negation of the specified test.- Parameters:
test- the test to combine this test with- Returns:
- a new test combining this test and the specified test
-
andNot
Returns a new test combining this test and the specified test. A value will pass the new test if it passes this test and if it does not have the specified relation to the specified value.- Parameters:
relation- the relationship test to combine this test withobject- the object of the relation, with the value being tested now becoming the subject of the relation- Returns:
- a new test combining this test and the specified test
-
and
Returns a new test combining this test and the specified test. A value will pass the new test if it passes this test and if it has a particular relation to the specified set of values.- Parameters:
relation- the relationship test to combine this test withquantifier- a logical quantifier modulating the relationshipobjects- the set of values to test the value against- Returns:
- a new test combining this test and the specified test
-
andThat
Returns a new test combining this test and the specified test. It combines two checks on two different values. A value will pass the new test if it passes this test and if another value manages to pass the other test.- Type Parameters:
T- the type of values being tested by the specified predicate- Parameters:
value- the value to be tested by the specified predicatetest- the test to combine this test with- Returns:
- a new test combining this test and the specified test
-
andThat
Returns a new test combining this test and the specified test. It combines two checks on two different values. A value will pass the new test if it passes this test and if another value manages to pass the other test.- Parameters:
value- the value to be tested by the specified predicatetest- the test to combine this test with- Returns:
- a new test combining this test and the specified test
-
andThat
Returns a new test combining this test and the specified test. It combines two checks on two different values. A value will pass the new test if it passes this test and if another value manages to pass the other test.- Type Parameters:
S- the type of the subject of the specified relationO- the type of the object of the specified relation- Parameters:
subject- the subject of the specified relationrelation- the relationship test to combine this test withobject- the object of the specified relation- Returns:
- a new test combining this test and the specified test
-
andThat
Returns a new test combining this test and the specified test. It combines two checks on two different values. A value will pass the new test if it passes this test and if another value manages to pass the other test.- Parameters:
subject- the subject of the specified relationrelation- the relationship test to combine this test withobject- the object of the specified relation- Returns:
- a new test combining this test and the specified test
-
andNot
Returns a new test combining this test and the specified test. It combines two checks on two different values. A value will pass the new test if it passes this test and if another value manages to pass the negation of the other test.- Type Parameters:
T- the type of values being tested by the specified predicate- Parameters:
value- the value to be tested by the specified predicatetest- the test to combine this test with- Returns:
- a new test combining this test and the specified test
-
andNot
Returns a new test combining this test and the specified test. It combines two checks on two different values. A value will pass the new test if it passes this test and if another value manages to pass the negation of the other test.- Parameters:
value- the value to be tested by the specified predicatetest- the test to combine this test with- Returns:
- a new test combining this test and the specified test
-
andNot
Returns a new test combining this test and the specified test. It combines two checks on two different values. A value will pass the new test if it passes this test and if another value manages to pass the negation of the other test.- Type Parameters:
S- the type of the subject of the specified relationO- the type of the object of the specified relation- Parameters:
subject- the subject of the specified relationrelation- the relationship test to combine this test withobject- the object of the specified relation- Returns:
- a new test combining this test and the specified test
-
andNot
Returns a new test combining this test and the specified test. It combines two checks on two different values. A value will pass the new test if it passes this test and if another value manages to pass the negation of the other test.- Parameters:
subject- the subject of the specified relationrelation- the relationship test to combine this test withobject- the object of the specified relation- Returns:
- a new test combining this test and the specified test
-
and
default <S,O, ComposableIntPredicate andP extends O> (S subject, Relation<S, O> relation, Quantifier quantifier, P... objects) Returns a new test combining this test and the specified test. It combines two checks on two different values. A value will pass the new test if it passes this test and if another value (subject) has a particular relation to the specified set of values.- Type Parameters:
S- the type of the subject of the relationO- the type of the object of the relationP- the type of the values fed as "objects" into the relation- Parameters:
subject- the subject of the specifiedRelationrelation- the relationship test to combine this test withquantifier- a logical quantifier modulating the relationshipobjects- the set of values to test the subject against- Returns:
- a new test combining this test and the specified test
-
and
default ComposableIntPredicate and(int subject, IntRelation relation, Quantifier quantifier, int... objects) Returns a new test combining this test and the specified test. It combines two checks on two different values. A value will pass the new test if it passes this test and if another value (subject) has a particular relation to the specified set of values.- Parameters:
subject- the subject of the relationrelation- the relationship test to combine this test withquantifier- a logical quantifier modulating the relationshipobjects- the set of values to test the subject against- Returns:
- a new test combining this test and the specified test
-