Class Request

java.lang.Object
entity.request.Request
All Implemented Interfaces:
Requestable
Direct Known Subclasses:
BTOApplication, BTOWithdrawal, Enquiry, OfficerRegistration

public class Request extends Object implements Requestable
Base entity class representing a generic request within the system. This class holds common attributes shared by all specific request types, such as an ID, type, associated user and project IDs, and the overall processing status. It is intended to be extended by concrete request classes like BTOApplication, Enquiry, BTOWithdrawal, and OfficerRegistration. Implements the Requestable interface (assumed).
  • Constructor Details

    • Request

      public Request()
      Default constructor. Initializes a new Request instance with default values: empty strings for IDs, RequestType.NONE, and RequestStatus.PENDING.
    • Request

      public Request(String requestID, RequestType requestType, String userID, String projectID, RequestStatus requestStatus)
      Parameterized constructor to create a Request with specified initial values. Used by subclasses to initialize the common request properties.
      Parameters:
      requestID - The unique ID for this request.
      requestType - The RequestType indicating the kind of request.
      userID - The ID of the user associated with this request.
      projectID - The ID of the project related to this request.
      requestStatus - The initial RequestStatus (e.g., PENDING).
  • Method Details

    • getRequestID

      public String getRequestID()
      Gets the unique identifier for this request.
      Specified by:
      getRequestID in interface Requestable
      Returns:
      The request ID string.
    • setRequestID

      public void setRequestID(String requestID)
      Sets the unique identifier for this request.
      Specified by:
      setRequestID in interface Requestable
      Parameters:
      requestID - The request ID string.
    • getRequestType

      public RequestType getRequestType()
      Gets the type of this request.
      Specified by:
      getRequestType in interface Requestable
      Returns:
      The RequestType enum value.
    • setRequestType

      public void setRequestType(RequestType requestType)
      Sets the type of this request.
      Specified by:
      setRequestType in interface Requestable
      Parameters:
      requestType - The RequestType enum value.
    • getUserID

      public String getUserID()
      Gets the user ID associated with this request.
      Specified by:
      getUserID in interface Requestable
      Returns:
      The user ID string.
    • setUserID

      public void setUserID(String userID)
      Sets the user ID associated with this request.
      Specified by:
      setUserID in interface Requestable
      Parameters:
      userID - The user ID string.
    • getProjectID

      public String getProjectID()
      Gets the project ID related to this request.
      Specified by:
      getProjectID in interface Requestable
      Returns:
      The project ID string. Can be null or empty if not applicable.
    • setProjectID

      public void setProjectID(String projectID)
      Sets the project ID related to this request.
      Specified by:
      setProjectID in interface Requestable
      Parameters:
      projectID - The project ID string.
    • getRequestStatus

      public RequestStatus getRequestStatus()
      Gets the overall processing status of this request.
      Specified by:
      getRequestStatus in interface Requestable
      Returns:
      The RequestStatus enum value (e.g., PENDING, DONE).
    • setRequestStatus

      public void setRequestStatus(RequestStatus requestStatus)
      Sets the overall processing status of this request.
      Specified by:
      setRequestStatus in interface Requestable
      Parameters:
      requestStatus - The RequestStatus enum value.