Closed
Description
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
's required=false
attribute.
Issue Links:
- Support for java.util.Optional as a @RequestParam [SPR-11829] #16448 Support for java.util.Optional as a
@RequestParam
- Support @Nullable annotations as indicators for optional injection points [SPR-15028] #19595 Support
@Nullable
annotations as indicators for optional injection points - Allow autowiring of empty collection in @Bean method parameters using java.util.Optional [SPR-9132] #13771 Allow autowiring of empty collection in
@Bean
method parameters using java.util.Optional - Data binding with java.util.Optional: traversal of nested paths, detection of empty holders [SPR-12241] #16855 Data binding with java.util.Optional: traversal of nested paths, detection of empty holders