Interface ComposableIntPredicate

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.

@FunctionalInterface public interface ComposableIntPredicate extends IntPredicate
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 Details

    • negated

      default ComposableIntPredicate negated()
      Returns the negation of this predicate.
      Returns:
      the negation of this predicate
    • orElse

      default ComposableIntPredicate orElse(IntPredicate test)
      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

      default ComposableIntPredicate orElse(IntRelation relation, int object)
      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 with
      object - the object of the specified relation, with the value of this ComposablePredicate now becoming the subject of that relation
      Returns:
      a new test combining this test and the specified test
    • orNot

      default ComposableIntPredicate orNot(IntPredicate test)
      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

      default ComposableIntPredicate orNot(IntRelation relation, int object)
      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 with
      object - the object of the specified relation, with the value of this ComposablePredicate now becoming the subject of that relation
      Returns:
      a new test combining this test and the specified test
    • or

      default ComposableIntPredicate or(IntRelation relation, Quantifier quantifier, int... objects)
      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 with
      quantifier - a logical quantifier modulating the relationship
      objects - the set of values to test the value against
      Returns:
      a new test combining this test and the specified test
    • orThat

      default <T> ComposableIntPredicate orThat(T value, Predicate<T> test)
      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 test
      test - the test to combine this test with
      Returns:
      a new test combining this test and the specified test
    • orThat

      default ComposableIntPredicate orThat(int value, IntPredicate test)
      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 test
      test - the test to combine this test with
      Returns:
      a new test combining this test and the specified test
    • orThat

      default <S, O> ComposableIntPredicate orThat(S subject, Relation<S,O> relation, O object)
      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 relation
      O - the type of the object of the specified relation
      Parameters:
      subject - the subject of the specified relation
      relation - the relationship test to combine this test with
      object - the object of the specified relation
      Returns:
      a new test combining this test and the specified test
    • orThat

      default ComposableIntPredicate orThat(int subject, IntRelation relation, int object)
      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 relation
      relation - the relationship test to combine this test with
      object - the object of the specified relation
      Returns:
      a new test combining this test and the specified test
    • orNot

      default <T> ComposableIntPredicate orNot(T value, Predicate<T> test)
      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 predicate
      test - the test to combine this test with
      Returns:
      a new test combining this test and the specified test
    • orNot

      default ComposableIntPredicate orNot(int value, IntPredicate test)
      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 predicate
      test - the test to combine this test with
      Returns:
      a new test combining this test and the specified test
    • orNot

      default <S, O> ComposableIntPredicate orNot(S subject, Relation<S,O> relation, O object)
      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 relation
      O - the type of the object of the specified relation
      Parameters:
      subject - the subject of the specified relation
      relation - the relationship test to combine this test with
      object - the object of the specified relation
      Returns:
      a new test combining this test and the specified test
    • or

      default <S, O, P extends O> ComposableIntPredicate or(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 relation
      O - the type of the object of the relation
      P - the type of the values fed as "objects" into the relation
      Parameters:
      subject - the subject of the specified Relation
      relation - the relationship test to combine this test with
      quantifier - a logical quantifier modulating the relationship
      objects - 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 relation
      relation - the relationship test to combine this test with
      quantifier - a logical quantifier modulating the relationship
      objects - the set of values to test the subject against
      Returns:
      a new test combining this test and the specified test
    • or

      default ComposableIntPredicate or(boolean test)
      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 to true.
      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

      default ComposableIntPredicate orEval(Supplier<Boolean> test)
      Returns a new test combining this test with the free-form test supplied by the specified Supplier. A value will pass the new test if it passes this test or if the expression supplied by the Supplier evaluates to true. The supplier's get() 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

      default ComposableIntPredicate andAlso(IntPredicate test)
      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

      default ComposableIntPredicate andAlso(IntRelation relation, int object)
      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 with
      object - 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

      default ComposableIntPredicate and(boolean test)
      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 to true.
      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

      default ComposableIntPredicate andEval(Supplier<Boolean> test)
      Returns a new test combining this test with the free-form test supplied by the specified Supplier. A value will pass the new test if it passes this test and if the expression supplied by the Supplier evaluates to true. The supplier's get() 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

      default ComposableIntPredicate andNot(IntPredicate test)
      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

      default ComposableIntPredicate andNot(IntRelation relation, int object)
      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 with
      object - 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

      default ComposableIntPredicate and(IntRelation relation, Quantifier quantifier, int... objects)
      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 with
      quantifier - a logical quantifier modulating the relationship
      objects - the set of values to test the value against
      Returns:
      a new test combining this test and the specified test
    • andThat

      default <T> ComposableIntPredicate andThat(T value, Predicate<T> test)
      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 predicate
      test - the test to combine this test with
      Returns:
      a new test combining this test and the specified test
    • andThat

      default ComposableIntPredicate andThat(int value, IntPredicate test)
      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 predicate
      test - the test to combine this test with
      Returns:
      a new test combining this test and the specified test
    • andThat

      default <S, O> ComposableIntPredicate andThat(S subject, Relation<S,O> relation, O object)
      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 relation
      O - the type of the object of the specified relation
      Parameters:
      subject - the subject of the specified relation
      relation - the relationship test to combine this test with
      object - the object of the specified relation
      Returns:
      a new test combining this test and the specified test
    • andThat

      default ComposableIntPredicate andThat(int subject, IntRelation relation, int object)
      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 relation
      relation - the relationship test to combine this test with
      object - the object of the specified relation
      Returns:
      a new test combining this test and the specified test
    • andNot

      default <T> ComposableIntPredicate andNot(T value, Predicate<T> test)
      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 predicate
      test - the test to combine this test with
      Returns:
      a new test combining this test and the specified test
    • andNot

      default ComposableIntPredicate andNot(int value, IntPredicate test)
      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 predicate
      test - the test to combine this test with
      Returns:
      a new test combining this test and the specified test
    • andNot

      default <S, O> ComposableIntPredicate andNot(S subject, Relation<S,O> relation, O object)
      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 relation
      O - the type of the object of the specified relation
      Parameters:
      subject - the subject of the specified relation
      relation - the relationship test to combine this test with
      object - the object of the specified relation
      Returns:
      a new test combining this test and the specified test
    • andNot

      default ComposableIntPredicate andNot(int subject, IntRelation relation, int object)
      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 relation
      relation - the relationship test to combine this test with
      object - the object of the specified relation
      Returns:
      a new test combining this test and the specified test
    • and

      default <S, O, P extends O> ComposableIntPredicate and(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 relation
      O - the type of the object of the relation
      P - the type of the values fed as "objects" into the relation
      Parameters:
      subject - the subject of the specified Relation
      relation - the relationship test to combine this test with
      quantifier - a logical quantifier modulating the relationship
      objects - 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 relation
      relation - the relationship test to combine this test with
      quantifier - a logical quantifier modulating the relationship
      objects - the set of values to test the subject against
      Returns:
      a new test combining this test and the specified test