KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > za > org > coefficient > authentication > CoefficientUser


1 /*
2  * Coefficient - facilitates project based collaboration
3  * Copyright (C) 2003, Dylan Etkin, CSIR icomtek
4  * PO Box 395
5  * Pretoria 0001, RSA
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  */

19
20 package za.org.coefficient.authentication;
21
22 import java.util.Date JavaDoc;
23 import java.util.Locale JavaDoc;
24 import java.util.TimeZone JavaDoc;
25
26 /**
27  * @hibernate.class
28  * table="COEFFICIENT_USER"
29  */

30 public class CoefficientUser implements java.io.Serializable JavaDoc {
31     //~ Instance fields ========================================================
32

33     private Date JavaDoc createDate;
34     private Locale JavaDoc language;
35     private Long JavaDoc id;
36     private Role systemRole;
37     private String JavaDoc email;
38     private String JavaDoc fullName;
39     private String JavaDoc password;
40     private String JavaDoc userName;
41     private TimeZone JavaDoc timeZone;
42     private boolean active;
43     private boolean hideInformation;
44     private long confId;
45     private long version;
46     //pvz: this will be used to create alias e-mail addresses to hide the users real e-mail address.
47
private String JavaDoc aliasEmail;
48     
49
50     //~ Constructors ===========================================================
51

52     public CoefficientUser() {
53         createDate = new Date JavaDoc(System.currentTimeMillis());
54         hideInformation = false;
55     }
56
57     //~ Methods ================================================================
58

59     /**
60      * Sets the value of active
61      *
62      * @param active Value to assign to this.active
63      */

64     public void setActive(boolean active) {
65         this.active = active;
66     }
67
68     /**
69      * Gets the value of active
70      *
71      * @return the value of active
72      * @hibernate.property
73      * column="ACTIVE"
74      * not-null="true"
75      */

76     public boolean getActive() {
77         return this.active;
78     }
79
80     /**
81      * Sets the value of active
82      *
83      * @param argEmail Value to assign to this.email
84      */

85     public void setConfirmationId(long confirmationId) {
86         this.confId = confirmationId;
87     }
88
89     /**
90      * Gets the value of confirmationId
91      *
92      * @return the value of confirmationId
93      * @hibernate.property
94      * column="CONFIRMATION_ID"
95      */

96     public long getConfirmationId() {
97         return this.confId;
98     }
99
100     /**
101      * Sets the value of create date
102      *
103      * @param createDate Value to assign to this.createDate
104      */

105     public void setCreateDate(Date JavaDoc createDate) {
106         this.createDate = createDate;
107     }
108
109     /**
110      * Gets the value of create date
111      *
112      * @return the value of create date
113      * @hibernate.property
114      * column="CREATE_DATE"
115      */

116     public Date JavaDoc getCreateDate() {
117         return this.createDate;
118     }
119
120     /**
121      * Sets the value of email
122      *
123      * @param argEmail Value to assign to this.email
124      */

125     public void setEmail(String JavaDoc argEmail) {
126         this.email = argEmail;
127     }
128
129     /**
130      * Gets the value of email
131      *
132      * @return the value of email
133      * @hibernate.property
134      * column="EMAIL"
135      * not-null="true"
136      */

137     public String JavaDoc getEmail() {
138         return this.email;
139     }
140
141     /**
142      * Sets the value of fullName
143      *
144      * @param argFullName Value to assign to this.fullName
145      */

146     public void setFullName(String JavaDoc argFullName) {
147         this.fullName = argFullName;
148     }
149
150     /**
151      * Gets the value of fullName
152      *
153      * @return the value of fullName
154      * @hibernate.property
155      * column="FULLNAME"
156      * not-null="true"
157      */

158     public String JavaDoc getFullName() {
159         return this.fullName;
160     }
161
162     /**
163      * Sets the value of hideInformation
164      *
165      * @param hideInformation Value to assign to this.hideInformation
166      */

167     public void setHideInformation(boolean hideInformation) {
168         this.hideInformation = hideInformation;
169     }
170
171     /**
172      * Gets the value of hideInformation
173      *
174      * @return the value of hideInformation
175      * @hibernate.property
176      * column="HIDE_INFORMATION"
177      * not-null="true"
178      */

179     public boolean getHideInformation() {
180         return this.hideInformation;
181     }
182
183     public void setId(Long JavaDoc id) {
184         this.id = id;
185     }
186
187     /**
188      * @hibernate.id
189      * generator-class="native"
190      */

191     public Long JavaDoc getId() {
192         return id;
193     }
194
195     /**
196      * Sets the value of language
197      *
198      * @param argLanguage Value to assign to this.language
199      */

200     public void setLanguage(Locale JavaDoc argLanguage) {
201         this.language = argLanguage;
202     }
203
204     /**
205      * Gets the value of language
206      *
207      * @return the value of language
208      * @hibernate.property
209      * type="locale"
210      * column="LANGUAGE"
211      * not-null="true"
212      */

213     public Locale JavaDoc getLanguage() {
214         return this.language;
215     }
216
217     /**
218      * Sets the value of password
219      *
220      * @param argPassword Value to assign to this.password
221      */

222     public void setPassword(String JavaDoc argPassword) {
223         this.password = argPassword;
224     }
225
226     /**
227      * Gets the value of password
228      *
229      * @return the value of password
230      * @hibernate.property
231      * column="PASSWORD"
232      * not-null="true"
233      */

234     public String JavaDoc getPassword() {
235         return this.password;
236     }
237
238     /**
239      * Sets the value of systemRole
240      *
241      * @param systemRole Value to assign to this.systemRole
242      */

243     public void setSystemRole(Role systemRole) {
244         this.systemRole = systemRole;
245     }
246
247     /**
248      * Gets the value of role
249      *
250      * @return the value of role
251      * @hibernate.many-to-one
252      * not-null="true"
253      * column="SYSTEM_ROLE"
254      */

255     public Role getSystemRole() {
256         return this.systemRole;
257     }
258
259     /**
260      * Sets the value of timeZone
261      *
262      * @param argTimeZone Value to assign to this.timeZone
263      */

264     public void setTimeZone(TimeZone JavaDoc argTimeZone) {
265         this.timeZone = argTimeZone;
266     }
267
268     /**
269      * Gets the value of timeZone
270      *
271      * @return the value of timeZone
272      * @hibernate.property
273      * type="timezone"
274      * column="TIME_ZONE"
275      * not-null="true"
276      */

277     public TimeZone JavaDoc getTimeZone() {
278         return this.timeZone;
279     }
280
281     /**
282      * Sets the value of userName
283      *
284      * @param argUserName Value to assign to this.userName
285      */

286     public void setUserName(String JavaDoc argUserName) {
287         this.userName = argUserName;
288     }
289
290     /**
291      * Gets the value of userName
292      *
293      * @return the value of userName
294      * @hibernate.property
295      * column="USERNAME"
296      * unique="true"
297      * not-null="true"
298      */

299     public String JavaDoc getUserName() {
300         return this.userName;
301     }
302
303     /**
304      * Sets the value of version
305      *
306      * @param version Value to assign to this.version
307      */

308     public void setVersion(long version) {
309         this.version = version;
310     }
311
312     /**
313      * Gets the value of version
314      *
315      * @return the value of version
316      * @hibernate.version
317      * column="VERSION"
318      * type="long"
319      */

320     public long getVersion() {
321         return this.version;
322     }
323
324     public boolean equals(Object JavaDoc other) {
325         CoefficientUser o = (CoefficientUser) other;
326
327         return (this != null) && (o != null)
328         && (((userName == null) && (o.userName == null))
329         || userName.equals(o.userName))
330         && (((password == null) && (o.password == null))
331         || password.equals(o.password));
332     }
333     
334     public String JavaDoc toString() {
335         return getFullName();
336     }
337
338     /**
339      * @return Returns the aliasEmail.
340      * May 16, 2005
341      * pieter20
342      * @hibernate.property
343      * column="ALIAS_EMAIL"
344      *
345      */

346     public String JavaDoc getAliasEmail() {
347         return aliasEmail;
348     }
349     
350
351     /**
352      * @param aliasEmail The aliasEmail to set.
353      * May 16, 2005
354      * pieter20
355      */

356     public void setAliasEmail(String JavaDoc aliasEmail) {
357         this.aliasEmail = aliasEmail;
358     }
359     
360 }
361
Popular Tags