ImmutableMap.of() workaround for HashMap in Maps?

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

But such methods don't exist for HashMap or LinkedHashMap in Maps class.

Is there any better way to do this or Guava assumes such a map is always a constant map and ImmutableMap is best option to go with and don't need to provide a utility for HashMap.

28
задан imTachu 1 December 2016 в 10:17
поделиться