- java.lang.Object
-
- models.Request
-
- models.AllocateProjectRequest
-
public class AllocateProjectRequest extends Request
TheAllocateProjectRequest
class represents a request to allocate a project to a student. It is a subclass of theRequest
class.
-
-
Constructor Summary
Constructors Constructor Description AllocateProjectRequest(java.lang.String senderID, java.lang.String receiverID, int projectID)
Constructs anAllocateProjectRequest
object for a new request.AllocateProjectRequest(java.lang.String senderID, java.lang.String receiverID, int projectID, int requestID, RequestStatus status, java.util.ArrayList<java.lang.String> history)
Constructs anAllocateProjectRequest
object for an existing request.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
approve()
Approves the request to allocate the project to the student.boolean
reject()
Rejects the request to allocate the project to the student.-
Methods inherited from class models.Request
addHistory, getHistory, getProject, getReceiver, getRequestID, getSender, getStatus, getType, setHistory, setStatus, setType
-
-
-
-
Constructor Detail
-
AllocateProjectRequest
public AllocateProjectRequest(java.lang.String senderID, java.lang.String receiverID, int projectID, int requestID, RequestStatus status, java.util.ArrayList<java.lang.String> history)
Constructs anAllocateProjectRequest
object for an existing request.- Parameters:
senderID
- the user ID of the senderreceiverID
- the user ID of the receiverprojectID
- the ID of the projectrequestID
- the ID of the requeststatus
- the current status of the requesthistory
- the history of the request
-
AllocateProjectRequest
public AllocateProjectRequest(java.lang.String senderID, java.lang.String receiverID, int projectID)
Constructs anAllocateProjectRequest
object for a new request.- Parameters:
senderID
- the user ID of the senderreceiverID
- the user ID of the receiverprojectID
- the ID of the project
-
-
Method Detail
-
approve
public boolean approve()
Approves the request to allocate the project to the student.- Overrides:
approve
in classRequest
- Returns:
- true if the request is approved and data is saved successfully,
false if the supervisor has already reached the maximum number of
projects that they can supervise (
Supervisor.MAX_PROJECTS
) or when data is not saved successfully.
-
-