Package org.cswteams.ms3.entity
Class ConcreteShift
java.lang.Object
org.cswteams.ms3.entity.ConcreteShift
This class represents the concrete shift present in a schedule for a certain date.
This class should be operated only by the planners.
Instantiation of a shift, with some Doctors associated.
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefault constructor needed by LombokprotectedConcreteShift(Long id) ConcreteShift(Long date, Shift shift) Create a concrete shift for a specific shift in a specific date.protectedConcreteShift(Long date, Shift shift, List<DoctorAssignment> doctorAssignmentList) Create a concrete shift for a specific shift in a specific date, with a specific list of Doctors assigned. -
Method Summary
Modifier and TypeMethodDescriptionclone()getDoctorAssignmentStatus(Doctor doctor) Given aDoctor, return theConcreteShiftDoctorStatusfor which he/she is assigned for thisConcreteShift.booleanisDoctorAssigned(Doctor doctor) Given aDoctor, check if he/she is actively assigned to thisConcreteShift, i.e. is either on duty or on call for it.
-
Constructor Details
-
ConcreteShift
-
ConcreteShift
Create a concrete shift for a specific shift in a specific date.- Parameters:
date- The date of the concrete shiftshift- The abstract shift from which this shift is created
-
ConcreteShift
Create a concrete shift for a specific shift in a specific date, with a specific list of Doctors assigned.- Parameters:
date- The date of the concrete shiftshift- The abstract shift from which this shift is createddoctorAssignmentList- List of Doctors assigned to this concrete shift.
-
ConcreteShift
protected ConcreteShift()Default constructor needed by Lombok
-
-
Method Details
-
clone
-
getDoctorAssignmentStatus
Given aDoctor, return theConcreteShiftDoctorStatusfor which he/she is assigned for thisConcreteShift. If theDoctorprovided is not assigned to thisConcreteShift,nullis returned.- Parameters:
doctor- doctor for which the lookup is to be done- Returns:
- the
ConcreteShiftDoctorStatusfor the doctor, ornullif not found for thisConcreteShift.
-
isDoctorAssigned
Given aDoctor, check if he/she is actively assigned to thisConcreteShift, i.e. is either on duty or on call for it.If the
Doctoris removed, it is not actively assigned.- Parameters:
doctor- doctor for which the lookup is to be done- Returns:
trueifdoctoris on duty or on call for thisConcreteShift,falseelsewhere.
-