Module sc2002_fypms
Package models

Class TransferStudentRequest


  • public class TransferStudentRequest
    extends Request
    The TransferStudentRequest class represents a request made to transfer a student from one supervisor to another. It is a subclass of the Request class
    • Field Detail

      • replacementSupervisorID

        private java.lang.String replacementSupervisorID
        The ID of the supervisor who will be the new supervisor for the transferred student.
    • Constructor Detail

      • TransferStudentRequest

        public TransferStudentRequest​(java.lang.String senderID,
                                      java.lang.String receiverID,
                                      int projectID,
                                      int requestID,
                                      RequestStatus status,
                                      java.util.ArrayList<java.lang.String> history,
                                      java.lang.String replacementSupervisorID)
        Constructs a TransferStudentRequest object with the given sender ID, receiver ID, project ID, request ID, request status, history, and replacement supervisorID. This constructor is used for initializing existing requests.
        Parameters:
        senderID - the ID of the sender of the request
        receiverID - the ID of the receiver of the request
        projectID - the ID of the project associated with the request
        requestID - the ID of the request
        status - the status of the request
        history - the history of the request
        replacementSupervisorID - the ID of the supervisor who will be the new supervisor for the transferred student
      • TransferStudentRequest

        public TransferStudentRequest​(java.lang.String senderID,
                                      java.lang.String receiverID,
                                      int projectID,
                                      java.lang.String replacementSupervisorID)
        Constructs a TransferStudentRequest object with the given sender ID, receiver ID, project ID, and replacement supervisor ID. This constructor is used for creating new requests.
        Parameters:
        senderID - the ID of the sender of the request
        receiverID - the ID of the receiver of the request
        projectID - the ID of the project associated with the request
        replacementSupervisorID - the ID of the supervisor who will be the new supervisor for the transferred student
    • Method Detail

      • approve

        public boolean approve()
        Approves the TransferStudentRequest object. This method updates the supervisor and project information, and saves the data to the CSV file.
        Overrides:
        approve in class Request
        Returns:
        true if the request is approved successfully, false if one of the following conditions is true:
        • The project is not submitted by the sender/supervisor
        • The replacement supervisor has reached the maximum number of projects he/she can supervise
      • getReplacementSupervisorID

        public java.lang.String getReplacementSupervisorID()
        Returns the ID of the supervisor who will be the new supervisor for the transferred student.
        Returns:
        the ID of the replacement supervisor