title: How to iterate a JsonObject (gson)
body: <p>I have a JsonObject e.g</p>
  
  <pre><code>JsonObject jsonObject = {"keyInt":2,"keyString":"val1","id":"0123456"}
  </code></pre>
  
  <p>Every <code>JsonObject</code> contains a <code>"id"</code> entry, but the number of other key/value pairs is NOT determined, so I want to create create an object with 2 attributes:</p>
  
  <pre><code>class myGenericObject {
    Map&lt;String, Object&gt; attributes;
    String id;
  }
  </code></pre>
  
  <p>So I want my attributes map to look like this:</p>
  
  <pre><code>"keyInt" -&gt; 4711
  "keyStr" -&gt; "val1"
  </code></pre>
  
  <p>I found this solution</p>
  
  <pre><code>Map&lt;String, Object&gt; attributes = new HashMap&lt;String, Object&gt;();
  Set&lt;Entry&lt;String, JsonElement&gt;&gt; entrySet = jsonObject.entrySet();
  for(Map.Entry&lt;String,JsonElement&gt; entry : entrySet){
    attributes.put(entry.getKey(), jsonObject.get(entry.getKey()));
  }
  </code></pre>
  
  <p>but the values are enclosed by <code>""</code></p>
  
  <pre><code>"keyInt" -&gt; "4711"
  "keyStr" -&gt; ""val1""
  </code></pre>
  
  <p>How to get the plain values (<code>4711</code> and <code>"val1"</code>)?</p>
  
  <p>Input data:</p>
  
  <pre><code>{
    "id": 0815, 
    "a": "a string",
    "b": 123.4,
    "c": {
      "a": 1,
      "b": true,
      "c": ["a", "b", "c"]
    }
  }
  </code></pre>
  
  <p>or</p>
  
  <pre><code>{
    "id": 4711, 
    "x": false,
    "y": "y?",
  }
  </code></pre>