- java.lang.Object
-
- models.Request
-
- models.DeregisterProjectRequest
-
public class DeregisterProjectRequest extends Request
TheDeregisterProjectRequest
class represents a request made by a student to deregister a project. It is a subclass of theRequest
class and includes methods to approve and update the status of the request.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
studentID
The 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 newDeregisterProjectRequest
object.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 existingDeregisterProjectRequest
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
approve()
This method approves theDeregisterProjectRequest
.Student
getStudent()
This method returns theStudent
object 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 existingDeregisterProjectRequest
object.- 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 newDeregisterProjectRequest
object.- 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 theStudent
object associated with the student ID of theDeregisterProjectRequest
.- Returns:
- the
Student
object associated with the student ID
-
-