Class Officer

All Implemented Interfaces:
User

public class Officer extends Applicant
Represents an Officer user in the housing application system. An Officer is also an Applicant, inheriting all applicant properties and behaviors, but additionally has attributes related to their official duties. This includes a list of projects they are assigned to work on and their registration status for various projects.
See Also:
  • Constructor Details

    • Officer

      public Officer()
      Default constructor. Initializes a new Officer instance by calling the default Applicant constructor and initializing the officer-specific fields (officerProject list and registrationStatus map) as empty collections.
    • Officer

      public Officer(String userID, String name, String hashedPassword, int age, MaritalStatus maritalStatus)
      Parameterized constructor to create an Officer with specified initial personal details. Calls the corresponding Applicant constructor to initialize inherited fields. Initializes the officer-specific fields (officerProject list and registrationStatus map) as empty collections. Project assignments and statuses are typically managed separately.
      Parameters:
      userID - The unique user ID for the officer.
      name - The name of the officer.
      hashedPassword - The hashed password for the account.
      age - The age of the officer.
      maritalStatus - The marital status of the officer.
  • Method Details

    • getOfficerProject

      public List<String> getOfficerProject()
      Gets the list of project IDs the officer is assigned to or registered for. Returns an empty list if the officer is not assigned to any projects. Note: Returns the internal list reference. Consider returning a copy if immutability outside this class is desired.
      Returns:
      The list of project ID strings.
    • setOfficerProject

      public void setOfficerProject(List<String> officerProject)
      Sets the list of project IDs the officer is assigned to or registered for. Replaces the existing list with the provided one.
      Parameters:
      officerProject - The list of project ID strings. A copy is stored internally.
    • getRegistrationStatus

      public Map<String,RegistrationStatus> getRegistrationStatus()
      Gets the map containing the officer's registration status for different projects. Returns an empty map if no statuses have been recorded.
      Returns:
      A map where keys are project IDs and values are RegistrationStatus.
    • getRegistrationStatusByID

      public RegistrationStatus getRegistrationStatusByID(String ID)
      Gets the registration status for a specific project ID from the status map.
      Parameters:
      ID - The ID of the project whose registration status is needed.
      Returns:
      The RegistrationStatus for the given project ID, or null if not found.
    • setRegistrationStatusByID

      public void setRegistrationStatusByID(String ID, RegistrationStatus status)
      Sets or updates the registration status for a specific project ID in the status map. Typically used when an officer applies to register or when a manager approves/rejects the registration.
      Parameters:
      ID - The ID of the project whose registration status is being set.
      status - The RegistrationStatus to set for the project.