Class Enquiry

All Implemented Interfaces:
CSVEncodable

public class Enquiry extends CSVDecodable implements CSVEncodable
Each enquiry acts as a question and answer session, between applicants and officers or managers of a project.
Author:
Vincent Neo
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private UUID
    A unique identifier to identify each enquiry.
    private BTOProject
    The BTO Project which the enquiry is intended to be about.
    private String
    Placeholder object as intermediary for CSV parsing This is because the CSV cells only represents projects as their names.
    private Message
    A question intended for an authorised HDB manager or officer to respond to.
    private Message
    A response from an authorised HDB manager or officer to answer the question.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Construct an enquiry by the CSVParser.
    Enquiry(Message question, BTOProject project)
    Construct a new enquiry from an Applicant role.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Display this enquiry on the console, formatted.
    Override this to provide a line/row of CSV content.
    boolean
     
    Retrieve the unique identifier of this object.
    Retrieve the project associated to this enquiry.
    Retrieve the question message that has been added in by the applicant that has submitted this enquiry.
    Retrieve the response object provided by an authorised officer or manager, if any.
    boolean
    Check if this enquiry has been responded by an authorised personnel or not.
    boolean
    Checks if the provided user is involved in this enquiry, as an enquirer.
    void
    Only call if projectName is provided by CSV parsing and not null.
    void
    Link connected users to this object.
    void
    setResponse(Message response)
    Use this to provide a response to the enquiry question.
    Override this to provide which file type the encodable class should be represented as.

    Methods inherited from class Object

    clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • id

      private UUID id
      A unique identifier to identify each enquiry.
    • question

      private Message question
      A question intended for an authorised HDB manager or officer to respond to.
    • response

      private Message response
      A response from an authorised HDB manager or officer to answer the question. It is expected for this to be null if unanswered.
    • projectName

      private String projectName
      Placeholder object as intermediary for CSV parsing This is because the CSV cells only represents projects as their names. We need to further process to link actual BTOProject object to this class. Set to null when not in use.
    • project

      private BTOProject project
      The BTO Project which the enquiry is intended to be about. Each enquiry question is supposed to be related to a BTO project. This enables the enquiry to be handled by a suitable personnel, such as the officer in charge of the project.
  • Constructor Details

    • Enquiry

      public Enquiry(List<CSVCell> cells)
      Construct an enquiry by the CSVParser.
    • Enquiry

      public Enquiry(Message question, BTOProject project)
      Construct a new enquiry from an Applicant role.
      Parameters:
      question - The question for an officer or manager to reply to.
      project - The related project, for context of the question.
  • Method Details

    • linkProject

      public void linkProject(ArrayList<BTOProject> projects)
      Only call if projectName is provided by CSV parsing and not null.
      Parameters:
      projects - All projects of system, used for matching and linking.
    • linkUsers

      public void linkUsers(List<User> users)
      Link connected users to this object.
      Parameters:
      users - All users supported in the system. This method will pick whichever user necessary.
    • isUserInvolved

      public boolean isUserInvolved(User user)
      Checks if the provided user is involved in this enquiry, as an enquirer.
      Parameters:
      user - The user to be checked.
      Returns:
      true, if user provided is found to be involved in this enquiry.
    • getId

      public UUID getId()
      Retrieve the unique identifier of this object.
      Returns:
      a UUID that uniquely represents this object.
    • getResponse

      public Message getResponse()
      Retrieve the response object provided by an authorised officer or manager, if any.
      Returns:
      A message representing a response from an authorised personnel.
    • setResponse

      public void setResponse(Message response)
      Use this to provide a response to the enquiry question.
      Parameters:
      response - The response to be provided.
    • getProject

      public BTOProject getProject()
      Retrieve the project associated to this enquiry.
      Returns:
      project information.
    • getQuestion

      public Message getQuestion()
      Retrieve the question message that has been added in by the applicant that has submitted this enquiry.
      Returns:
      the question message.
    • hasResponded

      public boolean hasResponded()
      Check if this enquiry has been responded by an authorised personnel or not.
      Returns:
      false, if no responses.
    • encode

      public String encode()
      Description copied from interface: CSVEncodable
      Override this to provide a line/row of CSV content. This will be called one by one in the CSVEncoder, to be written in file.
      Specified by:
      encode in interface CSVEncodable
      Returns:
      A CSV row, in String text.
    • sourceFileType

      public CSVFileTypes sourceFileType()
      Description copied from interface: CSVEncodable
      Override 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:
      sourceFileType in interface CSVEncodable
      Returns:
      a CSVFileType, such as CSVFileType.MANAGER_LIST.
    • display

      public void display()
      Display this enquiry on the console, formatted.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object