Support for java.util.Optional with @Inject (a la @Autowired's required=false) [SPR-11833] #16452
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
Milestone
Juergen Hoeller opened SPR-11833 and commented
Java 8's
java.util.Optional
is a new common type to mark references as non-required. It'd be nice to support this with@Inject
at the injection point level, as an alternative to@Autowired
'srequired=false
attribute.Issue Links:
@RequestParam
@Nullable
annotations as indicators for optional injection points@Bean
method parameters using java.util.OptionalReferenced from: commits 5cb3f8e, 7d03daf
The text was updated successfully, but these errors were encountered: