You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Lambda-based consumption of an ObjectProvider's object when available [SPR-16001] #20550
So effectively, this is about syntactic sugar for that kind of code? With ObjectProvider either providing an Optional return variant or, along the lines of your sketch, an ifAvailable(Consumer) convenience method directly?
Activity
spring-projects-issues commentedon Sep 25, 2017
Juergen Hoeller commented
I guess you could write this using
Optionalalready:So effectively, this is about syntactic sugar for that kind of code? With
ObjectProvidereither providing anOptionalreturn variant or, along the lines of your sketch, anifAvailable(Consumer)convenience method directly?spring-projects-issues commentedon Sep 25, 2017
Juergen Hoeller commented
I've introduced corresponding
ifAvailable(Consumer)andifUnique(Consumer)variants, along the lines ofOptional.ifPresent(Consumer).spring-projects-issues commentedon Sep 26, 2017
Andy Wilkinson commented
Thanks!