Closed
Description
Christoph Dreis opened SPR-16894 and commented
Hi,
while doing a PR in Spring-Boot polishing some stream creations, I figured that I could do even more cleanups if Spring-Framework would deliver a default implementation for stream support in PropertySources - providing an imho more modern way of interacting with them. E.g. something like that:
/**
* Returns a sequential {@code Stream} for the {@link PropertySource objects}
* contained in this instance.
*/
default Stream<PropertySource<?>> stream() {
return StreamSupport.stream(spliterator(), false);
}
Let me know what you think of the proposal and the attached PR. I'd be happy if the pull request is accepted.
Cheers,
Christoph
Affects: 5.0.6
Issue Links:
- ObjectProvider iterable/stream access for "beans of type" resolution in @Bean methods [SPR-11419] #16046 ObjectProvider iterable/stream access for "beans of type" resolution in
@Bean
methods - Support for Supplier as a deferred bean creation [SPR-16973] #21511 Support for Supplier as a deferred bean creation