ImmutableMap.of() workaround for HashMap in Maps?

前端 未结 5 794
独厮守ぢ
独厮守ぢ 2020-12-29 03:40

There are utility methods to create ImmutableMap like Immutable.of(Key, value) and its overload.

But such methods don\'t exist for

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-29 04:06

    cannot you use the copyOf method of ImmutableMap described here?

    it should be something like

    Map newImmutableMap = ImmutableMap.copyOf(yourMap);
    

提交回复
热议问题