Code example for Gson

Methods: fromJson

0
   *  
   * @return A user status object for the current user, or for "guest" user if you haven't sign-in. 
   */ 
  public JsonUserStat userstats() { 
    String response = h.send(URL_USERSTATS, null, "GET", 1);
    JsonUserStat json = new Gson().fromJson(response, JsonUserStat.class);
    return json;
  } 
 
  /** 
   * Retrieves the leader board information from the server. 
   *  
   * @return A leader board object. 
   */ 
  public JsonLeaderBoard leaderboard() { 
    return leaderboard(-1); 
  } 
 
  /** 
   * Retrieves the leader board information from the server. 
Contextual code suggestions in your IDE  Get Codota for Java