use of com.willshex.blogwt.shared.api.datatype.User in project blogwt by billy1380.
the class SetupBlogRequest 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("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