title: How to hashmap a JSON's key-value pair where Value type and number of key-value pairs not known
body: <p>I have a JSON in string format coming from DB, about which I only know that it's in key-value format. I don't know beforehand </p>
  
  <ul>
  <li>How many pairs will be there in JSON string</li>
  <li>type-of Value. It can be String or Object.</li>
  </ul>
  
  <p>Here are some of my JSON String:</p>
  
  <ul>
  <li><code>{"windowHandle":"current"}  \\ in one String: String format</code></li>
  <li><code>{"type":"implicit","ms":100000} \\ in two String: String format</code>  </li>
  <li><code>{"id":"{a67fc38c-10e6-4c5e-87dc-dd45134db570}"} \\ in one String: String format</code> </li>
  <li><code>{"key1": {"sub-key1": "sub-value1", "sub-key2": "sub-value2"}, "key2": {"sub-key2": "sub-value2"}}  \\ in two String: Object format</code>  </li>
  </ul>
  
  <p>So, basically: Number of key-value pair and type of value(String, Object) is not known beforehand.</p>
  
  <p>I want to store this data into my Hashmap. I know that if could be only String: String format, I could do as following <code>put</code> in the Hashmap.</p>
  
  <p><strong>My question is</strong>, </p>
  
  <ul>
  <li>How I can store json in this case efficiently without iterating over JSON String. </li>
  <li>What should be my Hashmap type, definetily not <code>HashMap &lt;String, String&gt;</code> ?</li>
  </ul>
  
  <p>Thanks in Advance !</p>