Package sc2002.FCS1.grp2
Class Application
Object
CSVDecodable
Application
- All Implemented Interfaces:
CSVEncodable
This class represents a BTO application.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ApplicantThe applicantprivate StringTemporary value for CSV parse and linkprivate FlatTypeThe flat type that is applied.private LocalDateTimeThe last updated date and timeprivate BTOProjectThe project which this application is applied to.private StringTemporary value for CSV parse and linkprivate ApplicationStatusThe status of this application.private WithdrawalStatusWhether if this application shall be invalidated due to withdrawal. -
Constructor Summary
ConstructorsConstructorDescriptionApplication(List<CSVCell> cells) ForCSVParserto parse a CSV row representing this class.Application(BTOProject project, FlatType flatType, Applicant applicant) Construct a BTO application. -
Method Summary
Modifier and TypeMethodDescriptionencode()Override this to provide a line/row of CSV content.Get the applicant of this applicationGet flat typeThe last update date and time.The project that's being applied for.The receipt for a successfully booked application.Get the application's status.Get the withdrawal status.(package private) voidlinkApplicant(List<Applicant> applicants) Call this to link relevant applicant objects to this object, post CSV parse.(package private) voidlinkProject(List<BTOProject> projects) Call this to link relevant project to this object, post CSV parse.voidsetStatus(ApplicationStatus status) Update status and update last updated time.voidsetWithdrawalStatus(WithdrawalStatus withdrawalStatus) Set the withdrawal status.Override this to provide which file type the encodable class should be represented as.toString()voidwithdraw()Withdraw this application.
-
Field Details
-
project
The project which this application is applied to. -
flatType
The flat type that is applied. -
status
The status of this application. -
withdrawalStatus
Whether if this application shall be invalidated due to withdrawal. -
applicant
The applicant -
lastUpdated
The last updated date and time -
projectName
Temporary value for CSV parse and link -
applicantNRIC
Temporary value for CSV parse and link
-
-
Constructor Details
-
Application
Construct a BTO application.- Parameters:
project- The project which this application is applying to.flatType- The flat type/size applied for.applicant- The applicant
-
Application
ForCSVParserto parse a CSV row representing this class.- Parameters:
cells- cells of a CSV row, of application type.
-
-
Method Details
-
linkApplicant
Call this to link relevant applicant objects to this object, post CSV parse.- Parameters:
applicants- Pool of all applicants
-
linkProject
Call this to link relevant project to this object, post CSV parse.- Parameters:
projects- Pool of all projects
-
withdraw
Withdraw this application. Should only be called by applicant.- Throws:
Exception- access control.
-
setStatus
Update status and update last updated time.- Parameters:
status- application status
-
getStatus
Get the application's status.- Returns:
- the status.
-
getWithdrawalStatus
Get the withdrawal status.- Returns:
- the status.
-
setWithdrawalStatus
Set the withdrawal status.- Parameters:
withdrawalStatus- the new status.
-
getFlatType
Get flat type- Returns:
- the flat type
-
getApplicant
Get the applicant of this application- Returns:
- the applicant
-
getProject
The project that's being applied for.- Returns:
- the project.
-
getLastUpdatedDate
The last update date and time.- Returns:
- date and time object.
-
getReceipt
The receipt for a successfully booked application.- Returns:
- The receipt.
- Throws:
Exception- Non-booked applications does not have receipts.
-
toString
-
encode
Description copied from interface:CSVEncodableOverride this to provide a line/row of CSV content. This will be called one by one in theCSVEncoder, to be written in file.- Specified by:
encodein interfaceCSVEncodable- Returns:
- A CSV row, in
Stringtext.
-
sourceFileType
Description copied from interface:CSVEncodableOverride this to provide which file type the encodable class should be represented as. This ensures that the right data is written in the right file, depending on the class type.- Specified by:
sourceFileTypein interfaceCSVEncodable- Returns:
- a CSVFileType, such as
CSVFileType.MANAGER_LIST.
-