You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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.
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 intuitiveThe text was updated successfully, but these errors were encountered: