What is the best way to filter a Java Collection?

后端 未结 27 3323
故里飘歌
故里飘歌 2020-11-21 06:55

I want to filter a java.util.Collection based on a predicate.

27条回答
  •  我在风中等你
    2020-11-21 07:24

    Consider Google Collections for an updated Collections framework that supports generics.

    UPDATE: The google collections library is now deprecated. You should use the latest release of Guava instead. It still has all the same extensions to the collections framework including a mechanism for filtering based on a predicate.

提交回复
热议问题