diff options
author | Alexander Alexeev | 2016-12-11 00:52:57 +0700 |
---|---|---|
committer | Vitaly Takmazov | 2016-12-11 18:24:37 +0300 |
commit | ac6c86ddd482721e7011dcb727e4099b8cdf84b1 (patch) | |
tree | 233ff85e261037b0949e4aa5105ca0dbcd22e9c4 /juick-server/src/main/java/com/juick/entity | |
parent | 5ff660e5f3e73382781f854a0afc350d2ad6d626 (diff) |
anonymous user support
Diffstat (limited to 'juick-server/src/main/java/com/juick/entity')
-rw-r--r-- | juick-server/src/main/java/com/juick/entity/AnonymUser.java | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/juick-server/src/main/java/com/juick/entity/AnonymUser.java b/juick-server/src/main/java/com/juick/entity/AnonymUser.java new file mode 100644 index 00000000..071f5434 --- /dev/null +++ b/juick-server/src/main/java/com/juick/entity/AnonymUser.java @@ -0,0 +1,79 @@ +package com.juick.entity; + +import com.juick.User; + +/** + * Created by aalexeev on 12/11/16. + */ +public class AnonymUser extends User { + public static final AnonymUser INSTANCE = new AnonymUser(); + + + private AnonymUser() { + } + + @Override + public boolean equals(Object obj) { + return obj == this || obj instanceof AnonymUser; + } + + @Override + public int getUid() { + return 0; + } + + @Override + public String getName() { + return "Anonymous"; + } + + @Override + public String getFullName() { + return getName(); + } + + @Override + public String getJid() { + return "anonym@localhost"; + } + + @Override + public String getAuthHash() { + return null; + } + + @Override + public Integer getUnreadCount() { + return 0; + } + + @Override + public boolean isBanned() { + return false; + } + + @Override + public Object getAvatar() { + return null; + } + + @Override + public String getCredentials() { + return null; + } + + @Override + public String getLang() { + return "__"; + } + + @Override + public int getMessagesCount() { + return 0; + } + + @Override + public boolean isAnonym() { + return true; + } +} |