Groovy like map constructor

I miss so much the Groovy like map constructor in Java that I have created my own.

1public class MyBean{
2  public MyBean(Map<String, ?> map){
3    JakartaPropertyUtils.copyProperties(this, map);
4  }
5}

The copyProperties helper is a simple wrapper around Jakarta commons-beanutils implementation to eliminate useless checked exception handling.

Why is it useful:

Apr 13, 2014
comments powered by Disqus

Links

Cool

RSS