3 ms·
Guava has some tools that make map literals a little prettier: Map<Foo, Bar> map = ImmutableMap.of(foo1, bar1, foo2, bar2, foo3, bar3, foo4, bar4); There ar
by stickfigure 11y ago
Guava has some tools that make map literals a little prettier:
Map<Foo, Bar> map = ImmutableMap.of(foo1, bar1, foo2, bar2, foo3, bar3, foo4, bar4);
There are overloads for up to 5 entries, and they're even key/value typesafe.