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 using
SortThenStep.then()
.-
Method Summary
Modifier and TypeMethodDescriptionappend
(SearchSort sort) Create a new context with a sort appended.static <SC extends SearchSortIndexScope<?>,
PDF extends SearchPredicateFactory>
SearchSortDslContext<SC, PDF> root
(SC scope, Function<SearchSortDslContext<SC, PDF>, SearchSortFactory> factoryProvider, PDF predicateFactory) scope()
then()
toSort()
Create aSearchSort
instance matching the definition given in the previous DSL steps.
-
Method Details
-
root
public static <SC extends SearchSortIndexScope<?>,PDF extends SearchPredicateFactory> SearchSortDslContext<SC,PDF> root(SC scope, Function<SearchSortDslContext<SC, PDF>, SearchSortFactory> factoryProvider, PDF predicateFactory) -
scope
- Returns:
- The search scope.
-
then
- Returns:
- A new factory to be returned by
SortThenStep.then()
.
-
rescope
- 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
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
- Returns:
- The predicate factory. Will always return the exact same instance.
-
toSort
Create aSearchSort
instance matching the definition given in the previous DSL steps.- Returns:
- The
SearchSort
instance.
-