title: How to get JSON Object with specific value in Android using GSON
body: <p>I would like to parse data from JSON which is String type. My JSON response looks like</p>
  
  <pre><code>[{"order":-1,"number":"5"},{"order":0,"number":"7"},{"order":1,"number":"3"}]
  </code></pre>
  
  <p>I tried to use next method:</p>
  
  <pre><code>JSONArray json = new JSONArray("My JSON String");
  
          for (int i = 0; i &lt; json.length(); i++)
          {
              JSONObject json_staticon = json.getJSONObject(i);
  
              if(json_staticon.getInt("order") == 0) {
                  return json_staticon.getInt("number");
              }
          }
  </code></pre>
  
  <p>But I want to use Google GSON library to parse my JSON responses, so...
  what better way to get <code>number</code> value in object with <code>order = 0</code> using GSON?</p>
  
  <p>Thanks!</p>