-
Notifications
You must be signed in to change notification settings - Fork 0
/
User.java
63 lines (49 loc) · 1.28 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
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* A program Team Project
*
* <p>Purdue University -- CS18000 -- Spring 2024 -- Team Project-- </p>
*
* @author Purdue CS
* @version Mar 31, 2024
*/
public class User implements Serializable {
private static final long serialVersionUID = 1L;
private String username;
private String password;
private List<User> following = new ArrayList<>();
private Profile profile;
public User(String username, String password) {
this.username = username;
this.password = password;
}
public String getUsername() {
return username;
}
public String getPassword() {
return password;
}
public List<User> getFollowing() {
return following;
}
public void addFollowing(User user) {
following.add(user);
}
public void setName(String newValue) {
this.username = newValue;
}
public void removeFollowing(User connection) {
following.remove(connection);
}
public Profile getProfile() {
return profile;
}
public void setProfile(Profile profile) {
this.profile = profile;
}
public void addFollower(User follower) {
follower.addFollowing(this);
}
}