please review draft JEP: Convenience Factory Methods for Collections

Michael Kay mike at saxonica.com
Thu Jul 17 07:57:16 UTC 2014


On 17 Jul 2014, at 08:21, Michael Kay <mike at saxonica.com> wrote:

> Set.of() and List.of() look very attractive; Map.of() looks very ugly.
> 
> I would much prefer to write something like
> 
> Map.of(
>  Map.pair(key, value),
>  Map.pair(key, value),
>  Map.pair(key, value)
> );
> 

Another style that would work for me is

Map
  .add(key,value)
  .add(key,value)
  .add(key,value)
  .add(key,value);

Michael Kay
Saxonica
  




More information about the core-libs-dev mailing list