Enum ApplicationStatus

java.lang.Object
java.lang.Enum<ApplicationStatus>
com.ntu.fdae.group1.bto.enums.ApplicationStatus
All Implemented Interfaces:
Serializable, Comparable<ApplicationStatus>, java.lang.constant.Constable

public enum ApplicationStatus extends Enum<ApplicationStatus>
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)
Invalid status transitions:
  • PENDING → BOOKED (must go through SUCCESSFUL first)
  • SUCCESSFUL → PENDING (cannot revert to previous status)
  • Enum Constant Details

    • PENDING

      public static final ApplicationStatus PENDING
      Represents an application that has been submitted but not yet processed. This is the initial state of all applications.
    • SUCCESSFUL

      public static final ApplicationStatus 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

      public static final ApplicationStatus 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

      public static final ApplicationStatus 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

      public static ApplicationStatus[] 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

      public static ApplicationStatus valueOf(String name)
      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 name
      NullPointerException - if the argument is null