Class AddCustomerAction

java.lang.Object
trial.gaurav.customer.AddCustomerAction
All Implemented Interfaces:
Action

public class AddCustomerAction extends Object implements Action
The `AddCustomerAction` class represents an action to add a new customer to the customer records. It implements the `Action` interface to define the behavior of the action when selected in the menu.
  • Field Details

  • Constructor Details

    • AddCustomerAction

      public AddCustomerAction(LinkedList<Customer> cRecords, CustomerConsoleManager cConsoleManager)
      Constructs a new `AddCustomerAction` object with the given customer records and customer console manager.
      Parameters:
      cRecords - The linked list containing the existing customer records.
      cConsoleManager - The customer console manager used to collect new customer details from the user.
  • Method Details

    • select

      public void select()
      Performs the action to add a new customer to the customer records. The method collects the customer details from the user, checks if the customer ID already exists, and inserts the new customer into the records.
      Specified by:
      select in interface Action