Kawai Wiki

Rev

Rev 135 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
8 soliveira 1
package org.kawai.model;
6 soliveira 2
 
3
 
4
public class User {
5
 
6
        private int id;
7
 
8
        private String username;
9
 
10
        private String password;
11
 
12
        private int groupId;
13
 
14
        public User() { }
15
 
16
        public int getId() {
17
                return id;
18
        }
19
 
20
        public void setId(int id) {
21
                this.id = id;
22
        }
23
 
24
        public String getUsername() {
25
                return username;
26
        }
135 soliveira 27
 
28
        public boolean isAdmin() {
29
                return groupId == Group.ADMIN.getId();
30
        }
6 soliveira 31
 
32
        public void setUsername(String username) {
33
                this.username = username;
34
        }
35
 
36
        public String getPassword() {
37
                return password;
38
        }
39
 
40
        public void setPassword(String password) {
41
                this.password = password;
42
        }
43
 
44
        public int getGroupId() {
45
        return groupId;
46
    }
47
 
48
        public Group getGroup() {
27 soliveira 49
                return Group.fromId(groupId);
6 soliveira 50
        }
51
 
52
        public void setGroupId(int groupId) {
53
        this.groupId = groupId;
54
    }
55
}