Class AddFeedback

java.lang.Object
bcu.cmp5332.bookingsystem.commands.AddFeedback
All Implemented Interfaces:
Command

public class AddFeedback extends Object implements Command
The AddFeedback class represents a command to add feedback to a booking in the flight booking system. It implements the Command interface and requires execution within a FlightBookingSystem instance.

The feedback is identified by the booking ID, customer ID, and feedback message. Upon execution, the feedback is added to the system and stored using FlightBookingSystemData.

  • Field Summary

    Fields inherited from interface bcu.cmp5332.bookingsystem.commands.Command

    HELP_MESSAGE
  • Constructor Summary

    Constructors
    Constructor
    Description
    AddFeedback(int bookingID, int customerID, String message)
    Constructs an AddFeedback command with the specified booking ID, customer ID, and feedback message.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    execute(FlightBookingSystem flightBookingSystem)
    Executes the AddFeedback command within the provided FlightBookingSystem instance.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AddFeedback

      public AddFeedback(int bookingID, int customerID, String message)
      Constructs an AddFeedback command with the specified booking ID, customer ID, and feedback message.
      Parameters:
      bookingID - The ID of the booking
      customerID - The ID of the customer providing feedback
      message - The feedback message
  • Method Details

    • execute

      public void execute(FlightBookingSystem flightBookingSystem) throws FlightBookingSystemException, IOException
      Executes the AddFeedback command within the provided FlightBookingSystem instance. Adds the feedback to the system using the specified booking ID, customer ID, and feedback message. The updated system data is then stored using FlightBookingSystemData.
      Specified by:
      execute in interface Command
      Parameters:
      flightBookingSystem - The FlightBookingSystem instance on which the feedback is to be added
      Throws:
      FlightBookingSystemException - If there is an issue adding the feedback to the system
      IOException - If there is an error storing data using FlightBookingSystemData