use of com.google.gson.JsonPrimitive in project blogwt by billy1380.
the class CreatePostRequest method toJson.
@Override
public JsonObject toJson() {
JsonObject object = super.toJson();
JsonElement jsonPost = post == null ? JsonNull.INSTANCE : post.toJson();
object.add("post", jsonPost);
JsonElement jsonPublish = publish == null ? JsonNull.INSTANCE : new JsonPrimitive(publish);
object.add("publish", jsonPublish);
return object;
}
use of com.google.gson.JsonPrimitive in project blogwt by billy1380.
the class GetArchiveEntriesRequest method toJson.
@Override
public JsonObject toJson() {
JsonObject object = super.toJson();
JsonElement jsonIncludePosts = includePosts == null ? JsonNull.INSTANCE : new JsonPrimitive(includePosts);
object.add("includePosts", jsonIncludePosts);
return object;
}
use of com.google.gson.JsonPrimitive in project blogwt by billy1380.
the class GetPostsRequest method toJson.
@Override
public JsonObject toJson() {
JsonObject object = super.toJson();
JsonElement jsonPager = pager == null ? JsonNull.INSTANCE : pager.toJson();
object.add("pager", jsonPager);
JsonElement jsonIncludePostContents = includePostContents == null ? JsonNull.INSTANCE : new JsonPrimitive(includePostContents);
object.add("includePostContents", jsonIncludePostContents);
JsonElement jsonTag = tag == null ? JsonNull.INSTANCE : new JsonPrimitive(tag);
object.add("tag", jsonTag);
JsonElement jsonArchiveEntry = archiveEntry == null ? JsonNull.INSTANCE : archiveEntry.toJson();
object.add("archiveEntry", jsonArchiveEntry);
JsonElement jsonQuery = query == null ? JsonNull.INSTANCE : new JsonPrimitive(query);
object.add("query", jsonQuery);
JsonElement jsonShowAll = showAll == null ? JsonNull.INSTANCE : new JsonPrimitive(showAll);
object.add("showAll", jsonShowAll);
return object;
}
use of com.google.gson.JsonPrimitive in project blogwt by billy1380.
the class GetTagsRequest method toJson.
@Override
public JsonObject toJson() {
JsonObject object = super.toJson();
JsonElement jsonIncludePosts = includePosts == null ? JsonNull.INSTANCE : new JsonPrimitive(includePosts);
object.add("includePosts", jsonIncludePosts);
return object;
}
use of com.google.gson.JsonPrimitive in project blogwt by billy1380.
the class DataType method toJson.
@Override
public JsonObject toJson() {
JsonObject object = super.toJson();
JsonElement jsonId = id == null ? JsonNull.INSTANCE : new JsonPrimitive(id);
object.add("id", jsonId);
JsonElement jsonCreated = created == null ? JsonNull.INSTANCE : new JsonPrimitive(created.getTime());
object.add("created", jsonCreated);
return object;
}
Aggregations