Package moblima.control.handlers
Class CustomerHandler
java.lang.Object
moblima.control.handlers.CustomerHandler
The type Customer handler.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
addCustomer
(String name, String contactNumber, String emailAddress) Add customer int.int
checkIfAccountExists
(String contactNumber, String emailAddress) Check if account exists int.Gets current customer.getCustomer
(int customerIdx) Gets customer.int
getCustomerIdx
(String customerId) Gets customer idx.Gets customers.void
List customers.boolean
removeCustomer
(int customerIdx) Remove customer boolean.boolean
removeCustomer
(String customerId) Remove customer boolean.protected boolean
Save customers boolean.void
setCurrentCustomer
(int customerIdx) Sets current customer.boolean
validatePhoneNumber
(String phoneNumber) Validate phone number boolean.
-
Field Details
-
customers
The Customers. -
currentCustomer
The Current customer.
-
-
Constructor Details
-
CustomerHandler
public CustomerHandler()Instantiates a new Customer handler.
-
-
Method Details
-
validatePhoneNumber
Validate phone number boolean.- Parameters:
phoneNumber
- the phone number- Returns:
- the boolean
-
getCurrentCustomer
Gets current customer.- Returns:
- the current customer
-
setCurrentCustomer
public void setCurrentCustomer(int customerIdx) Sets current customer.- Parameters:
customerIdx
- the customer idx
-
getCustomers
Gets customers.- Returns:
- the customers
-
getCustomer
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
Remove customer boolean.- Parameters:
customerId
- the customer id- Returns:
- the boolean
-
getCustomerIdx
Gets customer idx.- Parameters:
customerId
- the customer id- Returns:
- the customer idx
-
addCustomer
Add customer int.- Parameters:
name
- the namecontactNumber
- the contact numberemailAddress
- the email address- Returns:
- the int
-
listCustomers
public void listCustomers()List customers. -
checkIfAccountExists
Check if account exists int.- Parameters:
contactNumber
- the contact numberemailAddress
- the email address- Returns:
- the int
-
saveCustomers
protected boolean saveCustomers()Save customers boolean.- Returns:
- the boolean
-