title: How to convert String into Hashmap in java
body: <p>How can I convert a <code>String</code> into a <code>HashMap</code>?</p>
  
  <pre class="lang-java prettyprint-override"><code>String value = "{first_name = naresh, last_name = kumar, gender = male}"
  </code></pre>
  
  <p>into</p>
  
  <pre class="lang-java prettyprint-override"><code>Map&lt;Object, Object&gt; = {
      first_name = naresh,
      last_name = kumar,
      gender = male
  }
  </code></pre>
  
  <p>Where the keys are <code>first_name</code>, <code>last_name</code> and <code>gender</code> and the values are <code>naresh</code>, <code>kumar</code>, <code>male</code>.</p>
  
  <p><strong>Note:</strong> Keys can be any thing like <code>city = hyderabad</code>.</p>
  
  <p>I am looking for a generic approach.</p>