Class SearchSortDslContext<SR,SC extends SearchSortIndexScope<?>,PDF extends SearchPredicateFactory<SR>>
java.lang.Object
org.hibernate.search.engine.search.sort.dsl.spi.SearchSortDslContext<SR,SC,PDF>
- Type Parameters:
SR
- Scope root type.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<SR,SC extends SearchSortIndexScope<?>,PDF extends SearchPredicateFactory<SR>>
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 <SR,
SC extends SearchSortIndexScope<?>, PDF extends SearchPredicateFactory<SR>>
SearchSortDslContext<SR, SC, PDF> root
(SC scope, Function<SearchSortDslContext<SR, SC, PDF>, SearchSortFactory<SR>> factoryProvider, PDF predicateFactory) scope()
then()
toSort()
Create aSearchSort
instance matching the definition given in the previous DSL steps.
-
Method Details
-
root
public static <SR,SC extends SearchSortIndexScope<?>, SearchSortDslContext<SR,PDF extends SearchPredicateFactory<SR>> SC, rootPDF> (SC scope, Function<SearchSortDslContext<SR, SC, PDF>, SearchSortFactory<SR>> 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.
-