3 ms·
Check out the Immutable Maps feature, does the same with some nice syntactic sugar - http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/co
by philthom 14y ago
Check out the Immutable Maps feature, does the same with some nice syntactic sugar - http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/collect/ImmutableMap.Builder.html http://docs.guava-libraries.googlecode.com/git/javadoc/com/g...
- jrockway 14y agoYou don't even need to use the Builder directly, just use the structure's "of" method: ImmutableSet<Foo> foos = ImmutableSet.of(a, few, elements); ImmutableMap<Key, Value> map = ImmutableMap.of(k1, v1, k2, v2);