-
Notifications
You must be signed in to change notification settings - Fork 38.9k
Closed as not planned
Closed as not planned
Copy link
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)status: declinedA suggestion or change that we don't feel we should currently applyA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancementA general enhancement
Description
Yanming Zhou opened SPR-17170 and commented
ObjectProvider should accept Function as argument like Consumer #20550
public default <R> Optional<R> ifAvailable(Function<T, R> dependencyFunction) throws BeansException {
T dependency = getIfAvailable();
if (dependency != null) {
return Optional.ofNullable(dependencyFunction.apply(dependency));
}
return Optional.empty();
}
public default <R> Optional<R> ifUnique(Function<T, R> dependencyFunction) throws BeansException {
T dependency = getIfUnique();
if (dependency != null) {
return Optional.ofNullable(dependencyFunction.apply(dependency));
}
return Optional.empty();
}No further details from SPR-17170
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)status: declinedA suggestion or change that we don't feel we should currently applyA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancementA general enhancement