Interface SearchProjectionFactoryExtensionIfSupportedMoreStep<P,R,E>
-
- Type Parameters:
R- The type of entity references in the parentSearchProjectionFactory.E- The type of entities in the parentSearchProjectionFactory.P- The resulting projection type.
- All Superinterfaces:
SearchProjectionFactoryExtensionIfSupportedStep<P,R,E>
public interface SearchProjectionFactoryExtensionIfSupportedMoreStep<P,R,E> extends SearchProjectionFactoryExtensionIfSupportedStep<P,R,E>
The second and later step when attempting to apply multiple extensions to aSearchProjectionFactory.- See Also:
SearchProjectionFactory.extension()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ProjectionFinalStep<P>orElse(Function<SearchProjectionFactory<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)SearchProjectionFactory; otherwise return the projection created in the first succeedingifSupportedcall.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.-
Methods inherited from interface org.hibernate.search.engine.search.projection.dsl.SearchProjectionFactoryExtensionIfSupportedStep
ifSupported
-
-
-
-
Method Detail
-
orElse
ProjectionFinalStep<P> orElse(Function<SearchProjectionFactory<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)SearchProjectionFactory; 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:
SearchException- If none of the previously passed extensions was supported.
-
-