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