-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRegistrationInfo.java
More file actions
88 lines (81 loc) · 2.28 KB
/
Copy pathRegistrationInfo.java
File metadata and controls
88 lines (81 loc) · 2.28 KB
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
/**
* A List of registration info for
* Registered Users
* @author rcd1
*/
public class RegistrationInfo {
private String firstName;
private String lastName;
private String username;
private String password;
private int age;
private boolean freqFlyer;
/**
* Sets local variables to passed in parameters
* @param user's firstname
* @param user's lastname
* @param user's username
* @param user's password
* @param user's age
* @param to set if the user is a frequent flyer
*/
public RegistrationInfo(String firstName, String lastName, String username, String password, int age, boolean freqFlyer) {
this.firstName = firstName;
this.lastName = lastName;
this.username = username;
this.password = password;
this.age = age;
this.freqFlyer = freqFlyer;
}
//Getters
public String getFirstName() {
return firstName;
}
public String getLastName() {
return lastName;
}
protected String getUsername() {
return username;
}
protected String getPassword() {
return password;
}
public int getAge() {
return age;
}
public boolean getFreqFlyer() {
return freqFlyer;
}
// Setters
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public void setUsername(String username) {
this.username = username;
}
public void setPassword(String password) {
this.password = password;
}
public void setAge(int age) {
this.age = age;
}
public void setFreqFlyer(boolean freqFlyer) {
this.freqFlyer = freqFlyer;
}
// Other Methods
public String toString() {
return "First Name: " + firstName + "\nLast Name: " + lastName +
"\nUsername: " + username + "\nPassword: " + password +
"\nAge: " + age + "\nFrequent Flyer: " + freqFlyer;
}
/**
* compares the log in details with the saved details
* @return username and password
*/
public boolean tryLogin(String username, String password) {
return username.equals(this.username) && password.equals(this.password);
}
}