public interface SearchSortContainerExtensionContext
SearchSortContainerContext
.SearchSortContainerContext.extension()
Modifier and Type | Method and Description |
---|---|
<T> SearchSortContainerExtensionContext |
ifSupported(SearchSortContainerContextExtension<T> extension,
Consumer<T> sortContributor)
If the given extension is supported, and none of the previous extensions passed to
ifSupported(SearchSortContainerContextExtension, Consumer)
was supported, extend the current context with this extension,
and apply the given consumer to the extended context. |
NonEmptySortContext |
orElse(Consumer<SearchSortContainerContext> sortContributor)
If no extension passed to
ifSupported(SearchSortContainerContextExtension, Consumer)
was supported so far, apply the given consumer to the current (non-extended) SearchSortContainerContext ;
otherwise do nothing. |
NonEmptySortContext |
orElseFail()
If no extension passed to
ifSupported(SearchSortContainerContextExtension, Consumer)
was supported so far, throw an exception; otherwise do nothing. |
<T> SearchSortContainerExtensionContext ifSupported(SearchSortContainerContextExtension<T> extension, Consumer<T> sortContributor)
ifSupported(SearchSortContainerContextExtension, Consumer)
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(Consumer)
or orElseFail()
.
T
- The type of the extended context.extension
- The extension to apply.sortContributor
- A consumer that will add a sort to the (extended) context passed in parameter,
if the extension is successfully applied.
Should generally be a lambda expression.this
, for method chaining.NonEmptySortContext orElse(Consumer<SearchSortContainerContext> sortContributor)
ifSupported(SearchSortContainerContextExtension, Consumer)
was supported so far, apply the given consumer to the current (non-extended) SearchSortContainerContext
;
otherwise do nothing.sortContributor
- A consumer that will add a sort to the (non-extended) SearchSortContainerContext
.
Should generally be a lambda expression.NonEmptySortContext orElseFail()
ifSupported(SearchSortContainerContextExtension, Consumer)
was supported so far, throw an exception; otherwise do nothing.SearchException
- If none of the previously passed extensions was supported.Copyright © 2006-2018 Red Hat, Inc. and others. Licensed under the GNU Lesser General Public License (LGPL), version 2.1 or later.