-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAppUser.java
340 lines (302 loc) · 7.81 KB
/
AppUser.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
/**
*
*/
package HowCanIHelp;
/**
* Project: How Can I Help? application Authors: Patrick Moran, Hamsa Nandana
* Shaik, Diane Weintraub
*
* Class purpose: The AppUser class stores the identifying information for
* individuals and/or organizations that are registered with the How Can I Help?
* app. Date created: 14 April 2020 Programmer(s): Patrick Moran & Diane
* Weintraub
*
* Revision: 14 Apr 2020, Moran, example explanation of what was changed in the
* code Revision: 20 Apr 2020, Weintraub, remove abstract class and add fields
* Revision: N/A
*
*/
public class AppUser {
// Declare variables
protected String email;
protected String password;
protected static long userCount = 0;
protected long userIDNumber;
protected String firstName;
protected String lastName;
protected String organizationName;
protected long houseNumber;
protected String streetName;
protected String city;
protected String state;
protected long zipCode;
protected String phoneNumber;
/**
* Constructor for organizational users sets the organization's identifying
* information: email of a contact, a password, ID number, name of the
* organization, first name of contact, last name of contact, address of the
* organization, and contact's phone number.
* <p>
*
* @param email
* @param password
* @param organizationName
* @param firstName
* @param lastName
* @param houseNumber
* @param streetName
* @param city
* @param state
* @param zipCode
* @param phoneNumber
*/
public AppUser(String email, String password, String organizationName, String firstName, String lastName,
long houseNumber, String streetName, String city, String state, long zipCode, String phoneNumber) {
this.email = email;
this.password = password;
this.organizationName = organizationName;
this.firstName = firstName;
this.lastName = lastName;
this.houseNumber = houseNumber;
this.streetName = streetName;
this.city = city;
this.state = state;
this.zipCode = zipCode;
this.phoneNumber = phoneNumber;
// Increment static field userCount each time an AppUser object is created, then
// set that as the user ID
userCount++;
userIDNumber = userCount;
}
//////////////////////////////////////////// get Methods
//////////////////////////////////////////// ////////////////////////////////////////////
/**
* The getEmail method returns the user's email.
* <p>
*
* @return the email
*/
public String getEmail() {
return email;
}
/**
* The getPassword method returns the password.
* <p>
*
* @return the password
*/
public String getPassword() {
return password;
}
/**
* The getidNumber method returns the user's ID number.
* <p>
*
* @return the ID number
*/
public long getIDNumber() {
return userIDNumber;
}
/**
* The getOrganizationName method returns the password.
* <p>
*
* @return the name of the organization
*/
public String getOrganizationName() {
return organizationName;
}
/**
* The getFirstName method returns the password.
* <p>
*
* @return the first name of the user or contact
*/
public String getFirstName() {
return firstName;
}
/**
* The getLastName method returns the password.
* <p>
*
* @return the last name of the user or contact
*/
public String getLastName() {
return lastName;
}
/**
* The getHouseNumber method returns the user's house number.
* <p>
*
* @return the house number
*/
public long getHouseNumber() {
return houseNumber;
}
/**
* The getStreetName method returns the user's street name.
* <p>
*
* @return the street name
*/
public String getStreetName() {
return streetName;
}
/**
* The getCity method returns the user's city.
* <p>
*
* @return the city
*/
public String getCity() {
return city;
}
/**
* The getState method returns the user's state.
* <p>
*
* @return the state
*/
public String getState() {
return state;
}
/**
* The getZipCode method returns the user's zip code.
* <p>
*
* @return the zip code
*/
public long getZipCode() {
return zipCode;
}
/**
* The getPhoneNumber method returns the user's phone number.
* <p>
*
* @return the phone number
*/
public String getPhoneNumber() {
return phoneNumber;
}
//////////////////////////////////////////// set Methods
//////////////////////////////////////////// ////////////////////////////////////////////
/**
* The setEmail method allows the user to change the email.
* <p>
*
* @param email the email to set
*/
public void setEmail(String email) {
this.email = email;
}
/**
* The setPassword method allows the user to change the password.
* <p>
*
* @param password the password to set
*/
public void setPassword(String password) {
this.password = password;
}
/**
* The setIDNumber method allows the user to change the user ID number.
* <p>
*
* @param idNumber the ID number to set
*/
public void setIDNumber(long idNumber) {
this.userIDNumber = idNumber;
}
/**
* The setOrganizationName method allows the user to change the name of the
* organization.
* <p>
*
* @param organizationName the name of the organization
*/
public void setOrganizationName(String organizationName) {
this.organizationName = organizationName;
}
/**
* The setFirstName method allows the user to change the first name.
* <p>
*
* @param firstName the first name of the user or contact
*/
public void setFirstName(String firstName) {
this.firstName = firstName;
}
/**
* The setLastName method allows the user to change the last name.
* <p>
*
* @param lastName the last name of the user or contact
*/
public void setLastName(String lastName) {
this.lastName = lastName;
}
/**
* The setHouseNumber method allows the user to change the house number.
* <p>
*
* @param the house number
*/
public void getHouseNumber(long houseNumber) {
this.houseNumber = houseNumber;
}
/**
* The setStreetName method allows the user to change the street name.
* <p>
*
* @param the street name
*/
public void getStreetName(String streetName) {
this.streetName = streetName;
}
/**
* The setCity method allows the the user to change the city.
* <p>
*
* @param the city
*/
public void setCity(String city) {
this.city = city;
}
/**
* The setState method allows the user to change the state.
* <p>
*
* @param the state
*/
public void getState(String state) {
this.state = state;
}
/**
* The setZipCode method allows the user to change the zip code.
* <p>
*
* @param the zip code
*/
public void getZipCode(long zipCode) {
this.zipCode = zipCode;
}
/**
* The setPhoneNumber method allows the user to set or change the phone number.
* <p>
*
* @param phoneNumber the phone number to set
*/
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
//////////////////////////////////////// Additional Methods
//////////////////////////////////////// /////////////////////////////////////////
@Override
public String toString() {
return "AppUser [email = " + email + ", password = " + password + ", user ID Number = " + userIDNumber
+ ", first name = " + firstName + ", last name = " + lastName + ", organization name = "
+ organizationName + ", house number = " + houseNumber + ", street name = " + streetName + ", city = "
+ city + ", state = " + state + ", zip code = " + zipCode + ", phone number = " + phoneNumber + "]";
}
}
//This is a test comment by Ronald to see if I can push and pull to git