Skip to content
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

Replace Iterable<String> in Config methods with Stream<String> #36

Closed
gastaldi opened this issue Jan 24, 2017 · 2 comments
Closed

Replace Iterable<String> in Config methods with Stream<String> #36

gastaldi opened this issue Jan 24, 2017 · 2 comments
Milestone

Comments

@gastaldi
Copy link

gastaldi commented Jan 24, 2017

Stream<String> is a much cleaner and better API to deal with Collections than Iterable itself. One could perform operations like count, filter, collect without the need to transform the Iterable into another data structure.

ps: It's possible for the API consumer to use StreamSupport.stream(iterable,parallel) if desired, but that's not so intuitive

@Emily-Jiang
Copy link
Member

Stream is not to replace collections or Iterable. It is an interface to make data operation easier and faster. As you may know, stream is a one-time user of object and can not be traversed multiple times. I think Iterable is a better choice for the interface. If the consumer wants to filter and find elements, it is very easy to use Stream api to generate a stream to operate on.

@Emily-Jiang
Copy link
Member

Please reopen if you have further comments.

@struberg struberg modified the milestone: config-1.0 Mar 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants