1 /**
2 * Copyright 2011 The Kuali Foundation Licensed under the
3 * Educational Community License, Version 2.0 (the "License"); you may
4 * not use this file except in compliance with the License. You may
5 * obtain a copy of the License at
6 *
7 * http://www.osedu.org/licenses/ECL-2.0
8 *
9 * Unless required by applicable law or agreed to in writing,
10 * software distributed under the License is distributed on an "AS IS"
11 * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12 * or implied. See the License for the specific language governing
13 * permissions and limitations under the License.
14 */
15
16 package org.kuali.mobility.people.entity;
17
18 import java.io.Serializable;
19 import java.util.ArrayList;
20 import java.util.List;
21 import javax.xml.bind.annotation.XmlRootElement;
22
23 /**
24 * A class representing a person.
25 * @author Kuali Mobility Team (mobility.collab@kuali.org)
26 * @since
27 */
28 @XmlRootElement(name="person")
29 public class PersonImpl implements Serializable, Person {
30
31 private static final long serialVersionUID = -2125754188712894101L;
32
33 /**
34 * Firstname for this <code>Person</code>.
35 */
36 private String firstName;
37
38 /**
39 * Lastname for this <code>Person</code>.
40 */
41 private String lastName;
42
43 /**
44 * Display name for this <code>Person</code>.
45 */
46 private String displayName;
47
48 /**
49 * User name for this <code>Person</code>.
50 */
51 private String userName;
52
53 /**
54 * Locations for this <code>Person</code>.
55 */
56 private List<String> locations;
57
58 /**
59 * Affiliations for this <code>Person</code>.
60 */
61 private List<String> affiliations;
62
63 /**
64 * Departments this <code>Person</code> belongs to.
65 */
66 private List<String> departments;
67
68 /**
69 * Email address for this <code>Person</code>.
70 */
71 private String email;
72
73 /**
74 * Phone number for this <code>Person</code>.
75 */
76 private String phone;
77
78 /**
79 * Address for this <code>Person</code>.
80 */
81 private String address;
82
83
84 /**
85 * Creates a new instance of a <code>PersonImpl</code>
86 */
87 public PersonImpl() {
88 locations = new ArrayList<String>();
89 affiliations = new ArrayList<String>();
90 departments = new ArrayList<String>();
91 }
92
93 /* (non-Javadoc)
94 * @see org.kuali.mobility.people.entity.People#getHashedUserName()
95 */
96 @Override
97 public String getHashedUserName() {
98 return Integer.toString(Math.abs(userName.hashCode()));
99 }
100
101 /* (non-Javadoc)
102 * @see org.kuali.mobility.people.entity.People#getFirstName()
103 */
104 @Override
105 public String getFirstName() {
106 return firstName;
107 }
108
109 /* (non-Javadoc)
110 * @see org.kuali.mobility.people.entity.People#setFirstName(java.lang.String)
111 */
112 @Override
113 public void setFirstName(String firstName) {
114 this.firstName = firstName;
115 }
116
117 /* (non-Javadoc)
118 * @see org.kuali.mobility.people.entity.People#getLastName()
119 */
120 @Override
121 public String getLastName() {
122 return lastName;
123 }
124
125 /* (non-Javadoc)
126 * @see org.kuali.mobility.people.entity.People#setLastName(java.lang.String)
127 */
128 @Override
129 public void setLastName(String lastName) {
130 this.lastName = lastName;
131 }
132
133 /* (non-Javadoc)
134 * @see org.kuali.mobility.people.entity.People#getUserName()
135 */
136 @Override
137 public String getUserName() {
138 return userName;
139 }
140
141 /* (non-Javadoc)
142 * @see org.kuali.mobility.people.entity.People#setUserName(java.lang.String)
143 */
144 @Override
145 public void setUserName(String userName) {
146 this.userName = userName;
147 }
148
149 /* (non-Javadoc)
150 * @see org.kuali.mobility.people.entity.People#getDisplayName()
151 */
152 @Override
153 public String getDisplayName() {
154 return displayName;
155 }
156
157 /* (non-Javadoc)
158 * @see org.kuali.mobility.people.entity.People#setDisplayName(java.lang.String)
159 */
160 @Override
161 public void setDisplayName(String displayName) {
162 this.displayName = displayName;
163 }
164
165 /* (non-Javadoc)
166 * @see org.kuali.mobility.people.entity.People#getEmail()
167 */
168 @Override
169 public String getEmail() {
170 return email;
171 }
172
173 /* (non-Javadoc)
174 * @see org.kuali.mobility.people.entity.People#setEmail(java.lang.String)
175 */
176 @Override
177 public void setEmail(String email) {
178 this.email = email;
179 }
180
181 /* (non-Javadoc)
182 * @see org.kuali.mobility.people.entity.People#getPhone()
183 */
184 @Override
185 public String getPhone() {
186 return phone;
187 }
188
189 /* (non-Javadoc)
190 * @see org.kuali.mobility.people.entity.People#setPhone(java.lang.String)
191 */
192 @Override
193 public void setPhone(String phone) {
194 this.phone = phone;
195 }
196
197 /* (non-Javadoc)
198 * @see org.kuali.mobility.people.entity.People#getAddress()
199 */
200 @Override
201 public String getAddress() {
202 return address;
203 }
204
205 /* (non-Javadoc)
206 * @see org.kuali.mobility.people.entity.People#setAddress(java.lang.String)
207 */
208 @Override
209 public void setAddress(String address) {
210 this.address = address;
211 }
212
213 /* (non-Javadoc)
214 * @see org.kuali.mobility.people.entity.People#getLocations()
215 */
216 @Override
217 public List<String> getLocations() {
218 return locations;
219 }
220
221 /* (non-Javadoc)
222 * @see org.kuali.mobility.people.entity.People#setLocations(java.util.List)
223 */
224 @Override
225 public void setLocations(List<String> locations) {
226 this.locations = locations;
227 }
228
229 /* (non-Javadoc)
230 * @see org.kuali.mobility.people.entity.People#getAffiliations()
231 */
232 @Override
233 public List<String> getAffiliations() {
234 return affiliations;
235 }
236
237 /* (non-Javadoc)
238 * @see org.kuali.mobility.people.entity.People#setAffiliations(java.util.List)
239 */
240 @Override
241 public void setAffiliations(List<String> affiliations) {
242 this.affiliations = affiliations;
243 }
244
245 /* (non-Javadoc)
246 * @see org.kuali.mobility.people.entity.People#getDepartments()
247 */
248 @Override
249 public List<String> getDepartments() {
250 return departments;
251 }
252
253 /* (non-Javadoc)
254 * @see org.kuali.mobility.people.entity.People#setDepartments(java.util.List)
255 */
256 @Override
257 public void setDepartments(List<String> departments) {
258 this.departments = departments;
259 }
260 }