use of com.willshex.blogwt.shared.api.datatype.ArchiveEntry in project blogwt by billy1380.
the class GetArchiveEntriesResponse method fromJson.
@Override
public void fromJson(JsonObject jsonObject) {
super.fromJson(jsonObject);
if (jsonObject.has("archive")) {
JsonElement jsonArchive = jsonObject.get("archive");
if (jsonArchive != null) {
archive = new ArrayList<ArchiveEntry>();
ArchiveEntry item = null;
for (int i = 0; i < jsonArchive.getAsJsonArray().size(); i++) {
if (jsonArchive.getAsJsonArray().get(i) != null) {
(item = new ArchiveEntry()).fromJson(jsonArchive.getAsJsonArray().get(i).getAsJsonObject());
archive.add(item);
}
}
}
}
}
use of com.willshex.blogwt.shared.api.datatype.ArchiveEntry in project blogwt by billy1380.
the class GetPostsRequest 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("includePostContents")) {
JsonElement jsonIncludePostContents = jsonObject.get("includePostContents");
if (jsonIncludePostContents != null) {
includePostContents = Boolean.valueOf(jsonIncludePostContents.getAsBoolean());
}
}
if (jsonObject.has("tag")) {
JsonElement jsonTag = jsonObject.get("tag");
if (jsonTag != null) {
tag = jsonTag.getAsString();
}
}
if (jsonObject.has("archiveEntry")) {
JsonElement jsonArchiveEntry = jsonObject.get("archiveEntry");
if (jsonArchiveEntry != null) {
archiveEntry = new ArchiveEntry();
archiveEntry.fromJson(jsonArchiveEntry.getAsJsonObject());
}
}
if (jsonObject.has("query")) {
JsonElement jsonQuery = jsonObject.get("query");
if (jsonQuery != null) {
query = jsonQuery.getAsString();
}
}
if (jsonObject.has("showAll")) {
JsonElement jsonShowAll = jsonObject.get("showAll");
if (jsonShowAll != null) {
showAll = Boolean.valueOf(jsonShowAll.getAsBoolean());
}
}
}
Aggregations