-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
Please explain why Lists doesn't have filter method #505
Comments
Original comment posted by neveue on 2010-12-30 at 11:45 PM Hey koppernickus, This was already discussed in the google-collections issues / group, but your question is legitimate since there is no mention of it in the guava project's issues / group ;) Guava does not provide such a method, because the filtered List view would have very poor performance.
For these reasons, it is preferable to let the developer do the copy himself: If you really want the syntactical sugar, and you know which implementation type you want to use in your project, you could create a static utility method that hides this boilerplate. More info: |
Original comment posted by neveue on 2010-12-31 at 12:15 AM Woops, just saw the related thread in the Google Group. It seems like you already knew all of this... Anyway, I'll link it here, since it's related: |
Original comment posted by boppenheim@google.com on 2010-12-31 at 04:54 AM Seems like the question has been sufficiently answered. Status: |
Original comment posted by koppernickus on 2010-12-31 at 09:57 AM Thanks for explanation, but what I really meant was explaining it on Wiki. |
Original comment posted by boppenheim@google.com on 2010-12-31 at 06:47 PM Great idea, its done. |
Original comment posted by wasserman.louis on 2011-12-28 at 05:55 PM Issue #848 has been merged into this issue. |
Original comment posted by wasserman.louis on 2012-04-04 at 02:04 PM Issue #958 has been merged into this issue. |
Original comment posted by cgdecker on 2012-04-04 at 03:20 PM Issue #959 has been merged into this issue. |
Original issue created by koppernickus on 2010-12-27 at 07:51 AM
I can see in idea graveyard that Lists.filter is one of rejected ideas. Could you please explain there why?
My motivation for Lists.filter is the need for transforming Iterable to List when using existing code requiring List as input. It would be more readable to use Lists.filter() instead of Lists.newArrayList(Collections2.filter())...
The text was updated successfully, but these errors were encountered: