KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > sync4j > framework > server > SyncUser


1 /**
2  * Copyright (C) 2003-2005 Funambol
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
19 package sync4j.framework.server;
20
21 import java.io.Serializable JavaDoc;
22 import org.apache.commons.lang.builder.ToStringBuilder;
23
24 /**
25  * This class represents a user with username and password and a list of roles.
26  *
27  * @author Luigia Fassina @ Funambol
28  *
29  * @version $Id: SyncUser.java,v 1.1 2005/05/16 17:32:55 nichele Exp $
30  *
31  */

32 public class SyncUser implements Serializable JavaDoc {
33
34     private String JavaDoc username;
35     private String JavaDoc password;
36     private String JavaDoc email;
37     private String JavaDoc firstname;
38     private String JavaDoc lastname;
39     private String JavaDoc[] roles;
40
41     /** Creates a new instance of SyncUser */
42     public SyncUser() {
43         this(null, null, null, null, null, null);
44     }
45
46     public SyncUser(String JavaDoc username, String JavaDoc password, String JavaDoc email, String JavaDoc firstname, String JavaDoc lastname, String JavaDoc[] roles) {
47         this.username = username;
48         this.password = password;
49         this.email = email;
50         this.firstname = firstname;
51         this.lastname = lastname;
52         this.roles = roles;
53     }
54
55     /** Getter for property username.
56      * @return Value of property username.
57      *
58      */

59     public String JavaDoc getUsername() {
60         return username;
61     }
62
63     /** Setter for property username.
64      * @param name New value of property username.
65      *
66      */

67     public void setUsername(String JavaDoc username) {
68         this.username = username;
69     }
70
71     /** Getter for property password.
72      * @return Value of property password.
73      *
74      */

75     public String JavaDoc getPassword() {
76         return password;
77     }
78
79     /** Setter for property password.
80      * @param name New value of property password.
81      *
82      */

83     public void setPassword(String JavaDoc password) {
84         this.password = password;
85     }
86
87     /** Getter for property email.
88      * @return Value of property email.
89      *
90      */

91     public String JavaDoc getEmail() {
92         return email;
93     }
94
95     /** Setter for property email.
96      * @param name New value of property email.
97      *
98      */

99     public void setEmail(String JavaDoc email) {
100         this.email = email;
101     }
102
103     /** Getter for property firstname.
104      * @return Value of property firstname.
105      *
106      */

107     public String JavaDoc getFirstname() {
108         return firstname;
109     }
110
111     /** Setter for property firstname.
112      * @param name New value of property firstname.
113      *
114      */

115     public void setFirstname(String JavaDoc firstname) {
116         this.firstname = firstname;
117     }
118
119     /** Getter for property lastname.
120      * @return Value of property lastname.
121      *
122      */

123     public String JavaDoc getLastname() {
124         return lastname;
125     }
126
127     /** Setter for property lastname.
128      * @param name New value of property lastname.
129      *
130      */

131     public void setLastname(String JavaDoc lastname) {
132         this.lastname = lastname;
133     }
134
135     /** Getter for property roles.
136      * @return Value of property roles.
137      *
138      */

139     public String JavaDoc[] getRoles() {
140         return roles;
141     }
142
143     /** Setter for property roles.
144      * @param name New value of property roles.
145      *
146      */

147     public void setRoles(String JavaDoc[] roles) {
148         this.roles = roles;
149     }
150
151     public String JavaDoc toString() {
152         ToStringBuilder sb = new ToStringBuilder(this);
153
154         sb.append("username:", username);
155         sb.append("password:", password);
156         sb.append("email:", email);
157         sb.append("firstname:", firstname);
158         sb.append("lastname:", lastname);
159
160         return sb.toString();
161     }
162
163 }
Popular Tags