Class Manager

java.lang.Object
entity.user.Manager
All Implemented Interfaces:
User

public class Manager extends Object implements User
Represents a Manager user in the housing application system. Implements the User interface. Stores personal details (ID, name, hashed password, age, marital status) and maintains a list of project IDs for the projects they are responsible for managing.
  • Constructor Details

    • Manager

      public Manager()
      Default constructor. Initializes a new Manager instance with default values (e.g., empty strings, zero age). The list of managed projects is initialized as an empty ArrayList. Note: Explicit call to super() is redundant here.
    • Manager

      public Manager(String userID, String name, String hashedPassword, int age, MaritalStatus maritalStatus)
      Parameterized constructor to create a Manager with specified initial personal details. The list of managed projects is initialized as an empty ArrayList; projects are typically assigned later.
      Parameters:
      userID - The unique user ID for the manager.
      name - The name of the manager.
      hashedPassword - The hashed password for the account.
      age - The age of the manager.
      maritalStatus - The marital status of the manager.
  • Method Details

    • getUserID

      public String getUserID()
      Gets the manager's user ID. Implements User.getUserID().
      Specified by:
      getUserID in interface User
      Returns:
      The user ID string.
    • setUserID

      public void setUserID(String userID)
      Sets the manager's user ID.
      Specified by:
      setUserID in interface User
      Parameters:
      userID - The user ID string.
    • getName

      public String getName()
      Gets the manager's name. Implements User.getName().
      Specified by:
      getName in interface User
      Returns:
      The name string.
    • setName

      public void setName(String name)
      Sets the manager's name.
      Specified by:
      setName in interface User
      Parameters:
      name - The name string.
    • getHashedPassword

      public String getHashedPassword()
      Gets the manager's hashed password. Implements User.getHashedPassword().
      Specified by:
      getHashedPassword in interface User
      Returns:
      The Base64 encoded hashed password string.
    • setHashedPassoword

      public void setHashedPassoword(String hashedPassword)
      Sets the manager's hashed password. Note: Typo in original method name ("Passoword"). Kept here to match provided code. Consider renaming to setHashedPassword for consistency. Implements User.setHashedPassoword(String).
      Specified by:
      setHashedPassoword in interface User
      Parameters:
      hashedPassword - The Base64 encoded hashed password string.
    • getAge

      public int getAge()
      Gets the manager's age.
      Specified by:
      getAge in interface User
      Returns:
      The age as an integer.
    • setAge

      public void setAge(int age)
      Sets the manager's age.
      Specified by:
      setAge in interface User
      Parameters:
      age - The age as an integer.
    • getMaritalStatus

      public MaritalStatus getMaritalStatus()
      Gets the manager's marital status.
      Specified by:
      getMaritalStatus in interface User
      Returns:
      The MaritalStatus enum value.
    • setMaritalStatus

      public void setMaritalStatus(MaritalStatus maritalStatus)
      Sets the manager's marital status.
      Specified by:
      setMaritalStatus in interface User
      Parameters:
      maritalStatus - The MaritalStatus enum value.
    • getProject

      public List<String> getProject()
      Gets the list of project IDs managed by this manager. Returns an empty list if the manager is not assigned to any projects. Note: Returns the internal list reference. Consider returning a copy if immutability is desired.
      Returns:
      The list of project ID strings.
    • setProject

      public void setProject(List<String> project)
      Sets the list of project IDs managed by this manager. Replaces the existing list with the provided one.
      Parameters:
      project - The list of project ID strings. A copy is stored internally.