Class AddFeedback
java.lang.Object
bcu.cmp5332.bookingsystem.commands.AddFeedback
- All Implemented Interfaces:
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
ConstructorDescriptionAddFeedback
(int bookingID, int customerID, String message) Constructs an AddFeedback command with the specified booking ID, customer ID, and feedback message. -
Method Summary
Modifier and TypeMethodDescriptionvoid
execute
(FlightBookingSystem flightBookingSystem) Executes the AddFeedback command within the provided FlightBookingSystem instance.
-
Constructor Details
-
AddFeedback
Constructs an AddFeedback command with the specified booking ID, customer ID, and feedback message.- Parameters:
bookingID
- The ID of the bookingcustomerID
- The ID of the customer providing feedbackmessage
- 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 interfaceCommand
- 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 systemIOException
- If there is an error storing data using FlightBookingSystemData
-