public interface SearchPredicateFactoryExtensionContext
SearchPredicateFactoryContext
.Modifier and Type | Method and Description |
---|---|
<T> SearchPredicateFactoryExtensionContext |
ifSupported(SearchPredicateFactoryContextExtension<T> extension,
Function<T,SearchPredicate> predicateContributor)
If the given extension is supported, and none of the previous extensions passed to
ifSupported(SearchPredicateFactoryContextExtension, Function)
was supported, extend the current context with this extension,
and apply the given consumer to the extended context. |
SearchPredicate |
orElse(Function<SearchPredicateFactoryContext,SearchPredicate> predicateContributor)
If no extension passed to
ifSupported(SearchPredicateFactoryContextExtension, Function)
was supported so far, apply the given consumer to the current (non-extended) SearchPredicateFactoryContext ;
otherwise do nothing. |
SearchPredicate |
orElseFail()
If no extension passed to
ifSupported(SearchPredicateFactoryContextExtension, Function)
was supported so far, throw an exception; otherwise do nothing. |
<T> SearchPredicateFactoryExtensionContext ifSupported(SearchPredicateFactoryContextExtension<T> extension, Function<T,SearchPredicate> predicateContributor)
ifSupported(SearchPredicateFactoryContextExtension, 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.predicateContributor
- A function that will use the (extended) context passed in parameter to create a SearchPredicate
,
if the extension is successfully applied.
Should generally be a lambda expression.this
, for method chaining.SearchPredicate orElse(Function<SearchPredicateFactoryContext,SearchPredicate> predicateContributor)
ifSupported(SearchPredicateFactoryContextExtension, Function)
was supported so far, apply the given consumer to the current (non-extended) SearchPredicateFactoryContext
;
otherwise do nothing.predicateContributor
- A function that will use the (non-extended) context passed in parameter to create a SearchPredicate
,
if the extension is successfully applied.
Should generally be a lambda expression.SearchPredicate orElseFail()
ifSupported(SearchPredicateFactoryContextExtension, Function)
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.