title: Best way to code this, string to map conversion in Groovy
body: <p>I have a string like</p>
  
  <pre><code>def data = "session=234567893egshdjchasd&amp;userId=12345673456&amp;timeOut=1800000"
  </code></pre>
  
  <p>I want to convert it to a map</p>
  
  <pre><code> ["session", 234567893egshdjchasd]
   ["userId", 12345673456]
   ["timeout", 1800000]
  </code></pre>
  
  <p>This is the current way I am doing it, </p>
  
  <pre><code> def map = [:]
  
   data.splitEachLine("&amp;"){
  
     it.each{ x -&gt;
  
       def object = x.split("=")
       map.put(object[0], object[1])
  
     }
  
   }
  </code></pre>
  
  <p>It works, but is there a more efficient way?</p>