Skip to content

Commit

Permalink
HSEARCH-4676 Rename "simple boolean operator predicate" to "simple bo…
Browse files Browse the repository at this point in the history
…olean predicate"

Because it's shorter and we don't need to be more precise.
  • Loading branch information
yrodiere committed Aug 25, 2022
1 parent 24cb2ed commit a533a10
Show file tree
Hide file tree
Showing 18 changed files with 87 additions and 90 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.hibernate.search.engine.search.loading.spi.SearchLoadingContextBuilder;
import org.hibernate.search.engine.search.predicate.SearchPredicate;
import org.hibernate.search.engine.search.predicate.dsl.PredicateFinalStep;
import org.hibernate.search.engine.search.predicate.dsl.SimpleBooleanOperatorPredicateClausesCollector;
import org.hibernate.search.engine.search.predicate.dsl.SimpleBooleanPredicateClausesCollector;
import org.hibernate.search.engine.search.projection.SearchProjection;
import org.hibernate.search.engine.search.projection.dsl.ProjectionFinalStep;
import org.hibernate.search.engine.search.projection.spi.ProjectionAccumulator;
Expand Down Expand Up @@ -101,7 +101,7 @@ public ElasticsearchSearchQueryOptionsStep<E, LOS> where(

@Override
public ElasticsearchSearchQueryOptionsStep<E, LOS> where(
BiConsumer<? super ElasticsearchSearchPredicateFactory, ? super SimpleBooleanOperatorPredicateClausesCollector<?>> predicateContributor) {
BiConsumer<? super ElasticsearchSearchPredicateFactory, ? super SimpleBooleanPredicateClausesCollector<?>> predicateContributor) {
return selectEntity().where( predicateContributor );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.hibernate.search.engine.search.loading.spi.SearchLoadingContextBuilder;
import org.hibernate.search.engine.search.predicate.SearchPredicate;
import org.hibernate.search.engine.search.predicate.dsl.PredicateFinalStep;
import org.hibernate.search.engine.search.predicate.dsl.SimpleBooleanOperatorPredicateClausesCollector;
import org.hibernate.search.engine.search.predicate.dsl.SimpleBooleanPredicateClausesCollector;
import org.hibernate.search.engine.search.projection.SearchProjection;
import org.hibernate.search.engine.search.projection.dsl.ProjectionFinalStep;
import org.hibernate.search.engine.search.projection.spi.ProjectionAccumulator;
Expand Down Expand Up @@ -100,7 +100,7 @@ public LuceneSearchQueryOptionsStep<E, LOS> where(

@Override
public LuceneSearchQueryOptionsStep<E, LOS> where(
BiConsumer<? super LuceneSearchPredicateFactory, ? super SimpleBooleanOperatorPredicateClausesCollector<?>> predicateContributor) {
BiConsumer<? super LuceneSearchPredicateFactory, ? super SimpleBooleanPredicateClausesCollector<?>> predicateContributor) {
return selectEntity().where( predicateContributor );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@
import org.hibernate.search.engine.search.predicate.SearchPredicate;

/**
* A generic superinterface for "simple boolean operator predicate" DSL steps that involve collecting
* <a href="SimpleBooleanOperatorPredicateClausesCollector.html#clauses">clauses</a>.
* A generic superinterface for "simple boolean predicate" DSL steps that involve collecting
* <a href="SimpleBooleanPredicateClausesCollector.html#clauses">clauses</a>.
* <p>
* See also {@link PredicateScoreStep} or {@link PredicateFinalStep}.
*
* @param <S> The "self" type (the actual exposed type of this collector).
* @param <C> The "collector" type (the type of collector passed to the consumer in {@link #with(Consumer)}).
*/
public interface GenericSimpleBooleanOperatorPredicateClausesStep
public interface GenericSimpleBooleanPredicateClausesStep
<
S extends C,
C extends SimpleBooleanOperatorPredicateClausesCollector<?>
C extends SimpleBooleanPredicateClausesCollector<?>
>
extends SimpleBooleanOperatorPredicateClausesCollector<C>, PredicateFinalStep {
extends SimpleBooleanPredicateClausesCollector<C>, PredicateFinalStep {
@Override
default S add(PredicateFinalStep searchPredicate)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
package org.hibernate.search.engine.search.predicate.dsl;

/**
* An object where the <a href="SimpleBooleanOperatorPredicateClausesCollector.html#clauses">clauses</a>
* An object where the <a href="SimpleBooleanPredicateClausesCollector.html#clauses">clauses</a>
* of a {@link SearchPredicateFactory#nested(String) nested predicate} can be set.
* <p>
* The resulting nested predicate must match <em>all</em> inner clauses,
* similarly to an {@link SearchPredicateFactory#and() "and" predicate}.
*/
public interface NestedPredicateClausesCollector<S extends NestedPredicateClausesCollector<?>>
extends SimpleBooleanOperatorPredicateClausesCollector<S> {
extends SimpleBooleanPredicateClausesCollector<S> {

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@

/**
* The step in a nested predicate definition where
* <a href="SimpleBooleanOperatorPredicateClausesCollector.html#clauses">clauses</a> can be added.
* <a href="SimpleBooleanPredicateClausesCollector.html#clauses">clauses</a> can be added.
* <p>
* The resulting nested predicate must match <em>all</em> inner clauses,
* similarly to an {@link SearchPredicateFactory#and() "and" predicate}.
*
* @param <S> The "self" type (the actual exposed type of this step).
*/
public interface NestedPredicateClausesStep<S extends NestedPredicateClausesStep<?>>
extends GenericSimpleBooleanOperatorPredicateClausesStep<S, NestedPredicateClausesCollector<?>>,
extends GenericSimpleBooleanPredicateClausesStep<S, NestedPredicateClausesCollector<?>>,
NestedPredicateClausesCollector<NestedPredicateClausesCollector<?>> {

// TODO HSEARCH-3090 add tuning methods, like the "score_mode" in Elasticsearch (avg, min, ...)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,16 @@ public interface SearchPredicateFactory {
* Match documents if they match all inner clauses.
*
* @return The initial step of a DSL where predicates that must match can be added and options can be set.
* @see GenericSimpleBooleanOperatorPredicateClausesStep
* @see GenericSimpleBooleanPredicateClausesStep
*/
SimpleBooleanOperatorPredicateClausesStep<?> and();
SimpleBooleanPredicateClausesStep<?> and();

/**
* Match documents if they match all previously-built {@link SearchPredicate}.
*
* @return The step of a DSL where options can be set.
*/
SimpleBooleanOperatorPredicateOptionsStep<?> and(
SimpleBooleanPredicateOptionsStep<?> and(
SearchPredicate firstSearchPredicate,
SearchPredicate... otherSearchPredicates);

Expand All @@ -105,31 +105,31 @@ SimpleBooleanOperatorPredicateOptionsStep<?> and(
*
* @return The step of a DSL where options can be set.
*/
SimpleBooleanOperatorPredicateOptionsStep<?> and(PredicateFinalStep firstSearchPredicate,
SimpleBooleanPredicateOptionsStep<?> and(PredicateFinalStep firstSearchPredicate,
PredicateFinalStep... otherSearchPredicates);

/**
* Match documents if they match any inner clause.
*
* @return The initial step of a DSL where predicates that should match can be added and options can be set.
* @see GenericSimpleBooleanOperatorPredicateClausesStep
* @see GenericSimpleBooleanPredicateClausesStep
*/
SimpleBooleanOperatorPredicateClausesStep<?> or();
SimpleBooleanPredicateClausesStep<?> or();

/**
* Match documents if they match any previously-built {@link SearchPredicate}.
*
* @return The step of a DSL where options can be set.
*/
SimpleBooleanOperatorPredicateOptionsStep<?> or(SearchPredicate firstSearchPredicate,
SimpleBooleanPredicateOptionsStep<?> or(SearchPredicate firstSearchPredicate,
SearchPredicate... otherSearchPredicates);

/**
* Match documents if they match any clause.
*
* @return The step of a DSL where options can be set.
*/
SimpleBooleanOperatorPredicateOptionsStep<?> or(PredicateFinalStep firstSearchPredicate,
SimpleBooleanPredicateOptionsStep<?> or(PredicateFinalStep firstSearchPredicate,
PredicateFinalStep... otherSearchPredicates);

/**
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import org.hibernate.search.engine.search.predicate.SearchPredicate;

/**
* An object where the clauses and options of a simple boolean operator predicate
* An object where the clauses and options of a simple boolean predicate
* ({@link SearchPredicateFactory#and() and}, {@link SearchPredicateFactory#or() or})
* can be set.
*
Expand Down Expand Up @@ -44,7 +44,7 @@
*
* @param <S> The "self" type (the actual exposed type of this collector).
*/
public interface SimpleBooleanOperatorPredicateClausesCollector<S extends SimpleBooleanOperatorPredicateClausesCollector<?>> {
public interface SimpleBooleanPredicateClausesCollector<S extends SimpleBooleanPredicateClausesCollector<?>> {
/**
* Adds the specified predicate to the list of <a href="#clauses">clauses</a>.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Hibernate Search, full-text search for your domain model
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.search.engine.search.predicate.dsl;

/**
* The initial and final step in a "simple boolean predicate" definition,
* where <a href="SimpleBooleanPredicateClausesCollector.html#clauses">clauses</a>
* can be added and options can be set.
*
* @param <S> The "self" type (the actual exposed type of this step).
*/
public interface SimpleBooleanPredicateClausesStep<S extends SimpleBooleanPredicateClausesStep<?>>
extends GenericSimpleBooleanPredicateClausesStep<S, SimpleBooleanPredicateClausesCollector<?>>,
SimpleBooleanPredicateOptionsStep<S> {

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
package org.hibernate.search.engine.search.predicate.dsl;

/**
* The initial and final step in a "simple boolean operator predicate" definition, where options can be set.
* The initial and final step in a "simple boolean predicate" definition, where options can be set.
*
* @param <S> The "self" type (the actual exposed type of this step).
*/
public interface SimpleBooleanOperatorPredicateOptionsStep<S extends SimpleBooleanOperatorPredicateOptionsStep<?>>
public interface SimpleBooleanPredicateOptionsStep<S extends SimpleBooleanPredicateOptionsStep<?>>
extends PredicateScoreStep<S>, PredicateFinalStep {

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,17 @@
import java.util.function.Function;

import org.hibernate.search.engine.search.predicate.SearchPredicate;
import org.hibernate.search.engine.search.predicate.dsl.BooleanPredicateOptionsCollector;
import org.hibernate.search.engine.search.predicate.dsl.GenericSimpleBooleanOperatorPredicateClausesStep;
import org.hibernate.search.engine.search.predicate.dsl.GenericSimpleBooleanPredicateClausesStep;
import org.hibernate.search.engine.search.predicate.dsl.PredicateFinalStep;
import org.hibernate.search.engine.search.predicate.dsl.SearchPredicateFactory;
import org.hibernate.search.engine.search.predicate.dsl.SimpleBooleanOperatorPredicateClausesCollector;
import org.hibernate.search.engine.search.predicate.dsl.SimpleBooleanOperatorPredicateClausesStep;
import org.hibernate.search.engine.search.predicate.dsl.SimpleBooleanPredicateClausesCollector;
import org.hibernate.search.engine.search.predicate.dsl.spi.AbstractPredicateFinalStep;
import org.hibernate.search.engine.search.predicate.dsl.spi.SearchPredicateDslContext;
import org.hibernate.search.engine.search.predicate.spi.BooleanPredicateBuilder;

public abstract class AbstractSimpleBooleanOperatorPredicateClausesStep<S extends C, C extends SimpleBooleanOperatorPredicateClausesCollector<?>>
public abstract class AbstractSimpleBooleanPredicateClausesStep<S extends C, C extends SimpleBooleanPredicateClausesCollector<?>>
extends AbstractPredicateFinalStep
implements GenericSimpleBooleanOperatorPredicateClausesStep<S, C> {
implements GenericSimpleBooleanPredicateClausesStep<S, C> {

public enum SimpleBooleanPredicateOperator
implements BiConsumer<BooleanPredicateBuilder, SearchPredicate> {
Expand All @@ -49,7 +47,7 @@ public void accept(BooleanPredicateBuilder builder,

private final SearchPredicateFactory factory;

AbstractSimpleBooleanOperatorPredicateClausesStep(SimpleBooleanPredicateOperator operator,
AbstractSimpleBooleanPredicateClausesStep(SimpleBooleanPredicateOperator operator,
SearchPredicateDslContext<?> dslContext,
SearchPredicateFactory factory) {
super( dslContext );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


public final class NestedPredicateClausesStepImpl
extends AbstractSimpleBooleanOperatorPredicateClausesStep<NestedPredicateClausesStepImpl, NestedPredicateClausesCollector<?>>
extends AbstractSimpleBooleanPredicateClausesStep<NestedPredicateClausesStepImpl, NestedPredicateClausesCollector<?>>
implements NestedPredicateClausesStep<NestedPredicateClausesStepImpl> {

private final NestedPredicateBuilder builder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@
import org.hibernate.search.engine.search.predicate.SearchPredicate;
import org.hibernate.search.engine.search.predicate.dsl.PredicateFinalStep;
import org.hibernate.search.engine.search.predicate.dsl.SearchPredicateFactory;
import org.hibernate.search.engine.search.predicate.dsl.SimpleBooleanOperatorPredicateClausesCollector;
import org.hibernate.search.engine.search.predicate.dsl.SimpleBooleanOperatorPredicateClausesStep;
import org.hibernate.search.engine.search.predicate.dsl.SimpleBooleanPredicateClausesCollector;
import org.hibernate.search.engine.search.predicate.dsl.SimpleBooleanPredicateClausesStep;
import org.hibernate.search.engine.search.predicate.dsl.spi.SearchPredicateDslContext;

public final class SimpleBooleanOperatorPredicateClausesStepImpl
extends AbstractSimpleBooleanOperatorPredicateClausesStep<SimpleBooleanOperatorPredicateClausesStepImpl, SimpleBooleanOperatorPredicateClausesCollector<?>>
implements SimpleBooleanOperatorPredicateClausesStep<SimpleBooleanOperatorPredicateClausesStepImpl> {
public final class SimpleBooleanPredicateClausesStepImpl
extends AbstractSimpleBooleanPredicateClausesStep<SimpleBooleanPredicateClausesStepImpl, SimpleBooleanPredicateClausesCollector<?>>
implements SimpleBooleanPredicateClausesStep<SimpleBooleanPredicateClausesStepImpl> {

public SimpleBooleanOperatorPredicateClausesStepImpl(SimpleBooleanPredicateOperator operator,
public SimpleBooleanPredicateClausesStepImpl(SimpleBooleanPredicateOperator operator,
SearchPredicateDslContext<?> dslContext,
SearchPredicateFactory factory) {
super( operator, dslContext, factory );
}

public SimpleBooleanOperatorPredicateClausesStepImpl(SimpleBooleanPredicateOperator operator,
public SimpleBooleanPredicateClausesStepImpl(SimpleBooleanPredicateOperator operator,
SearchPredicateDslContext<?> dslContext,
SearchPredicateFactory factory,
SearchPredicate firstSearchPredicate,
Expand All @@ -35,7 +35,7 @@ public SimpleBooleanOperatorPredicateClausesStepImpl(SimpleBooleanPredicateOpera
}
}

public SimpleBooleanOperatorPredicateClausesStepImpl(SimpleBooleanPredicateOperator operator,
public SimpleBooleanPredicateClausesStepImpl(SimpleBooleanPredicateOperator operator,
SearchPredicateDslContext<?> dslContext,
SearchPredicateFactory factory,
PredicateFinalStep firstSearchPredicate,
Expand All @@ -48,7 +48,7 @@ public SimpleBooleanOperatorPredicateClausesStepImpl(SimpleBooleanPredicateOpera
}

@Override
protected SimpleBooleanOperatorPredicateClausesStepImpl self() {
protected SimpleBooleanPredicateClausesStepImpl self() {
return this;
}
}

0 comments on commit a533a10

Please sign in to comment.