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,
apply the given function to the extended context, and store the resulting predicate for later retrieval. |
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 return the predicate created in the first succeeding ifSupported call. |
SearchPredicate |
orElseFail()
If no extension passed to
ifSupported(SearchPredicateFactoryContextExtension, Function)
was supported so far, throw an exception;
otherwise return the predicate created in the first succeeding ifSupported call. |
<T> SearchPredicateFactoryExtensionContext ifSupported(SearchPredicateFactoryContextExtension<T> extension, Function<T,SearchPredicate> predicateContributor)
ifSupported(SearchPredicateFactoryContextExtension, Function)
was supported, extend the current context with this extension,
apply the given function to the extended context, and store the resulting predicate for later retrieval.
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 return the predicate created in the first succeeding ifSupported
call.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 return the predicate created in the first succeeding ifSupported
call.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.