Module sc2002_fypms
Package models

Class ChangeProjectTitleRequest


  • public class ChangeProjectTitleRequest
    extends Request
    The ChangeProjectTitleRequest class represents a request from a supervisor to change the title of a project. It is a subclass of the Request class.
    • Field Detail

      • newTitle

        private java.lang.String newTitle
        The new title for the project.
    • Constructor Detail

      • ChangeProjectTitleRequest

        public ChangeProjectTitleRequest​(java.lang.String senderID,
                                         java.lang.String receiverID,
                                         int projectID,
                                         int requestID,
                                         RequestStatus status,
                                         java.util.ArrayList<java.lang.String> history,
                                         java.lang.String newTitle)
        Constructs a ChangeProjectTitleRequest object to initialize an existing request.
        Parameters:
        senderID - the ID of the user who sent the request
        receiverID - the ID of the user who receives the request
        projectID - the ID of the project related to the request
        requestID - the ID of the request
        status - the current status of the request
        history - the history of the request
        newTitle - the new title for the project
      • ChangeProjectTitleRequest

        public ChangeProjectTitleRequest​(java.lang.String senderID,
                                         java.lang.String receiverID,
                                         int projectID,
                                         java.lang.String newTitle)
        Constructs a ChangeProjectTitleRequest object to create a new request.
        Parameters:
        senderID - the ID of the user who sent the request
        receiverID - the ID of the user who receives the request
        projectID - the ID of the project related to the request
        newTitle - the new title for the project
    • Method Detail

      • approve

        public boolean approve()
        Approves the request to change the project title and updates the project's title.
        Overrides:
        approve in class Request
        Returns:
        true if the request is approved and the data is saved successfully, false if the receiver of the request is not the supervisor who submitted the project or when data is not saved successfully.
      • getNewTitle

        public java.lang.String getNewTitle()
        Returns the new title for the project in the request.
        Returns:
        the new title