public interface SearchSortFactoryExtensionContext
SearchSortFactoryContext.SearchSortFactoryContext.extension()| Modifier and Type | Method and Description |
|---|---|
<T> SearchSortFactoryExtensionContext |
ifSupported(SearchSortFactoryContextExtension<T> extension,
Function<T,? extends SearchSortTerminalContext> sortContributor)
If the given extension is supported, and none of the previous extensions passed to
ifSupported(SearchSortFactoryContextExtension, Function)
was supported, extend the current context with this extension,
and apply the given consumer to the extended context. |
NonEmptySortContext |
orElse(Function<SearchSortFactoryContext,? extends SearchSortTerminalContext> sortContributor)
If no extension passed to
ifSupported(SearchSortFactoryContextExtension, Function)
was supported so far, apply the given consumer to the current (non-extended) SearchSortFactoryContext;
otherwise do nothing. |
NonEmptySortContext |
orElseFail()
If no extension passed to
ifSupported(SearchSortFactoryContextExtension, Function)
was supported so far, throw an exception; otherwise do nothing. |
<T> SearchSortFactoryExtensionContext ifSupported(SearchSortFactoryContextExtension<T> extension, Function<T,? extends SearchSortTerminalContext> sortContributor)
ifSupported(SearchSortFactoryContextExtension, Function)
was supported, extend the current context with this extension,
and apply the given consumer to the extended context.
This method cannot be called after orElse(Function) or orElseFail().
T - The type of the extended context.extension - The extension to apply.sortContributor - A function called if the extension is successfully applied;
it will use the (extended) DSL context passed in parameter to create a sort,
returning the resulting terminal context.
Should generally be a lambda expression.this, for method chaining.NonEmptySortContext orElse(Function<SearchSortFactoryContext,? extends SearchSortTerminalContext> sortContributor)
ifSupported(SearchSortFactoryContextExtension, Function)
was supported so far, apply the given consumer to the current (non-extended) SearchSortFactoryContext;
otherwise do nothing.sortContributor - A function called if no extension was successfully applied;
it will use the (extended) DSL context passed in parameter to create a sort,
returning the resulting terminal context.
Should generally be a lambda expression.NonEmptySortContext orElseFail()
ifSupported(SearchSortFactoryContextExtension, Function)
was supported so far, throw an exception; otherwise do nothing.SearchException - If none of the previously passed extensions was supported.Copyright © 2006-2019 Red Hat, Inc. and others. Licensed under the GNU Lesser General Public License (LGPL), version 2.1 or later.