On Aug 9, 2010, at 7:08 AM, James Carman wrote: > On Mon, Aug 9, 2010 at 7:32 AM, sebb <seb...@gmail.com> wrote: >> Why not split the code into two methods: >> >> public static <K,V> Map<K, V> toMap(Map.Entry<K,V>[] array) >> and >> public static <K,V> Map<K, V> toMap(Class<K> keyType, Class<V> >> valueType, Object[][] array) >> >> Both methods can be made type-safe. >> > > Well, we did just bump the version number, so we are free to do > something like that I guess. Anyone else have any thoughts on the > subject (are you even paying attention anymore)? >
In the spirit of the Map.Entry variant of the method, I would suggest eating our own lang3 dog food and providing: public static <K, V> Map<K, V> toMap(Pair<K, V>... entries) as well. Pair.of("foo", "bar") is certainly a terser option than creating an anonymous implementation of Map.Entry. -Matt > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org