title: How to get and ignore specific field in JSON
body: <p>Game class:</p>
  
  <pre><code>public class Game {
    private String name;
    private int steam_appid;
    private boolean isInstalled;
  }
  </code></pre>
  
  <p>Json example: <a href="https://store.steampowered.com/api/appdetails/?appids=435150&amp;filters=basic" rel="nofollow noreferrer">https://store.steampowered.com/api/appdetails/?appids=435150&amp;filters=basic</a></p>
  
  <p>My attempt:</p>
  
  <pre><code>public static Game readJson(String gameID) throws IOException {
      String targetURL = String.format(STEAM_API, gameID);
      URL url = new URL(targetURL);
      InputStreamReader reader = new InputStreamReader(url.openStream());
      Gson gson = new Gson();
      Game json = gson.fromJson(reader, Game.class);
      return json;
  }
  </code></pre>
  
  <ol>
  <li>When I tried to print the output, I get <code>Name:null steam_appid:0 isInstalled:false</code></li>
  <li>I want to check the key <code>success</code> first, if value is <code>true</code> parse it to <code>Game</code>. Otherwise, do nothing.<br>
  How can I parse the Json to my <code>Game</code>?</li>
  </ol>