Package Singletons
Class AppointmentFilter
java.lang.Object
Singletons.AppointmentFilter
Filters appointments based on doctor, patient, date, and status
Uses the builder pattern to allow for optional parameters
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfilter
(List<Appointment> appointments) Filters the given list of appointments based on the filter criteria.filterByDate
(LocalDate date) filterByDoctor
(String doctorId) filterByPatient
(String patientId) filterByStatus
(Appointment.Status status)
-
Constructor Details
-
AppointmentFilter
public AppointmentFilter()
-
-
Method Details
-
filterByDoctor
-
filterByPatient
-
filterByDate
-
filterByStatus
-
filter
Filters the given list of appointments based on the filter criteria. Original list is not modified. If no filter criteria are set, the original list is returned. If original list is empty, an empty list is returned- Parameters:
appointments
- list of appointments before filtering- Returns:
- new list of appointments after filtering
-