use of com.willshex.blogwt.shared.api.Pager in project blogwt by billy1380.
the class GetNotificationSettingsResponse method fromJson.
@Override
public void fromJson(JsonObject jsonObject) {
super.fromJson(jsonObject);
if (jsonObject.has("pager")) {
JsonElement jsonPager = jsonObject.get("pager");
if (jsonPager != null) {
pager = new Pager();
pager.fromJson(jsonPager.getAsJsonObject());
}
}
if (jsonObject.has("settings")) {
JsonElement jsonSettings = jsonObject.get("settings");
if (jsonSettings != null) {
settings = new ArrayList<NotificationSetting>();
NotificationSetting item = null;
for (int i = 0; i < jsonSettings.getAsJsonArray().size(); i++) {
if (jsonSettings.getAsJsonArray().get(i) != null) {
(item = new NotificationSetting()).fromJson(jsonSettings.getAsJsonArray().get(i).getAsJsonObject());
settings.add(item);
}
}
}
}
}
use of com.willshex.blogwt.shared.api.Pager in project blogwt by billy1380.
the class GetNotificationsRequest method fromJson.
@Override
public void fromJson(JsonObject jsonObject) {
super.fromJson(jsonObject);
if (jsonObject.has("user")) {
JsonElement jsonUser = jsonObject.get("user");
if (jsonUser != null) {
user = new User();
user.fromJson(jsonUser.getAsJsonObject());
}
}
if (jsonObject.has("pager")) {
JsonElement jsonPager = jsonObject.get("pager");
if (jsonPager != null) {
pager = new Pager();
pager.fromJson(jsonPager.getAsJsonObject());
}
}
}
use of com.willshex.blogwt.shared.api.Pager in project blogwt by billy1380.
the class GetNotificationsResponse method fromJson.
@Override
public void fromJson(JsonObject jsonObject) {
super.fromJson(jsonObject);
if (jsonObject.has("notifications")) {
JsonElement jsonNotifications = jsonObject.get("notifications");
if (jsonNotifications != null) {
notifications = new ArrayList<Notification>();
Notification item = null;
for (int i = 0; i < jsonNotifications.getAsJsonArray().size(); i++) {
if (jsonNotifications.getAsJsonArray().get(i) != null) {
(item = new Notification()).fromJson(jsonNotifications.getAsJsonArray().get(i).getAsJsonObject());
notifications.add(item);
}
}
}
}
if (jsonObject.has("pager")) {
JsonElement jsonPager = jsonObject.get("pager");
if (jsonPager != null) {
pager = new Pager();
pager.fromJson(jsonPager.getAsJsonObject());
}
}
}
use of com.willshex.blogwt.shared.api.Pager in project blogwt by billy1380.
the class GetPagesRequest method fromJson.
@Override
public void fromJson(JsonObject jsonObject) {
super.fromJson(jsonObject);
if (jsonObject.has("parent")) {
JsonElement jsonParent = jsonObject.get("parent");
if (jsonParent != null) {
parent = new Page();
parent.fromJson(jsonParent.getAsJsonObject());
}
}
if (jsonObject.has("includePosts")) {
JsonElement jsonIncludePosts = jsonObject.get("includePosts");
if (jsonIncludePosts != null) {
includePosts = Boolean.valueOf(jsonIncludePosts.getAsBoolean());
}
}
if (jsonObject.has("pager")) {
JsonElement jsonPager = jsonObject.get("pager");
if (jsonPager != null) {
pager = new Pager();
pager.fromJson(jsonPager.getAsJsonObject());
}
}
if (jsonObject.has("query")) {
JsonElement jsonQuery = jsonObject.get("query");
if (jsonQuery != null) {
query = jsonQuery.getAsString();
}
}
}
use of com.willshex.blogwt.shared.api.Pager in project blogwt by billy1380.
the class GetPagesResponse method fromJson.
@Override
public void fromJson(JsonObject jsonObject) {
super.fromJson(jsonObject);
if (jsonObject.has("pages")) {
JsonElement jsonPages = jsonObject.get("pages");
if (jsonPages != null) {
pages = new ArrayList<Page>();
Page item = null;
for (int i = 0; i < jsonPages.getAsJsonArray().size(); i++) {
if (jsonPages.getAsJsonArray().get(i) != null) {
(item = new Page()).fromJson(jsonPages.getAsJsonArray().get(i).getAsJsonObject());
pages.add(item);
}
}
}
}
if (jsonObject.has("pager")) {
JsonElement jsonPager = jsonObject.get("pager");
if (jsonPager != null) {
pager = new Pager();
pager.fromJson(jsonPager.getAsJsonObject());
}
}
}
Aggregations