From bdbf65e0a50758bfcc88e1cc9c501eeed4e7e45d Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 12 Jul 2016 17:39:33 +0300 Subject: jackson-databind WIP --- juick-core/src/main/java/com/juick/User.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'juick-core/src/main/java/com/juick/User.java') diff --git a/juick-core/src/main/java/com/juick/User.java b/juick-core/src/main/java/com/juick/User.java index b9111d8f..a8109e50 100644 --- a/juick-core/src/main/java/com/juick/User.java +++ b/juick-core/src/main/java/com/juick/User.java @@ -17,6 +17,9 @@ */ package com.juick; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + /** * * @author Ugnich Anton @@ -25,11 +28,13 @@ public class User { private int UID = 0; private String UName = null; + @JsonIgnore public Object Avatar = null; private String FullName = null; private String JID = null; - public int MessagesCount = 0; + private int MessagesCount = 0; private String AuthHash = null; + @JsonIgnore public boolean Banned = false; public User() { @@ -51,6 +56,7 @@ public class User { return (obj instanceof User && ((User) obj).getUID() == this.getUID()); } + @JsonProperty("uid") public int getUID() { return UID; } @@ -59,6 +65,7 @@ public class User { this.UID = UID; } + @JsonProperty("uname") public String getUName() { return UName; } @@ -67,6 +74,7 @@ public class User { this.UName = UName; } + @JsonProperty("fullname") public String getFullName() { return FullName; } @@ -75,6 +83,7 @@ public class User { FullName = fullName; } + @JsonProperty("jid") public String getJID() { return JID; } @@ -83,6 +92,7 @@ public class User { this.JID = JID; } + @JsonIgnore public String getAuthHash() { return AuthHash; } @@ -90,7 +100,11 @@ public class User { public void setAuthHash(String authHash) { AuthHash = authHash; } + @JsonProperty("unreadCount") public Integer getUnreadCount() { return MessagesCount; } + public void setUnreadCount(Integer count) { + MessagesCount = count; + } } -- cgit v1.2.3