KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > geinuke > vo > UserVO


1
2
3  /*
4  -- GeiNuke --
5 Copyright (c) 2005 by Roberto Sidoti [geinuke@users.sourceforge.net]
6  http://www.hostingjava.it/-geinuke/
7
8 This file is part of GeiNuke.
9
10     GeiNuke is free software; you can redistribute it and/or modify
11     it under the terms of the GNU General Public License as published by
12     the Free Software Foundation; either version 2 of the License, or
13     (at your option) any later version.
14
15     GeiNuke is distributed in the hope that it will be useful,
16     but WITHOUT ANY WARRANTY; without even the implied warranty of
17     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18     GNU General Public License for more details.
19
20     You should have received a copy of the GNU General Public License
21     along with GeiNuke; if not, write to the Free Software
22     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 */

24 package com.geinuke.vo;
25
26 import java.io.Serializable JavaDoc;
27 import java.util.Date JavaDoc;
28 import java.util.GregorianCalendar JavaDoc;
29
30 import com.geinuke.common.NukeRoleI;
31 import com.geinuke.common.UserI;
32
33
34 public class UserVO implements UserI,Serializable JavaDoc{
35     protected int id=UserI.ANONYMOUS_ID;
36     protected NukeRoleI role=null;
37     protected String JavaDoc defStyle=null;
38     protected String JavaDoc name=null;
39     protected String JavaDoc sName=null;
40     protected String JavaDoc fEmail=null;
41     protected String JavaDoc email=null;
42     protected String JavaDoc slogan=null;
43     protected String JavaDoc webUrl=null;
44     protected String JavaDoc uName=null;
45     protected String JavaDoc password=null;
46     protected String JavaDoc avatar=null;
47     protected long regDate=0;
48     
49     /**
50      *
51      */

52     public UserVO() {
53         super();
54         this.role=new RoleVO();
55     }
56     /**
57      * @return Returns the defStyle.
58      */

59     public String JavaDoc getDefStyle() {
60         return defStyle;
61     }
62     /**
63      * @param defStyle The defStyle to set.
64      */

65     public void setDefStyle(String JavaDoc defStyle) {
66         this.defStyle = defStyle;
67     }
68     /**
69      * @return Returns the id.
70      */

71     public int getId() {
72         return id;
73     }
74     /**
75      * @param id The id to set.
76      */

77     public void setId(int id) {
78         this.id = id;
79     }
80     /**
81      * @return Returns the role.
82      */

83     public NukeRoleI getRole() {
84         return role;
85     }
86     /**
87      * @param role The role to set.
88      */

89     public void setRole(NukeRoleI role) {
90         this.role = role;
91     }
92     /**
93      * @return Returns the name.
94      */

95     public String JavaDoc getName() {
96         return name;
97     }
98     /**
99      * @param name The name to set.
100      */

101     public void setName(String JavaDoc name) {
102         this.name = name;
103     }
104     public String JavaDoc getUName() {
105         return uName;
106     }
107     public void setUName(String JavaDoc name) {
108         uName = name;
109     }
110     public String JavaDoc getPassword() {
111         return password;
112     }
113     public void setPassword(String JavaDoc password) {
114         this.password = password;
115     }
116     
117     public boolean isAdmin() {
118         
119         return this.getRole().getLevela()>=1000;
120     }
121     
122     public boolean isMaster() {
123         
124         return this.getRole().getLevela()>=10000;
125     }
126     public String JavaDoc getAvatar() {
127         return avatar;
128     }
129     public void setAvatar(String JavaDoc avatar) {
130         if(avatar!=null)
131             this.avatar = avatar;
132     }
133     public long getRegDate() {
134         return regDate;
135     }
136     
137     public GregorianCalendar JavaDoc getRegDateTime() {
138         GregorianCalendar JavaDoc gc=null;
139         Date JavaDoc d=new Date JavaDoc(this.regDate);
140         gc=new GregorianCalendar JavaDoc();
141         gc.setTime(d);
142         return gc;
143     }
144     
145     
146     public void setRegDate(long regDate) {
147         this.regDate = regDate;
148     }
149     /**
150      * @return Returns the email.
151      */

152     public String JavaDoc getEmail() {
153         return email;
154     }
155     /**
156      * @param email The email to set.
157      */

158     public void setEmail(String JavaDoc email) {
159         this.email = email;
160     }
161     /**
162      * @return Returns the fEmail.
163      */

164     public String JavaDoc getFEmail() {
165         return fEmail;
166     }
167     /**
168      * @param email The fEmail to set.
169      */

170     public void setFEmail(String JavaDoc email) {
171         fEmail = email;
172     }
173     /**
174      * @return Returns the slogan.
175      */

176     public String JavaDoc getSlogan() {
177         return slogan;
178     }
179     /**
180      * @param slogan The slogan to set.
181      */

182     public void setSlogan(String JavaDoc slogan) {
183         this.slogan = slogan;
184     }
185     /**
186      * @return Returns the sName.
187      */

188     public String JavaDoc getSName() {
189         return sName;
190     }
191     /**
192      * @param name The sName to set.
193      */

194     public void setSName(String JavaDoc name) {
195         sName = name;
196     }
197     /**
198      * @return Returns the webUrl.
199      */

200     public String JavaDoc getWebUrl() {
201         return webUrl;
202     }
203     /**
204      * @param webUrl The webUrl to set.
205      */

206     public void setWebUrl(String JavaDoc webUrl) {
207         this.webUrl = webUrl;
208     }
209 }
210
Popular Tags