use of com.willshex.blogwt.shared.api.datatype.User 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());
}
}
}
use of com.willshex.blogwt.shared.api.datatype.User in project blogwt by billy1380.
the class RegisterUserRequest 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());
}
}
}
use of com.willshex.blogwt.shared.api.datatype.User 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());
}
}
}
use of com.willshex.blogwt.shared.api.datatype.User 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.datatype.User in project blogwt by billy1380.
the class SearchAllResponse 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 ArrayList<Post>();
Post item = null;
for (int i = 0; i < jsonPosts.getAsJsonArray().size(); i++) {
if (jsonPosts.getAsJsonArray().get(i) != null) {
(item = new Post()).fromJson(jsonPosts.getAsJsonArray().get(i).getAsJsonObject());
posts.add(item);
}
}
}
}
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("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);
}
}
}
}
}
Aggregations