Guava: Set + Function = Map?

前端 未结 6 1125
眼角桃花
眼角桃花 2021-02-05 01:40

Is there an idiomatic way to take a Set and a Function, and get a Map live view? (i.e. the Map

6条回答
  •  日久生厌
    2021-02-05 02:44

    Guava 14 now has Maps.asMap for a view of the Set and Maps.toMap for an immutable copy.

    You can see much of the discussion of the issues involved here: https://github.com/google/guava/issues/56

提交回复
热议问题