-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUser.java
94 lines (83 loc) · 2.54 KB
/
User.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
import java.util.UUID;
import java.util.Date;
public class User {
protected String firstName;
protected String lastName;
protected String email;
protected String dateOfBirth;
protected int phone;
protected String password;
protected Contact contact;
protected UUID thisUUID;
/**
* Constructor that assumes an existing UUID (assumes the User object already existed)
* @param firstName The User's first name
* @param lastName The user's last name
* @param number The user's phone number
* @param email The user's email address
* @param password The user's password
* @param dateOfBirth The user's DOB
* @param thisUUID The user's UUID
*/
public User(String firstName, String lastName, int number, String email, String password, String dateOfBirth, UUID thisUUID){
this.firstName = firstName;
this.lastName = lastName;
this.phone = number;
this.email = email;
this.password = password;
this.dateOfBirth = dateOfBirth;
this.thisUUID = thisUUID;
}
/**
* Constructor for new user (generates random UUID)
* @param firstName The user's first name
* @param lastName The user's last name
* @param number The user's phone number
* @param email The user's email address
* @param password The user's password
* @param dateOfBirth The user's DOB
*/
public User(String firstName, String lastName, int number, String email, String password, String dateOfBirth){
this(firstName, lastName, number, email, password, dateOfBirth, UUID.randomUUID());
}
public String getFirstName()
{
return this.firstName;
}
public String getLastName()
{
return this.lastName;
}
public int getPhone()
{
return this.phone;
}
public String getPassword()
{
return this.password;
}
public Contact getContact(){
return this.contact;
}
public String getDateOfBirth(){
return this.dateOfBirth;
}
/**
* Returns this user's UUID
* @return this user's UUID
*/
public UUID getUUID()
{
return this.thisUUID;
}
public String toString()
{
return "Name: " + this.firstName + " " + this.lastName + "\n" +
"Email: " + this.email + " Phone: " + this.phone + "\n" +
"Birthday: " + this.dateOfBirth.toString() + "\n" +
"Password: " + this.password + " UUID: " + this.thisUUID;
}
public static User getInstance() {
return null;
}
}