View Javadoc

1   /*
2       Copyright (C) 2004 PjEr
3       
4       This program is free software; you can redistribute it and/or modify
5       it under the terms of the GNU General Public License as published by
6       the Free Software Foundation; either version 2 of the License, or
7       (at your option) any later version.
8       
9       This program is distributed in the hope that it will be useful,
10      but WITHOUT ANY WARRANTY; without even the implied warranty of
11      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12      GNU General Public License for more details.
13      
14      You should have received a copy of the GNU General Public License
15      along with this program; if not, write to the Free Software
16      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  */
18  package ca.pjer.cm.module.access.defaultimpl;
19  
20  import java.io.Serializable;
21  
22  /***
23   * <br />
24   * $Id: User.java,v 1.1 2004/05/19 03:29:17 pjer Exp $<br />
25   * <br />
26   * $RCSfile: User.java,v $<br />
27   * $Revision: 1.1 $<br />
28   * $Author: pjer $<br />
29   * $Date: 2004/05/19 03:29:17 $<br />
30   * 
31   * @TODO comment me.<br />
32   */
33  public class User implements Serializable {
34      private Integer id;
35      private String username;
36      private String password;
37  
38      public Integer getId() {
39          return id;
40      }
41  
42      public void setId(Integer id) {
43          this.id = id;
44      }
45  
46      public String getUsername() {
47          return username;
48      }
49  
50      public void setUsername(String username) {
51          this.username = username;
52      }
53  
54      public String getPassword() {
55          return password;
56      }
57  
58      public void setPassword(String password) {
59          this.password = password;
60      }
61  
62      public boolean equals(Object o) {
63          if (this == o) return true;
64          if (!(o instanceof User)) return false;
65  
66          final User user = (User) o;
67  
68          if (id != null ? !id.equals(user.id) : user.id != null) return false;
69          if (password != null ? !password.equals(user.password) : user.password != null) return false;
70          if (username != null ? !username.equals(user.username) : user.username != null) return false;
71  
72          return true;
73      }
74  
75      public int hashCode() {
76          int result;
77          result = (id != null ? id.hashCode() : 0);
78          result = 29 * result + (username != null ? username.hashCode() : 0);
79          result = 29 * result + (password != null ? password.hashCode() : 0);
80          return result;
81      }
82  }