Search in sources :

Example 6 with Pager

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

the class GetPropertiesResponse method fromJson.

@Override
public void fromJson(JsonObject jsonObject) {
    super.fromJson(jsonObject);
    if (jsonObject.has("properties")) {
        JsonElement jsonProperties = jsonObject.get("properties");
        if (jsonProperties != null) {
            properties = new ArrayList<Property>();
            Property item = null;
            for (int i = 0; i < jsonProperties.getAsJsonArray().size(); i++) {
                if (jsonProperties.getAsJsonArray().get(i) != null) {
                    (item = new Property()).fromJson(jsonProperties.getAsJsonArray().get(i).getAsJsonObject());
                    properties.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) Property(com.willshex.blogwt.shared.api.datatype.Property)

Example 7 with Pager

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

the class GetRatingsResponse method fromJson.

@Override
public void fromJson(JsonObject jsonObject) {
    super.fromJson(jsonObject);
    if (jsonObject.has("ratings")) {
        JsonElement jsonRatings = jsonObject.get("ratings");
        if (jsonRatings != null) {
            ratings = new ArrayList<Rating>();
            Rating item = null;
            for (int i = 0; i < jsonRatings.getAsJsonArray().size(); i++) {
                if (jsonRatings.getAsJsonArray().get(i) != null) {
                    (item = new Rating()).fromJson(jsonRatings.getAsJsonArray().get(i).getAsJsonObject());
                    ratings.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) Rating(com.willshex.blogwt.shared.api.datatype.Rating) Pager(com.willshex.blogwt.shared.api.Pager)

Example 8 with Pager

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

the class GetRelatedPostsResponse method fromJson.

@Override
public void fromJson(JsonObject jsonObject) {
    super.fromJson(jsonObject);
    if (jsonObject.has("posts")) {
        JsonElement jsonPosts = jsonObject.get("posts");
        if (jsonPosts != null) {
            posts = new Post();
            posts.fromJson(jsonPosts.getAsJsonObject());
        }
    }
    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) Post(com.willshex.blogwt.shared.api.datatype.Post) Pager(com.willshex.blogwt.shared.api.Pager)

Example 9 with Pager

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

the class GetGeneratedDownloadsRequest 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 10 with Pager

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

the class GetGeneratedDownloadsResponse method fromJson.

@Override
public void fromJson(JsonObject jsonObject) {
    super.fromJson(jsonObject);
    if (jsonObject.has("downloads")) {
        JsonElement jsonDownloads = jsonObject.get("downloads");
        if (jsonDownloads != null) {
            downloads = new ArrayList<GeneratedDownload>();
            GeneratedDownload item = null;
            for (int i = 0; i < jsonDownloads.getAsJsonArray().size(); i++) {
                if (jsonDownloads.getAsJsonArray().get(i) != null) {
                    (item = new GeneratedDownload()).fromJson(jsonDownloads.getAsJsonArray().get(i).getAsJsonObject());
                    downloads.add(item);
                }
            }
        }
    }
    if (jsonObject.has("pager")) {
        JsonElement jsonPager = jsonObject.get("pager");
        if (jsonPager != null) {
            pager = new Pager();
            pager.fromJson(jsonPager.getAsJsonObject());
        }
    }
}
Also used : GeneratedDownload(com.willshex.blogwt.shared.api.datatype.GeneratedDownload) 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