first commit of new persistence layer. new model classes
[mir.git] / source / mir / core / model / MirUser.java
1 package mir.core.model;
2
3 import java.io.Serializable;
4
5 import org.apache.commons.lang.builder.EqualsBuilder;
6 import org.apache.commons.lang.builder.HashCodeBuilder;
7 import org.apache.commons.lang.builder.ToStringBuilder;
8
9 /** @author Hibernate CodeGenerator */
10 public class MirUser implements Serializable {
11
12     /** identifier field */
13     private Integer id;
14
15     /** persistent field */
16     private String login;
17
18     /** persistent field */
19     private String password;
20
21     /** persistent field */
22     private boolean isAdmin;
23
24     /** full constructor */
25     public MirUser(java.lang.String login, java.lang.String password, boolean isAdmin) {
26         this.login = login;
27         this.password = password;
28         this.isAdmin = isAdmin;
29     }
30
31     /** default constructor */
32     public MirUser() {
33     }
34
35     public java.lang.Integer getId() {
36         return this.id;
37     }
38
39     public void setId(java.lang.Integer id) {
40         this.id = id;
41     }
42
43     public java.lang.String getLogin() {
44         return this.login;
45     }
46
47     public void setLogin(java.lang.String login) {
48         this.login = login;
49     }
50
51     public java.lang.String getPassword() {
52         return this.password;
53     }
54
55     public void setPassword(java.lang.String password) {
56         this.password = password;
57     }
58
59     public boolean isIsAdmin() {
60         return this.isAdmin;
61     }
62
63     public void setIsAdmin(boolean isAdmin) {
64         this.isAdmin = isAdmin;
65     }
66
67     public String toString() {
68         return new ToStringBuilder(this)
69             .append("id", getId())
70             .toString();
71     }
72
73     public boolean equals(Object other) {
74         if ( !(other instanceof MirUser) ) return false;
75         MirUser castOther = (MirUser) other;
76         return new EqualsBuilder()
77             .append(this.getId(), castOther.getId())
78             .isEquals();
79     }
80
81     public int hashCode() {
82         return new HashCodeBuilder()
83             .append(getId())
84             .toHashCode();
85     }
86
87 }