Interface SearchSortFactoryExtensionIfSupportedMoreStep<SR>
- Type Parameters:
SR- Scope root type.
- All Superinterfaces:
SearchSortFactoryExtensionIfSupportedStep<SR>
public interface SearchSortFactoryExtensionIfSupportedMoreStep<SR>
extends SearchSortFactoryExtensionIfSupportedStep<SR>
The second and later step when attempting to apply multiple extensions
to a
TypedSearchSortFactory.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionorElse(Function<TypedSearchSortFactory<SR>, ? extends SortFinalStep> sortContributor) If no extension passed toSearchSortFactoryExtensionIfSupportedStep.ifSupported(SearchSortFactoryExtension, Function)was supported so far, apply the given consumer to the current (non-extended)TypedSearchSortFactory; otherwise return the sort created in the first succeedingifSupportedcall.If no extension passed toSearchSortFactoryExtensionIfSupportedStep.ifSupported(SearchSortFactoryExtension, Function)was supported so far, throw an exception; otherwise return the sort created in the first succeedingifSupportedcall.Methods inherited from interface org.hibernate.search.engine.search.sort.dsl.SearchSortFactoryExtensionIfSupportedStep
ifSupported
-
Method Details
-
orElse
SortThenStep<SR> orElse(Function<TypedSearchSortFactory<SR>, ? extends SortFinalStep> sortContributor) If no extension passed toSearchSortFactoryExtensionIfSupportedStep.ifSupported(SearchSortFactoryExtension, Function)was supported so far, apply the given consumer to the current (non-extended)TypedSearchSortFactory; otherwise return the sort created in the first succeedingifSupportedcall.- Parameters:
sortContributor- A function called if no extension was successfully applied; it will use the (non-extended) sort factory passed in parameter to create a sort, returning the final step in the sort DSL. Should generally be a lambda expression.- Returns:
- The final step in the DSL of the resulting sort.
-
orElseFail
SortThenStep<SR> orElseFail()If no extension passed toSearchSortFactoryExtensionIfSupportedStep.ifSupported(SearchSortFactoryExtension, Function)was supported so far, throw an exception; otherwise return the sort created in the first succeedingifSupportedcall.- Returns:
- The final step in the DSL of the resulting sort.
- Throws:
org.hibernate.search.util.common.SearchException- If none of the previously passed extensions was supported.
-