Interface SimpleBooleanPredicateClausesCollector<SR,S extends SimpleBooleanPredicateClausesCollector<SR,?>>
- Type Parameters:
SR- Scope root type.S- The "self" type (the actual exposed type of this collector).
- All Known Subinterfaces:
GenericSimpleBooleanPredicateClausesStep<SR,,S, C> NestedPredicateClausesCollector<SR,,S> NestedPredicateClausesStep<SR,,S> SimpleBooleanPredicateClausesStep<SR,S>
public interface SimpleBooleanPredicateClausesCollector<SR,S extends SimpleBooleanPredicateClausesCollector<SR,?>>
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
andpredicate, documents will have to match all clauses. -
For the
orpredicate, documents will have to match any clauses (at least one). -
For the
nestedpredicate, 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 Summary
Modifier and TypeMethodDescriptionadd(Function<? super TypedSearchPredicateFactory<SR>, ? extends PredicateFinalStep> clauseContributor) Adds a clause to be defined by the given function.add(PredicateFinalStep searchPredicate) Adds the specified predicate to the list of clauses.add(SearchPredicate searchPredicate) Adds the specified previously-builtSearchPredicateto the list of clauses.booleanChecks if this predicate contains at least one clause.Delegates setting clauses and options to a given consumer.
-
Method Details
-
add
Adds the specified predicate to the list of clauses.- Returns:
this, for method chaining.
-
add
Adds the specified previously-builtSearchPredicateto the list of clauses.- Returns:
this, for method chaining.
-
add
S add(Function<? super TypedSearchPredicateFactory<SR>, ? 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
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:
trueif any clauses were added, i.e. any of theadd(..)methods were called at least once,falseotherwise.
-