Search in sources :

Example 11 with Pager

use of com.willshex.blogwt.shared.api.Pager in project blogwt by billy1380.

the class GetMetaNotificationsResponse method fromJson.

@Override
public void fromJson(JsonObject jsonObject) {
    super.fromJson(jsonObject);
    if (jsonObject.has("metas")) {
        JsonElement jsonMetas = jsonObject.get("metas");
        if (jsonMetas != null) {
            metas = new ArrayList<MetaNotification>();
            MetaNotification item = null;
            for (int i = 0; i < jsonMetas.getAsJsonArray().size(); i++) {
                if (jsonMetas.getAsJsonArray().get(i) != null) {
                    (item = new MetaNotification()).fromJson(jsonMetas.getAsJsonArray().get(i).getAsJsonObject());
                    metas.add(item);
                }
            }
        }
    }
    if (jsonObject.has("pager")) {
        JsonElement jsonPager = jsonObject.get("pager");
        if (jsonPager != null) {
            pager = new Pager();
            pager.fromJson(jsonPager.getAsJsonObject());
        }
    }
}
Also used : JsonElement(com.google.gson.JsonElement) Pager(com.willshex.blogwt.shared.api.Pager) MetaNotification(com.willshex.blogwt.shared.api.datatype.MetaNotification)

Example 12 with Pager

use of com.willshex.blogwt.shared.api.Pager in project blogwt by billy1380.

the class GetRolesRequest 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("query")) {
        JsonElement jsonQuery = jsonObject.get("query");
        if (jsonQuery != null) {
            query = jsonQuery.getAsString();
        }
    }
}
Also used : JsonElement(com.google.gson.JsonElement) Pager(com.willshex.blogwt.shared.api.Pager)

Example 13 with Pager

use of com.willshex.blogwt.shared.api.Pager in project blogwt by billy1380.

the class GetUsersResponse method fromJson.

@Override
public void fromJson(JsonObject jsonObject) {
    super.fromJson(jsonObject);
    if (jsonObject.has("users")) {
        JsonElement jsonUsers = jsonObject.get("users");
        if (jsonUsers != null) {
            users = new ArrayList<User>();
            User item = null;
            for (int i = 0; i < jsonUsers.getAsJsonArray().size(); i++) {
                if (jsonUsers.getAsJsonArray().get(i) != null) {
                    (item = new User()).fromJson(jsonUsers.getAsJsonArray().get(i).getAsJsonObject());
                    users.add(item);
                }
            }
        }
    }
    if (jsonObject.has("pager")) {
        JsonElement jsonPager = jsonObject.get("pager");
        if (jsonPager != null) {
            pager = new Pager();
            pager.fromJson(jsonPager.getAsJsonObject());
        }
    }
}
Also used : User(com.willshex.blogwt.shared.api.datatype.User) JsonElement(com.google.gson.JsonElement) Pager(com.willshex.blogwt.shared.api.Pager)

Example 14 with Pager

use of com.willshex.blogwt.shared.api.Pager in project blogwt by billy1380.

the class GetMetaNotificationsRequest 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());
        }
    }
}
Also used : JsonElement(com.google.gson.JsonElement) Pager(com.willshex.blogwt.shared.api.Pager)

Example 15 with Pager

use of com.willshex.blogwt.shared.api.Pager in project blogwt by billy1380.

the class GetNotificationSettingsRequest 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());
        }
    }
}
Also used : User(com.willshex.blogwt.shared.api.datatype.User) JsonElement(com.google.gson.JsonElement) Pager(com.willshex.blogwt.shared.api.Pager)

Aggregations

Pager (com.willshex.blogwt.shared.api.Pager)35 JsonElement (com.google.gson.JsonElement)26 Post (com.willshex.blogwt.shared.api.datatype.Post)10 User (com.willshex.blogwt.shared.api.datatype.User)6 Page (com.willshex.blogwt.shared.api.datatype.Page)3 ArrayList (java.util.ArrayList)3 ArchiveEntry (com.willshex.blogwt.shared.api.datatype.ArchiveEntry)2 HashMap (java.util.HashMap)2 SyndContent (com.rometools.rome.feed.synd.SyndContent)1 SyndContentImpl (com.rometools.rome.feed.synd.SyndContentImpl)1 SyndEntry (com.rometools.rome.feed.synd.SyndEntry)1 SyndEntryImpl (com.rometools.rome.feed.synd.SyndEntryImpl)1 SyndFeed (com.rometools.rome.feed.synd.SyndFeed)1 SyndFeedImpl (com.rometools.rome.feed.synd.SyndFeedImpl)1 GeneratedDownload (com.willshex.blogwt.shared.api.datatype.GeneratedDownload)1 MetaNotification (com.willshex.blogwt.shared.api.datatype.MetaNotification)1 Notification (com.willshex.blogwt.shared.api.datatype.Notification)1 NotificationSetting (com.willshex.blogwt.shared.api.datatype.NotificationSetting)1 Permission (com.willshex.blogwt.shared.api.datatype.Permission)1 Property (com.willshex.blogwt.shared.api.datatype.Property)1