-
Notifications
You must be signed in to change notification settings - Fork 3k
/
Copy pathUser.java
44 lines (35 loc) · 881 Bytes
/
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
package onlineshoppingservice;
import java.util.ArrayList;
import java.util.List;
public class User {
private final String id;
private final String name;
private final String email;
private final String password;
private final List<Order> orders;
public User(String id, String name, String email, String password) {
this.id = id;
this.name = name;
this.email = email;
this.password = password;
this.orders = new ArrayList<>();
}
public void addOrder(Order order) {
orders.add(order);
}
public String getId() {
return id;
}
public String getName() {
return name;
}
public String getEmail() {
return email;
}
public String getPassword() {
return password;
}
public List<Order> getOrders() {
return orders;
}
}