Interface SimpleBooleanPredicateClausesCollector<S extends SimpleBooleanPredicateClausesCollector<?>>

Type Parameters:
S - The "self" type (the actual exposed type of this collector).
All Known Subinterfaces:
GenericSimpleBooleanPredicateClausesStep<S,C>, NestedPredicateClausesCollector<S>, NestedPredicateClausesStep<S>, SimpleBooleanPredicateClausesStep<S>

public interface SimpleBooleanPredicateClausesCollector<S extends SimpleBooleanPredicateClausesCollector<?>>
An object where the clauses and options of a simple boolean predicate (and, or) can be set.

Clauses

Depending on the outer predicate, documents will have to match either all clauses, or any clause:

  • For the and predicate, documents will have to match all clauses.
  • For the or predicate, documents will have to match any clauses (at least one).
  • For the nested predicate, documents will have to match all clauses.
  • For the root predicate defined through the second parameter of the lambda passed to SearchQueryWhereStep.where(BiConsumer), documents will have to match all clauses.
  • Method Details

    • add

      S add(PredicateFinalStep searchPredicate)
      Adds the specified predicate to the list of clauses.
      Returns:
      this, for method chaining.
    • add

      S add(SearchPredicate searchPredicate)
      Adds the specified previously-built SearchPredicate to the list of clauses.
      Returns:
      this, for method chaining.
    • add

      S add(Function<? super SearchPredicateFactory,? extends PredicateFinalStep> clauseContributor)
      Adds a clause to be defined by the given function.

      Best used with lambda expressions.

      Parameters:
      clauseContributor - A function that will use the factory passed in parameter to create a predicate, returning the final step in the predicate DSL. Should generally be a lambda expression.
      Returns:
      this, for method chaining.
    • with

      S with(Consumer<? super S> contributor)
      Delegates setting clauses and options to a given consumer.

      Best used with lambda expressions.

      Parameters:
      contributor - A consumer that will add clauses and options to the collector that it consumes. Should generally be a lambda expression.
      Returns:
      this, for method chaining.
    • hasClause

      boolean hasClause()
      Checks if this predicate contains at least one clause.
      Returns:
      true if any clauses were added, i.e. any of the add(..) methods were called at least once, false otherwise.