Package com.ntu.fdae.group1.bto.enums
Enum ApplicationStatus
- All Implemented Interfaces:
Serializable
,Comparable<ApplicationStatus>
,java.lang.constant.Constable
Defines the possible statuses for BTO housing applications in the system.
This enum tracks the lifecycle of a housing application from submission through completion. Applications follow a specific workflow with valid status transitions:
Valid status transitions:- PENDING → SUCCESSFUL → BOOKED
- PENDING → UNSUCCESSFUL
- SUCCESSFUL → UNSUCCESSFUL (withdrawal before booking)
- BOOKED → UNSUCCESSFUL (withdrawal after booking)
- PENDING → BOOKED (must go through SUCCESSFUL first)
- SUCCESSFUL → PENDING (cannot revert to previous status)
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionRepresents an application where the applicant has successfully selected and booked a flat.Represents an application that has been submitted but not yet processed.Represents an application that has been processed and selected for a flat.Represents an application that was rejected, withdrawn, or otherwise did not result in a flat booking. -
Method Summary
Modifier and TypeMethodDescriptionstatic ApplicationStatus
Returns the enum constant of this type with the specified name.static ApplicationStatus[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
PENDING
Represents an application that has been submitted but not yet processed. This is the initial state of all applications. -
SUCCESSFUL
Represents an application that has been processed and selected for a flat. Applications in this state have passed the ballot but haven't yet booked a flat. -
UNSUCCESSFUL
Represents an application that was rejected, withdrawn, or otherwise did not result in a flat booking. Applications can enter this state from PENDING (direct rejection) or from SUCCESSFUL/BOOKED (withdrawal by applicant). -
BOOKED
Represents an application where the applicant has successfully selected and booked a flat. This is the final successful state in the application process.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-