title: How can I cast json recursively using gson.fromjson
body: <p>Given I have the following json structure:</p>
  
  <pre><code>{
      "Role": {
          "id": "5",
          "name": "bb1",
          "description": "desc1",
          "PermissionDeck": [
              {
                  "id": "7",
                  "Permission": [
                      {
                          "id": "398"
                      },
                      {
                          "id": "399"
                      },
                      {
                          "id": "400"
                      },
                      {
                          "id": "401"
                      },
                      {
                          "id": "402"
                      }
                  ],
                  "Limit": [
                      {
                          "id": "4"
                      },
                      {
                          "id": "5"
                      }
                  ]
              }
          ]
      }
  }
  </code></pre>
  
  <p>If I want to cast this into a <code>LinkedTreeMap result</code> so that its content could be a retrieved by:</p>
  
  <p><code>result.get("Role")</code> returns Map</p>
  
  <p>and </p>
  
  <pre><code>result.get("Role").get("PermissionDeck").size() == 5
  </code></pre>
  
  <p>and </p>
  
  <pre><code>result.get("Role").get("PermissionDeck").get(0).get("id") == 398
  </code></pre>
  
  <p>basically makes gson.fromjson recursively go into the structure, and fold any nested structure into LinkedTreeMap until it gets to the most inner layer, which then gets into LinkedTreeMap</p>
  
  <p>Is this possible without writing custom recursive methods?</p>