Closed GoogleCodeExporter closed 9 years ago
I like that. And of course there should be similar factory methods for all the
ImmutableCollection+ builders.
Original comment by SeanPFl...@googlemail.com
on 12 Oct 2012 at 10:05
A few years back, we had a long discussion about this. We are not a fan of
having to write "new ImmutableMap.Builder<String, String>," so we liked the
idea of builder(K, V) to stamp it out. In the end, though, we couldn't
ourselves that it was worth making it more marginally difficult to read and
modify existing code:
.builder("a", "b")
.put("c", "d")
.put("e", "f")
First, it looks a little ragged. Second, removing the first line now requires
changes to two lines:
.builder("c", "d")
.put("e", "f")
We're not certain that we made the right choice, but I think we've spent enough
on the discussion that we've put this to bed.
Maybe, though, we should be looking to increase the number of "fake varargs"
supported by ImmutableMap.of()?
Original comment by cpov...@google.com
on 12 Oct 2012 at 3:59
Original comment by wasserman.louis
on 12 Oct 2012 at 4:06
Original issue reported on code.google.com by
MrChrisP...@googlemail.com
on 12 Oct 2012 at 9:46