-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUser.java
More file actions
59 lines (55 loc) · 2.08 KB
/
Copy pathUser.java
File metadata and controls
59 lines (55 loc) · 2.08 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
import java.io.Serial;
import java.io.Serializable;
import java.util.ArrayList;
/** Project 4 - User.java
* The User class contains the create account/login information that belong to a user
* (whether they are a teacher or a student). This includes their name,
* username, password, and courses.
*
* @author Aarohi Panzade, Abel Zazjon, Aditi Barla, Yaseen Shady
*
* @version 11/14/21
*/
// implements Serializable to use the User object and store/serialize it
import java.io.Serial;
import java.io.Serializable;
import java.util.ArrayList;
// implements Serializable to use the User object and store/serialize it
public class User implements Serializable {
//initializes the following fields
private String name;
private String username;
private String password;
//private ArrayList<Course> courses; //courses taken by a student or taught by a teacher
//Constructs a newly allocated User object with the field values specified by the input parameter
//initializing the parameters/field variables
public User(String name, String username, String password) {
this.name = name;
this.username = username;
this.password = password;
}
//Returns the inputted password of the user when creating/logging into their account
public String getPassword() {
return password;
}
//sets the password instance variable to the value given in the parameter
public void setPassword(String password) {
this.password = password;
}
//Returns the inputted name of the user when creating/logging into their account
public String getName() {
return name;
}
//sets the password instance variable to the value given in the parameter
public void setName(String name) {
this.name = name;
}
//Returns the inputted username of the user when creating/logging into their account
public String getUsername() {
return username;
}
//sets the password instance variable to the value given in the parameter
public void setUsername(String username) {
this.username = username;
}
}