Closed
Description
Original issue created by drothmaler on 2012-01-25 at 03:13 PM
When building immutalbe maps/lists you allways have the problem, that you will have respecify the element type, with the builder method.
So you end up writing things like:
public static final ImmutableMap<String, String> STRINGS = ImmutableMap.<String, String> builder()
.put("A", "Foo")
.put("B", "Foo")
.put("C", "Foo")
.build();
If you had a "builder" method, that takes the first value(-pair) you could write:
public static final ImmutableMap<String, String> STRINGS =
ImmutableMap
.builder("A", "Foo")
.put("B", "Foo")
.put("C", "Foo")
.build();
It also could be named "put" instead.