Пример #1
0
 public UserListJSON(JSONObject json) throws Exception {
   _slug = json.optString("slug");
   _name = Utils.unescape(json.optString("name"));
   _uri = json.optString("uri");
   _subscriberCount = json.optLong("subscriber_count");
   _memberCount = json.optLong("member_count");
   _mode = UserListMode.valueOf(json.optString("mode").toUpperCase());
   _id = json.optLong("id");
   _fullName = Utils.unescape(json.optString("full_name"));
   _description = Utils.unescape(json.optString("description"));
   if (!json.isNull("user")) {
     _user = new UserJSON(json.getJSONObject("user"));
   }
   _following = json.optBoolean("following");
 }
 public MediaEntityJSON(JSONObject json) throws Exception {
   _id = json.optLong("id");
   _mediaUrl = json.getString("media_url");
   _mediaUrlHttps = json.getString("media_url_https");
   _url = json.getString("url");
   _displayUrl = json.getString("display_url");
   _expandedUrl = json.getString("expanded_url");
   JSONArray indicides = json.getJSONArray("indices");
   _startIndex = indicides.getInt(0);
   _endIndex = indicides.getInt(1);
 }