Google Collections (Guava Libraries): ImmutableSet/List/Map and Filtering

后端 未结 2 964
轮回少年
轮回少年 2021-01-18 05:34

Assume that you want to build a copy of an ImmutableSet/List/Map object but filter out some of the original entries. One way to implem

2条回答
  •  一向
    一向 (楼主)
    2021-01-18 06:09

    The result of Iterables.filter() is just a view over the data in myObject: the new list is only built by ImmutableList.copyOf() using the filtering iterator provided by the Iterable

提交回复
热议问题