Re: [lang] : Question on Usage of Generics

2010-08-06 Thread James Carman
It's in there. Enjoy! On Fri, Aug 6, 2010 at 6:55 PM, Sujit Pal wrote: > fwiw, this approach would be nicer... I frequently use ArrayUtils.toMap > to set maps with different key and value types statically from data. > > -sujit > > On Fri, 2010-08-06 at 18:44 -0400, James Carman wrote: >> For ins

Re: [lang] : Question on Usage of Generics

2010-08-06 Thread Sujit Pal
fwiw, this approach would be nicer... I frequently use ArrayUtils.toMap to set maps with different key and value types statically from data. -sujit On Fri, 2010-08-06 at 18:44 -0400, James Carman wrote: > For instance, this would work: > > Map map = toMap(new Object[][] { > {"re

Re: [lang] : Question on Usage of Generics

2010-08-06 Thread James Carman
I went ahead and committed it. If we decide we don't like it, we can back it out, but I wanted to take care of it while I had the code open. On Fri, Aug 6, 2010 at 6:44 PM, James Carman wrote: > For instance, this would work: > > Map map = toMap(new Object[][] { >                {"red", Color.re

Re: [lang] : Question on Usage of Generics

2010-08-06 Thread James Carman
For instance, this would work: Map map = toMap(new Object[][] { {"red", Color.red}, {"black", Color.black} }); On Fri, Aug 6, 2010 at 6:41 PM, James Carman wrote: > What if we change it to: > > public static Map toMap(Object[] array) > > Then, you can us

Re: [lang] : Question on Usage of Generics

2010-08-06 Thread James Carman
What if we change it to: public static Map toMap(Object[] array) Then, you can use type inference so you don't have to do any casting! On Fri, Aug 6, 2010 at 4:54 PM, Shekhar Gulati wrote: > Hello, > > I have started playing with latest beta release of Commons-Lang 3.0  and I > have question o

[lang] : Question on Usage of Generics

2010-08-06 Thread Shekhar Gulati
Hello, I have started playing with latest beta release of Commons-Lang 3.0 and I have question on usage of generics in Commons-lang For example, there is a method called toMap in ArrayUtils which could have been easily generified but isn't In Commons-Lang 3.0 public static Map toMap(Object[] a