link = getRawString("link", json);
name = getRawString("name", json);
if (!json.isNull("likes")) {
JSONObject likesJSONObject = json.getJSONObject("likes");
if (!likesJSONObject.isNull("data")) {
JSONArray list = likesJSONObject.getJSONArray("data");
final int size = list.length();
likes = new PagableListImpl<Like>(size, likesJSONObject);
for (int i = 0; i < size; i++) {
LikeJSONImpl like = new LikeJSONImpl(list.getJSONObject(i));
likes.add(like);
}
} else {
likes = new PagableListImpl<Like>(1, likesJSONObject);
}
} else {
likes = new PagableListImpl<Like>(0);
}
if (!json.isNull("comments")) {
JSONObject commentsJSONObject = json.getJSONObject("comments");
if (!commentsJSONObject.isNull("data")) {
JSONArray list = commentsJSONObject.getJSONArray("data");
final int size = list.length();
comments = new PagableListImpl<Comment>(size, commentsJSONObject);
for (int i = 0; i < size; i++) {
CommentJSONImpl tag = new CommentJSONImpl(list.getJSONObject(i));
comments.add(tag);
}
} else {
comments = new PagableListImpl<Comment>(1, commentsJSONObject);
}