diff options
Diffstat (limited to 'src/main/java/com/juick/json/UserSerializer.java')
-rw-r--r-- | src/main/java/com/juick/json/UserSerializer.java | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/main/java/com/juick/json/UserSerializer.java b/src/main/java/com/juick/json/UserSerializer.java index 07f87616..4485812a 100644 --- a/src/main/java/com/juick/json/UserSerializer.java +++ b/src/main/java/com/juick/json/UserSerializer.java @@ -30,10 +30,10 @@ public class UserSerializer extends JSONSerializer<User> { @Override public User deserialize(JSONObject json) throws JSONException { User juser = new User(); - juser.UID = json.getInt("uid"); - juser.UName = json.getString("uname"); + juser.setUID(json.getInt("uid")); + juser.setUName(json.getString("uname")); if (json.has("fullname")) { - juser.FullName = json.getString("fullname"); + juser.setFullName(json.getString("fullname")); } return juser; } @@ -43,17 +43,17 @@ public class UserSerializer extends JSONSerializer<User> { JSONObject json = new JSONObject(); try { - if (user.UID > 0) { - json.put("uid", user.UID); + if (user.getUID() > 0) { + json.put("uid", user.getUID()); } - if (user.UName != null) { - json.put("uname", user.UName); + if (user.getUName() != null) { + json.put("uname", user.getUName()); } - if (user.FullName != null) { - json.put("fullname", user.FullName); + if (user.getFullName() != null) { + json.put("fullname", user.getFullName()); } - if (user.JID != null) { - json.put("jid", user.JID); + if (user.getJID() != null) { + json.put("jid", user.getJID()); } if (user.MessagesCount > 0) { json.put("MessagesCount", user.MessagesCount); |