title: Groovy: Setting property values easily
body: <p>I have a map with name/value pairs:</p>
  
  <pre><code>def myMap = [
    "username"  : "myname",
    "age" : 30,
    "zipcode" : 10010
  ]
  </code></pre>
  
  <p>I have a class called User defined:</p>
  
  <pre><code>class User {
    def username;
    def age;
    def zipcode;
  }
  </code></pre>
  
  <p>I would like to invoke the appropriate setters on the bean.  Is there a nice groovy way of doing this?  Note, I might have extra stuff in the myMap that wouldn't be set.  (The map is a form parameter values map)</p>
  
  <p>I was thinking about using invokeMethod but I was assuming there was a better way.</p>