forked from Vidhee1411/Internship-Application
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAdministrator.java
61 lines (53 loc) · 1.93 KB
/
Administrator.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
import java.util.UUID;
/**
* The Administrator class creates a administrator account in the internship system.
* @author 10/17/2021 Vidhee Patel
*/
public class Administrator extends User{
private static final int PERMISSION = -1;
public Administrator(String firstName, String lastName, String email, String password,UUID id) {
super(firstName, lastName, email, password,id);
}
/**
* The hideReview method hides the given review.
* @param review The review to be hidden.
*/
public void hideReview(Review review) {
review.toggleVisibility();
}
/**
* The removeListing method removes the given listing.
* @param company The company's listing to be removed.
* @return true if the listing is removed.
*/
public boolean removeListing(JobListing listing) {
SearchableDatabase temp = SearchableDatabase.getInstance();
temp.removeJobListing(listing);
return true;
}
/**
* The removeAccount method removes the given user from the system.
* @param user the user to be removed
*/
public void removeAccount(User user) {
SearchableDatabase temp = SearchableDatabase.getInstance();
temp.removeUser(user);
}
/**
* The registerAccount method registers the new administrator account in the system.
* @param firstName The firstName of the Administrator.
* @param lastName The lastName of the Administrator.
* @param email The email of the Administrator.
* @param password Password of the account.
*/
public void registerAccount(String firstName, String lastName, String email, String password) {
SearchableDatabase temp = SearchableDatabase.getInstance();
temp.addUser(new Administrator(firstName, lastName, email, password, id));
}
public UUID getUUID() {
return super.getUserUUID();
}
public int getPermission() {
return PERMISSION;
}
}