title: How to parse JSON using GSON?
body: <p>How get value in array "rate" to invoke getters methods ?</p>
  
  <p>My Json response is something as below and confused how to parse it using GSON. Please have look on the following and guide me how i can parse it using GSON.</p>
  
  <p>data.json</p>
  
  <pre><code>{  
   "query":{  
     "count":2,
     "created":"2017-01-03T12:45:19Z",
     "lang":"en-us",
     "results":{  
  
        "rate":[  
          {  
             "id":"BTC/USD",
             "Name":"BTCUSD",
             "Rate":"985.50",
             "Date":"1/3/2017",
             "Time":"10:35am",
             "Ask":"985.50",
             "Bid":"985.35"
          },
          {  
             "id":"BTC/EUR",
             "Name":"BTCEUR",
             "Rate":"973.16",
             "Date":"1/3/2017",
             "Time":"10:35am",
             "Ask":"973.16",
             "Bid":"973.10"
          }
       ]
    }
   }
  }
  </code></pre>
  
  <p>I use classes to parse apart </p>
  
  <p>Market.java</p>
  
  <pre><code>public class Market {
  
    @SerializedName("query")
    private Query query;
  
   public Query getQuery() {
    return query;
   }
  
   public void setQuery(Query query) {
    this.query = query;
   }
  
  }
  </code></pre>
  
  <p>Query.java</p>
  
  <pre><code> public class Query {
  
    @SerializedName("count")
    private Integer count;
    @SerializedName("created")
    private String created;
    @SerializedName("lang")
    private String lang;
    @SerializedName("results")
    private Results results;
  
    public Integer getCount() {
       return count;
    }
  
    public void setCount(Integer count) {
        this.count = count;
    }
  
    public String getCreated() {
       return created;
    }
  
    public void setCreated(String created) {
        this.created = created;
    }
  
    public String getLang() {
      return lang;
    }
  
    public void setLang(String lang) {
      this.lang = lang;
    }
  
    public Results getResults() {
      return results;
    }
  
    public void setResults(Results results) {
      this.results = results;
    }
  
   }
  </code></pre>
  
  <p>Rate.java</p>
  
  <pre><code>public class Rate {
  
  @SerializedName("id")
  private String id;
  @SerializedName("Name")
  private String name;
  @SerializedName("Rate")
  private String rate;
  @SerializedName("Date")
  private String date;
  @SerializedName("Time")
  private String time;
  @SerializedName("Ask")
  private String ask;
  @SerializedName("Bid")
  private String bid;
  
  public String getId() {
  return id;
  }
  
  public void setId(String id) {
  this.id = id;
  }
  
  public String getName() {
  return name;
  }
  
  public void setName(String name) {
  this.name = name;
  }
  
  public String getRate() {
  return rate;
  }
  
  public void setRate(String rate) {
  this.rate = rate;
  }
  
  public String getDate() {
  return date;
  }
  
  public void setDate(String date) {
  this.date = date;
  }
  
  public String getTime() {
  return time;
  }
  
  public void setTime(String time) {
  this.time = time;
  }
  
  public String getAsk() {
  return ask;
  }
  
  public void setAsk(String ask) {
  this.ask = ask;
  }
  
  public String getBid() {
  return bid;
  }
  
  public void setBid(String bid) {
  this.bid = bid;
  }
  
  }
  </code></pre>
  
  <p>Results.java</p>
  
  <pre><code>public class Results {
  
  @SerializedName("rate")
  private List&lt;Rate&gt; rate = null;
  
  public List&lt;Rate&gt; getRate() {
  return rate;
  }
  
  public void setRate(List&lt;Rate&gt; rate) {
  this.rate = rate;
  }
  
  }
  </code></pre>
  
  <p>Trying to get the values
  Main.java</p>
  
  <pre><code> public class Main {
  
    /* ..... */
       Gson gson = new Gson();
      Market market = gson.fromJson(json, Market.class);
       //error: incompatible types: Rate cannot be converted to List&lt;Rate&gt;
      for( List&lt;Rate&gt; res : market.getQuery().getResults().getRate());
      {
          Log.v(LOG_TAG, res); // error: cannot find symbol variable res
  
      }
  
   }
  </code></pre>
  
  <p>how to do it properly ?</p>