title: Extracting all name-elements from a JsonObject
body: <p>I am having trouble extracting the proper information from my JsonObject. Currently, I'm receiving this type of String from a Web API:</p>
  <pre><code>{&quot;start_game_items&quot;:{&quot;11&quot;:98,&quot;14&quot;:39,&quot;16&quot;:120,&quot;20&quot;:51,&quot;27&quot;:60,&quot;34&quot;:2,&quot;39&quot;:5,&quot;42&quot;:4,&quot;44&quot;:98,&quot;181&quot;:4,&quot;237&quot;:13,&quot;241&quot;:5}}
  </code></pre>
  <p>The information that I'm interested in, is every number inside the &quot;&quot;s, e.g &quot;11&quot;, &quot;14&quot; and so forth. These numbers represents a specific item within a computer game, so they will most likely vary from each String from the Web API. Currently I'm doing this:</p>
  <pre><code>// below is the String that I displayed in the top &quot;{&quot;start_game_item&quot;:{&quot;11&quot;..}&quot;&quot;
      String jsonString = itemData[0];
  
      JsonObject jsonObject = JsonParser.parseString(jsonString).getAsJsonObject();
      Set entrySet = jsonObject.entrySet();
      Object[] items = entrySet.toArray();
  
      for (Object o : items) {
          System.out.println(o.toString());
      }
  </code></pre>
  <p>But when I do this, I receive the same line as earlier posted. Can anyone see where I go wrong? I am using the google.gson library for Java.</p>
  <p>EDIT: I had a some-what similar issue earlier, where I received this type of String:</p>
  <pre><code>{&quot;1&quot;:&quot;blink&quot;,&quot;2&quot;:&quot;blades_of_attack&quot;,&quot;3&quot;:&quot;broadsword&quot;,&quot;4&quot;:&quot;chainmail&quot;,&quot;5&quot;:&quot;claymore&quot;,&quot;6&quot;:&quot;helm_of_iron_will&quot;,&quot;7&quot;:&quot;javelin&quot;,&quot;8&quot;:&quot;mithril_hammer&quot;,&quot;9&quot;:&quot;platemail&quot;,&quot;10&quot;:&quot;quarterstaff&quot;,..}
  </code></pre>
  <p>Where these item-numbers are mapped to a item-name. However, that was one large Array which I solved by doing this:</p>
  <pre><code>String jsonString = itemIDData[0];
      JsonObject jsonObject = JsonParser.parseString(jsonString).getAsJsonObject();
  
      Set keySet = jsonObject.keySet();
      List&lt;String&gt; listJsonObjectKeys = new ArrayList&lt;String&gt;();
  
      // Now we add each Key from the jsonObject to a List, so we can use the ID(Key).
      for (Object key : keySet) {
          listJsonObjectKeys.add(key.toString());
      }
  
      for (int i = 0; i &lt; keySet.size(); i++) {
          String currentIDString = listJsonObjectKeys.get(i);
          JsonElement currentItem = jsonObject.get(currentIDString);
  
          String itemName = currentItem.getAsString();
          int currentID = Integer.parseInt(currentIDString);
          itemIDMap.put(currentID, itemName);
      }
  }
  </code></pre>
  <p>I tried to use a similar logic to the issue I posted about, but I'm having issues in extracting the information I need.</p>