aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/entity/AnonymUser.java
blob: 071f5434aee1fc0ef2accd4b493a25f136272c8a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
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;
    }
}