How to put an Entry into a Map?

后端 未结 4 1168
你的背包
你的背包 2021-01-03 17:36

Is there any way that I can put a whole Entry object to a Map object like:

map.put(entry);

instead of passing a k

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-03 18:14

    Guava's ImmutableMap.Builder takes entries directly.

    Obviously that doesn't directly modify an existing Map, but it might well scratch the same itch.

提交回复
热议问题