Class CustomerHandler

java.lang.Object
moblima.control.handlers.CustomerHandler

public class CustomerHandler extends Object
The type Customer handler.
  • Field Details

    • customers

      protected final List<Customer> customers
      The Customers.
    • currentCustomer

      protected Customer currentCustomer
      The Current customer.
  • Constructor Details

    • CustomerHandler

      public CustomerHandler()
      Instantiates a new Customer handler.
  • Method Details

    • validatePhoneNumber

      public boolean validatePhoneNumber(String phoneNumber)
      Validate phone number boolean.
      Parameters:
      phoneNumber - the phone number
      Returns:
      the boolean
    • getCurrentCustomer

      public Customer getCurrentCustomer()
      Gets current customer.
      Returns:
      the current customer
    • setCurrentCustomer

      public void setCurrentCustomer(int customerIdx)
      Sets current customer.
      Parameters:
      customerIdx - the customer idx
    • getCustomers

      public List<Customer> getCustomers()
      Gets customers.
      Returns:
      the customers
    • getCustomer

      public Customer getCustomer(int customerIdx)
      Gets customer.
      Parameters:
      customerIdx - the customer idx
      Returns:
      the customer
    • removeCustomer

      public boolean removeCustomer(int customerIdx)
      Remove customer boolean.
      Parameters:
      customerIdx - the customer idx
      Returns:
      the boolean
    • removeCustomer

      public boolean removeCustomer(String customerId)
      Remove customer boolean.
      Parameters:
      customerId - the customer id
      Returns:
      the boolean
    • getCustomerIdx

      public int getCustomerIdx(String customerId)
      Gets customer idx.
      Parameters:
      customerId - the customer id
      Returns:
      the customer idx
    • addCustomer

      public int addCustomer(String name, String contactNumber, String emailAddress)
      Add customer int.
      Parameters:
      name - the name
      contactNumber - the contact number
      emailAddress - the email address
      Returns:
      the int
    • listCustomers

      public void listCustomers()
      List customers.
    • checkIfAccountExists

      public int checkIfAccountExists(String contactNumber, String emailAddress)
      Check if account exists int.
      Parameters:
      contactNumber - the contact number
      emailAddress - the email address
      Returns:
      the int
    • saveCustomers

      protected boolean saveCustomers()
      Save customers boolean.
      Returns:
      the boolean