Class Project
java.lang.Object
entity.project.Project
Represents a housing project entity.
Contains details such as project identification, name, associated neighbourhoods,
available units and prices for different flat types, application timeline (open/close dates),
associated manager, available officer slots, assigned officers, applicants who have booked units,
and the project's visibility status.
-
Constructor Summary
ConstructorsConstructorDescriptionProject()Default constructor.Project(String projectID, String name, List<String> neighbourhood, Map<FlatType, Integer> availableUnit, Map<FlatType, Integer> price, LocalDate openDate, LocalDate closeDate, String managerID, int availableOfficer, boolean visibility) Parameterized constructor to create a Project with specified initial values. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddApplicantID(String applicantID) Adds a single applicant ID to the list of applicants who have booked a flat.Gets the list of user IDs of applicants who have successfully booked a flat in this project.intGets the number of available officer slots for this project.Gets the map of available units per flat type.Gets the application close date.Gets the user ID of the manager responsible for this project.getName()Gets the name of the project.Gets the list of nearby neighbourhood names.Gets the list of user IDs of officers assigned to this project.Gets the application open date.getPrice()Gets the map of prices per flat type.Gets the unique project ID.booleanGets the visibility status of the project.voidCopies all attribute values from anotherProjectobject into this object.voidsetApplicantID(List<String> applicantID) Sets the list of user IDs of applicants who have successfully booked a flat in this project.voidsetAvailableOfficer(int availableOfficer) Sets the number of available officer slots for this project.voidsetAvailableUnit(FlatType flat, Integer availableUnit) Sets the number of available units for a specific flat type.voidsetAvailableUnit(Map<FlatType, Integer> availableUnit) Sets the map of available units per flat type.voidsetCloseDate(LocalDate closeDate) Sets the application close date.voidsetManagerID(String managerID) Sets the user ID of the manager responsible for this project.voidSets the name of the project.voidsetNeighborhood(List<String> neighborhood) Sets the list of nearby neighbourhood names.voidsetOfficerID(List<String> officerID) Sets the list of user IDs of officers assigned to this project.voidsetOpenDate(LocalDate openDate) Sets the application open date.voidSets the map of prices per flat type.voidsetProjectID(String projectID) Sets the unique project ID.voidsetVisibility(boolean visibility) Sets the visibility status of the project.
-
Constructor Details
-
Project
public Project()Default constructor. Initializes a new Project instance with default values: empty strings, empty lists/maps, current date for open/close dates, zero available officers, and false visibility. -
Project
public Project(String projectID, String name, List<String> neighbourhood, Map<FlatType, Integer> availableUnit, Map<FlatType, Integer> price, LocalDate openDate, LocalDate closeDate, String managerID, int availableOfficer, boolean visibility) Parameterized constructor to create a Project with specified initial values. Note: The lists for officer IDs and applicant IDs are initialized as empty by this constructor; they are expected to be populated later.- Parameters:
projectID- The unique ID for the project.name- The name of the project.neighbourhood- The list of nearby neighbourhoods.availableUnit- The map of available units per flat type.price- The map of prices per flat type.openDate- The application open date.closeDate- The application close date.managerID- The ID of the managing user.availableOfficer- The initial number of available officer slots.visibility- The initial visibility status.
-
-
Method Details
-
getProjectID
-
setProjectID
Sets the unique project ID.- Parameters:
projectID- The project ID string.
-
getName
-
setName
Sets the name of the project.- Parameters:
name- The project name string.
-
getNeighborhood
-
setNeighborhood
-
getAvailableUnit
-
setAvailableUnit
-
setAvailableUnit
-
getPrice
-
setPrice
-
getOpenDate
-
setOpenDate
-
getCloseDate
-
setCloseDate
-
getManagerID
Gets the user ID of the manager responsible for this project.- Returns:
- The manager's user ID string.
-
setManagerID
Sets the user ID of the manager responsible for this project.- Parameters:
managerID- The manager's user ID string.
-
getAvailableOfficer
public int getAvailableOfficer()Gets the number of available officer slots for this project.- Returns:
- The count of available officer slots.
-
setAvailableOfficer
public void setAvailableOfficer(int availableOfficer) Sets the number of available officer slots for this project.- Parameters:
availableOfficer- The count of available officer slots.
-
getOfficerID
-
setOfficerID
-
getApplicantID
-
setApplicantID
-
addApplicantID
Adds a single applicant ID to the list of applicants who have booked a flat. Typically called when an officer successfully books a flat for an applicant.- Parameters:
applicantID- The user ID of the applicant to add.
-
getVisibility
public boolean getVisibility()Gets the visibility status of the project.- Returns:
- true if the project is visible, false otherwise.
-
setVisibility
public void setVisibility(boolean visibility) Sets the visibility status of the project.- Parameters:
visibility- true to make the project visible, false otherwise.
-
setAll
Copies all attribute values from anotherProjectobject into this object. This is a shallow copy for primitive types and references (lists/maps point to the same objects as the source). Consider implementing deep copy if independent copies of lists/maps are needed.- Parameters:
project- The sourceProjectobject from which to copy attributes.
-