Skip to content

Introduce Stream support in PropertySources and PropertyValues [SPR-16894] #21433

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spring-projects-issues opened this issue Jun 3, 2018 · 1 comment
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Jun 3, 2018

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:

Referenced from: pull request #1847, and commits d8c7270

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

I've applied a broader revision for consistent Iterator as well as Stream support in PropertySources and PropertyValues (both of which are effectively pseudo-collections with quite similar design), with the implementations providing the best possible Spliterator whereas the interfaces just keep alternative implementations working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants