JEP 186: Collection Literals
Klaus Malorny
Klaus.Malorny at knipp.de
Wed Jan 15 08:37:54 PST 2014
On 15.01.2014 16:53, Remi Forax wrote:
> On 01/15/2014 04:15 PM, Olivier Allouch wrote:
>>
>> 2. 90% of Map literal are going to be used with String keys.
>
> yes, right.
>
Well, this is definitely not true for me. I am using unmodifiable maps often for
mapping between enum constants (e.g. between JAXB/JAXWS generated enums and
enums from internal model classes). And with Java 8, I started to use maps for
some kind of dispatching, e.g. XML element names (QName) to method references.
Generally, I would find a restriction of the key to java.lang.String as too
limiting.
BTW, I wonder whether it would be practical to create a questionaire about the
personal use cases of literal lists, sets, maps etc.
Regards,
Klaus
More information about the lambda-dev
mailing list