Class SearchSortDslContext<SC extends SearchSortIndexScope<?>,PDF extends SearchPredicateFactory>
- java.lang.Object
-
- org.hibernate.search.engine.search.sort.dsl.spi.SearchSortDslContext<SC,PDF>
-
- Type Parameters:
SC
- The type of the backend-specific search scope.PDF
- The type of factory used to create predicates inSortFilterStep.filter(Function)
.
public final class SearchSortDslContext<SC extends SearchSortIndexScope<?>,PDF extends SearchPredicateFactory> extends Object
Represents the current context in the search DSL, including in particular the search scope, the sort builder factory and the knowledge of previous sorts chained usingSortThenStep.then()
.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SearchSortDslContext<SC,PDF>
append(SearchSort sort)
Create a new context with a sort appended.PDF
predicateFactory()
SearchSortDslContext<SC,PDF>
rescope(SC newScope, PDF newPredicateFactory)
static <SC extends SearchSortIndexScope<?>,PDF extends SearchPredicateFactory>
SearchSortDslContext<SC,PDF>root(SC scope, Function<SearchSortDslContext<SC,PDF>,SearchSortFactory> factoryProvider, PDF predicateFactory)
SC
scope()
SearchSortFactory
then()
SearchSort
toSort()
Create aSearchSort
instance matching the definition given in the previous DSL steps.
-
-
-
Method Detail
-
root
public static <SC extends SearchSortIndexScope<?>,PDF extends SearchPredicateFactory> SearchSortDslContext<SC,PDF> root(SC scope, Function<SearchSortDslContext<SC,PDF>,SearchSortFactory> factoryProvider, PDF predicateFactory)
-
scope
public SC scope()
- Returns:
- The search scope.
-
then
public SearchSortFactory then()
- Returns:
- A new factory to be returned by
SortThenStep.then()
.
-
rescope
public SearchSortDslContext<SC,PDF> rescope(SC newScope, PDF newPredicateFactory)
- Parameters:
newScope
- The new scope for the new DSL context.newPredicateFactory
- The new predicate factory for the new DSL context.- Returns:
- A copy of this DSL context with its scope and predicate factory replaced with the given ones.
-
append
public SearchSortDslContext<SC,PDF> append(SearchSort sort)
Create a new context with a sort appended.- Parameters:
sort
- The sort to add.- Returns:
- A new DSL context, with the given builder appended.
-
predicateFactory
public PDF predicateFactory()
- Returns:
- The predicate factory. Will always return the exact same instance.
-
toSort
public SearchSort toSort()
Create aSearchSort
instance matching the definition given in the previous DSL steps.- Returns:
- The
SearchSort
instance.
-
-