jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manfred Baedke <manfred.bae...@greenbytes.de>
Subject Re: Generics generator class
Date Mon, 04 May 2009 15:14:28 GMT
Hi,

Jukka Zitting wrote:

> I like the idea, removing clutter is good.
>
> A related common annoyance I run into is about creating an initialized
> collection:
>
>     List<String> abc = Arrays.asList(new String[] { "a", "b", "c" });
>
> or
>
>     List<String> abc = new ArrayList() {{ add("a"); add("b"); add("c"); }};
>
> This would be quite a bit more convenient with a utility method like this:
>
>     List<String> abc = New.list("a", "b", "c");
>   
Thanks to  the Varargs feature it is possible to use

List<String> abc = Arrays.asList("a", "b", "c");

Regards,
Manfred

-- 
Manfred Baedke

<green/>bytes GmbH
Hafenweg 16
D-48155 Münster
Germany
Amtsgericht Münster: HRB5782 


Mime
View raw message