title: How can I create a map from object properties?
body: <p>I get an object via some 3rd party api. I use a wrapper function to get it and then return a map from its properties:</p>
  
  <pre><code>wrapperFunc() {
      def myObj = someapi.getblah().getSomeObect()
      return [
          aaa: myObj.aaa,
          bbb: myObj.bbb,
          ccc: myObj.ccc
      ]
  }
  </code></pre>
  
  <p>Now I could manually go through EVERY property in the object like this, but is there an elegant groovy feature to dynamically build a map from the object's properties?</p>