-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOwner.java
More file actions
39 lines (30 loc) · 1.12 KB
/
Copy pathOwner.java
File metadata and controls
39 lines (30 loc) · 1.12 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
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class Owner extends User {
public static List<Book> books = new ArrayList<>(); // Made public static
private final List<Customer> customers = new ArrayList<>(); // Internal customer list
private static final String ADMIN_USERNAME = "admin";
private static final String ADMIN_PASSWORD = "admin";
public Owner() {
super(ADMIN_USERNAME, ADMIN_PASSWORD);
}
@Override
public boolean login(String inputUsername, String inputPassword) {
return ADMIN_USERNAME.equals(inputUsername) && ADMIN_PASSWORD.equals(inputPassword);
}
public List<Customer> getCustomers() {
return customers;
}
public void addCustomer(Customer customer) {
customers.add(customer);
}
public void deleteCustomer(Customer customer) {
customers.remove(customer);
}
public void restockArrays() throws IOException {
books = FileHandler.readBook();
customers.clear();
customers.addAll(FileHandler.readCustomer());
}
}