- java.lang.Object
-
- models.Request
-
- models.DeregisterProjectRequest
-
public class DeregisterProjectRequest extends Request
TheDeregisterProjectRequestclass represents a request made by a student to deregister a project. It is a subclass of theRequestclass and includes methods to approve and update the status of the request.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringstudentIDThe ID of the student sending the deregistration request.
-
Constructor Summary
Constructors Constructor Description DeregisterProjectRequest(java.lang.String senderID, java.lang.String receiverID, int projectID)This constructor creates a newDeregisterProjectRequestobject.DeregisterProjectRequest(java.lang.String senderID, java.lang.String receiverID, int projectID, int requestID, RequestStatus status, java.util.ArrayList<java.lang.String> history)This constructor initializes an existingDeregisterProjectRequestobject.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanapprove()This method approves theDeregisterProjectRequest.StudentgetStudent()This method returns theStudentobject associated with the student ID of theDeregisterProjectRequest.-
Methods inherited from class models.Request
addHistory, getHistory, getProject, getReceiver, getRequestID, getSender, getStatus, getType, reject, setHistory, setStatus, setType
-
-
-
-
Constructor Detail
-
DeregisterProjectRequest
public DeregisterProjectRequest(java.lang.String senderID, java.lang.String receiverID, int projectID, int requestID, RequestStatus status, java.util.ArrayList<java.lang.String> history)This constructor initializes an existingDeregisterProjectRequestobject.- Parameters:
senderID- the ID of the sender of the requestreceiverID- the ID of the receiver of the requestprojectID- the ID of the project associated with the requestrequestID- the ID of the requeststatus- the current status of the requesthistory- the list of statuses that the request went through
-
DeregisterProjectRequest
public DeregisterProjectRequest(java.lang.String senderID, java.lang.String receiverID, int projectID)This constructor creates a newDeregisterProjectRequestobject.- Parameters:
senderID- the ID of the sender of the requestreceiverID- the ID of the receiver of the requestprojectID- the ID of the project associated with the request
-
-
Method Detail
-
approve
public boolean approve()
This method approves theDeregisterProjectRequest. It updates the status of the request, the status and availability of the project, and the number of projects supervised by the project's supervisor.
-
getStudent
public Student getStudent()
This method returns theStudentobject associated with the student ID of theDeregisterProjectRequest.- Returns:
- the
Studentobject associated with the student ID
-
-