-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUser.java
More file actions
38 lines (32 loc) · 984 Bytes
/
User.java
File metadata and controls
38 lines (32 loc) · 984 Bytes
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
import java.util.*;
public class User {
private int userId;
private String username;
private String password;
private String email;
private List<Notebook> notebooks;
public User(int userId, String username, String password, String email) {
this.userId = userId;
this.username = username;
this.password = password;
this.email = email;
this.notebooks = new ArrayList<>();
}
public void createNotebook(String name) {
notebooks.add(new Notebook(name));
}
public void deleteNotebook(String name) {
notebooks.removeIf(nb -> nb.getName().equalsIgnoreCase(name));
}
public List<Notebook> getNotebooks() {
return notebooks;
}
public String getUsername() { return username; }
public int getUserId() {
return userId;
}
public String getPassword() { return password; }
public String getEmail() {
return email;
}
}