Class Display

java.lang.Object
utils.Display

public class Display extends Object
Utility class containing static methods for displaying formatted information about various entity objects (Applicants, Officers, Managers, Projects, Requests) to the standard console output. Provides different views based on context (e.g., user type).
  • Constructor Details

    • Display

      public Display()
  • Method Details

    • displayApplicant

      public static void displayApplicant(Applicant user, boolean profile)
      Displays formatted information about an Applicant. If profile is true, it includes details about the applied project and application status history. Always shows basic details like name, ID, age, marital status, and applied flat type if applicable.
      Parameters:
      user - The Applicant object to display.
      profile - If true, display extended profile information including application history; if false, display basic information.
    • displayOfficer

      public static void displayOfficer(Officer user)
      Displays formatted information about an Officer. Includes basic details, list of registered project IDs, and registration status history.
      Parameters:
      user - The Officer object to display.
    • displayManager

      public static void displayManager(Manager user)
      Displays formatted information about a Manager. Includes basic details and a list of project IDs they created/manage.
      Parameters:
      user - The Manager object to display.
    • displayProject

      public static void displayProject(Project project, UserType user, FlatType flatType)
      Displays formatted information about a Project. The level of detail depends on the user type viewing the project. The flatType parameter can filter the display of units and prices (e.g., if viewing as an applicant only eligible for TWO_ROOM, THREE_ROOM details might be hidden).
      Parameters:
      project - The Project object to display.
      user - The UserType of the user viewing the project (determines detail level).
      flatType - A FlatType used for filtering display (e.g., hide details irrelevant to user eligibility). If null, typically all flat type details are shown.
    • displayRequest

      public static void displayRequest(Request request, UserType userType)
      Displays formatted information about a Request. Adjusts displayed details based on the userType viewing the request (e.g., hides User ID for Applicants). Displays specific status or query/answer details based on the actual subclass of the Request (OfficerRegistration, BTOApplication, BTOWithdrawal, Enquiry).
      Parameters:
      request - The Request object (or a subclass instance) to display.
      userType - The UserType of the user viewing the request.