Module sc2002_fypms
Package models

Class AllocateProjectRequest


  • public class AllocateProjectRequest
    extends Request
    The AllocateProjectRequest class represents a request to allocate a project to a student. It is a subclass of the Request class.
    • 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 an AllocateProjectRequest object for an existing request.
        Parameters:
        senderID - the user ID of the sender
        receiverID - the user ID of the receiver
        projectID - the ID of the project
        requestID - the ID of the request
        status - the current status of the request
        history - the history of the request
      • AllocateProjectRequest

        public AllocateProjectRequest​(java.lang.String senderID,
                                      java.lang.String receiverID,
                                      int projectID)
        Constructs an AllocateProjectRequest object for a new request.
        Parameters:
        senderID - the user ID of the sender
        receiverID - the user ID of the receiver
        projectID - the ID of the project
    • Method Detail

      • approve

        public boolean approve()
        Approves the request to allocate the project to the student.
        Overrides:
        approve in class Request
        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.
      • reject

        public boolean reject()
        Rejects the request to allocate the project to the student.
        Overrides:
        reject in class Request
        Returns:
        true if the request is rejected and data is saved successfully, false otherwise