Closed as not planned
Closed as not planned
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