-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProvider.java
More file actions
63 lines (50 loc) · 2.06 KB
/
Copy pathProvider.java
File metadata and controls
63 lines (50 loc) · 2.06 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// Provider.java
package vhs;
import java.util.ArrayList;
import java.util.List;
public class Provider extends User {
private String specialty;
private String licenseNumber;
private List<String> availableSlots;
private List<Appointment> appointments;
public Provider() {
super();
this.availableSlots = new ArrayList<>();
this.appointments = new ArrayList<>();
}
public Provider(String id, String name, String email, String password,
String specialty, String licenseNumber) {
super(id, name, email, password, "PROVIDER");
this.specialty = specialty;
this.licenseNumber = licenseNumber;
this.availableSlots = new ArrayList<>();
this.appointments = new ArrayList<>();
}
// Getters and Setters
public String getSpecialty() { return specialty; }
public void setSpecialty(String specialty) { this.specialty = specialty; }
public String getLicenseNumber() { return licenseNumber; }
public void setLicenseNumber(String licenseNumber) { this.licenseNumber = licenseNumber; }
public List<String> getAvailableSlots() { return availableSlots; }
public void setAvailableSlots(List<String> availableSlots) { this.availableSlots = availableSlots; }
public List<Appointment> getAppointments() { return appointments; }
public void setAppointments(List<Appointment> appointments) { this.appointments = appointments; }
// Methods
public void addAvailableSlot(String slot) {
availableSlots.add(slot);
}
public void removeAvailableSlot(String slot) {
availableSlots.remove(slot);
}
public void addAppointment(Appointment appointment) {
appointments.add(appointment);
}
@Override
public void displayInfo() {
System.out.println("Provider: " + getName() + " | Specialty: " + specialty);
}
@Override
public String toString() {
return super.toString() + ", Specialty: " + specialty + ", License: " + licenseNumber;
}
}