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>
- All Known Implementing Classes:
AbstractSimpleBooleanPredicateClausesStep,NestedPredicateClausesStepImpl,SimpleBooleanPredicateClausesStepImpl
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
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Sadd(Function<? super SearchPredicateFactory,? extends PredicateFinalStep> clauseContributor)Adds a clause to be defined by the given function.Sadd(PredicateFinalStep searchPredicate)Adds the specified predicate to the list of clauses.Sadd(SearchPredicate searchPredicate)Adds the specified previously-builtSearchPredicateto the list of clauses.booleanhasClause()Checks if this predicate contains at least one clause.Swith(Consumer<? super S> contributor)Delegates setting clauses and options to a given consumer.
-
-
-
Method Detail
-
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-builtSearchPredicateto 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:
trueif any clauses were added, i.e. any of theadd(..)methods were called at least once,falseotherwise.
-
-