Welcome to mirror list, hosted at ThFree Co, Russian Federation.

User.java « model « deck « nextcloud « niedermann « it « java « main « src « app - github.com/stefan-niedermann/nextcloud-deck.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 30edce5c41814fb32d0244d9c8ea2a241cc70ee0 (plain)
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
package it.niedermann.nextcloud.deck.model;

import androidx.room.Entity;
import androidx.room.Ignore;
import androidx.room.Index;

import it.niedermann.nextcloud.deck.model.interfaces.AbstractRemoteEntity;

@Entity(inheritSuperIndices = true, indices = {@Index(value = "uid", name = "user_uid")})
public class User extends AbstractRemoteEntity {


    private String primaryKey;
    private String uid;
    private String displayname;

    public User() {
        super();
    }

    @Ignore
    public User(String primaryKey, String uid, String displayname) {
        this.primaryKey = primaryKey;
        this.uid = uid;
        this.displayname = displayname;
    }

    public String getPrimaryKey() {
        return primaryKey;
    }

    public void setPrimaryKey(String primaryKey) {
        this.primaryKey = primaryKey;
    }

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public String getDisplayname() {
        return displayname;
    }

    public void setDisplayname(String displayname) {
        this.displayname = displayname;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        User user = (User) o;

        if (primaryKey != null ? !primaryKey.equals(user.primaryKey) : user.primaryKey != null)
            return false;
        if (uid != null ? !uid.equals(user.uid) : user.uid != null) return false;
        return displayname != null ? displayname.equals(user.displayname) : user.displayname == null;
    }

    @Override
    public int hashCode() {
        int result = primaryKey != null ? primaryKey.hashCode() : 0;
        result = 31 * result + (uid != null ? uid.hashCode() : 0);
        result = 31 * result + (displayname != null ? displayname.hashCode() : 0);
        return result;
    }
}