-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuyer.java
More file actions
33 lines (27 loc) · 714 Bytes
/
Copy pathBuyer.java
File metadata and controls
33 lines (27 loc) · 714 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
import java.io.Serializable;
import java.util.List;
import java.util.ArrayList;
import java.util.Random;
public class Buyer implements Serializable{
private String email;
private int userId;
public Buyer(String email) {
this.email = email;
userId = new Random().nextInt(100000);
System.out.println("userID generated: " + userId);
}
public int getUserId() {
return userId;
}
public String getKeyLocation() {
return String.valueOf(userId);
}
public String getEmail() {
return email;
}
@Override
public boolean equals(Object o) {
Buyer buyer = (Buyer) o;
return userId == buyer.getUserId();
}
}