View Javadoc

1   /*
2   * Copyright 2005 Arnaud Prost
3   * 
4   * Arnaud.prost@gmail.com
5   * 
6   * This software is a computer program whose purpose is to ease the 
7   * management of software project.
8   * 
9   * This software is governed by the CeCILL  license under French law and
10  * abiding by the rules of distribution of free software.  You can  use, 
11  * modify and/ or redistribute the software under the terms of the CeCILL
12  * license as circulated by CEA, CNRS and INRIA at the following URL
13  * "http://www.cecill.info". 
14  * 
15  * As a counterpart to the access to the source code and  rights to copy,
16  * modify and redistribute granted by the license, users are provided only
17  * with a limited warranty  and the software's author,  the holder of the
18  * economic rights,  and the successive licensors  have only  limited
19  * liability. 
20  * 
21  * In this respect, the user's attention is drawn to the risks associated
22  * with loading,  using,  modifying and/or developing or reproducing the
23  * software by the user in light of its specific status of free software,
24  * that may mean  that it is complicated to manipulate,  and  that  also
25  * therefore means  that it is reserved for developers  and  experienced
26  * professionals having in-depth computer knowledge. Users are therefore
27  * encouraged to load and test the software's suitability as regards their
28  * requirements in conditions enabling the security of their systems and/or 
29  * data to be ensured and,  more generally, to use and operate it in the 
30  * same conditions as regards security. 
31  * 
32  * The fact that you are presently reading this means that you have had
33  * knowledge of the CeCILL license and that you accept its terms.
34  */
35  
36  
37  package net.sf.pmr.core.domain.user;
38  
39  import java.util.Set;
40  
41  import net.sf.pmr.core.domain.user.company.Company;
42  import net.sf.pmr.keopsframework.domain.object.AbstractDomainObject;
43  
44  import org.apache.commons.lang.builder.EqualsBuilder;
45  import org.apache.commons.lang.builder.HashCodeBuilder;
46  
47  /***
48   * @author Arnaud
49   */
50  public class UserImpl extends AbstractDomainObject implements User {
51     
52      private String firstName;
53  
54      private String lastName;
55  
56      private String login;
57  
58      private String password;
59  
60      private String email;
61  
62      private Company company;
63  
64      private Set basicProjects;
65  
66  
67      /***
68       * @return Returns the email.
69       */
70      public String getEmail() {
71          return email;
72      }
73      /***
74       * @param email The email to set.
75       */
76      public void setEmail(final String email) {
77          this.email = email;
78      }
79  
80      /*
81       * (non-Javadoc)
82       *
83       * @see net.sf.pmr.core.domain.user.User#getFirstName()
84       */
85      public String getFirstName() {
86          return firstName;
87  
88      }
89  
90      /*
91       * (non-Javadoc)
92       *
93       * @see net.sf.pmr.core.domain.user.User#getLastName()
94       */
95      public String getLastName() {
96          return lastName;
97      }
98  
99      /*
100      * (non-Javadoc)
101      *
102      * @see net.sf.pmr.core.domain.user.User#getLogin()
103      */
104     public String getLogin() {
105         return login;
106     }
107 
108     /*
109      * (non-Javadoc)
110      *
111      * @see net.sf.pmr.core.domain.user.User#getPassword()
112      */
113     public String getPassword() {
114         return password;
115     }
116 
117     /*
118      * (non-Javadoc)
119      *
120      * @see net.sf.pmr.core.domain.user.User#getCompany()
121      */
122     public Company getCompany() {
123         return company;
124     }
125 
126     /*
127      * (non-Javadoc)
128      *
129      * @see net.sf.pmr.core.domain.user.User#setFirstName(java.lang.String)
130      */
131     public void setFirstName(final String firstName) {
132         this.firstName = firstName;
133 
134     }
135 
136     /*
137      * (non-Javadoc)
138      *
139      * @see net.sf.pmr.core.domain.user.User#setLastName(java.lang.String)
140      */
141     public void setLastName(final String lastName) {
142         this.lastName = lastName;
143 
144     }
145 
146     /*
147      * (non-Javadoc)
148      *
149      * @see net.sf.pmr.core.domain.user.User#setLogin(java.lang.String)
150      */
151     public void setLogin(final String login) {
152         this.login = login;
153 
154     }
155 
156     /*
157      * (non-Javadoc)
158      *
159      * @see net.sf.pmr.core.domain.user.User#setPassword(java.lang.String)
160      */
161     public void setPassword(final String password) {
162         this.password = password;
163     }
164 
165     /*
166      * (non-Javadoc)
167      *
168      * @see net.sf.pmr.core.domain.user.User#setCompany(net.sf.pmr.core.domain.user.Company)
169      */
170     public void setCompany(final Company company) {
171         this.company = company;
172     }
173 
174     /***
175      * @return Returns the projects.
176      */
177     public Set getProjects() {
178         return this.basicProjects;
179     }
180 
181     /***
182      * @param projects
183      *            The projects to set.
184      */
185     public void setProjects(final Set projects) {
186         this.basicProjects = projects;
187     }
188 
189 
190     /***
191      * @see java.lang.Object#equals(Object)
192      */
193     public boolean equals(final Object object) {
194         if (!(object instanceof UserImpl)) {
195             return false;
196         }
197         UserImpl rhs = (UserImpl) object;
198         return new EqualsBuilder().append(
199                 this.login, rhs.login).isEquals();
200     }
201 
202 
203     /***
204      * @see java.lang.Object#hashCode()
205      */
206     public int hashCode() {
207         return new HashCodeBuilder(-800441645, 1772591927).append(this.login)
208                 .toHashCode();
209     }
210 }