-
Notifications
You must be signed in to change notification settings - Fork 0
/
Customer.java
53 lines (47 loc) · 1.88 KB
/
Customer.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
public class Customer {
private final String customerName;
private final String customerEmail;
private final String customerPhone;
private final String customerLocation;
private final String customerAddress;
// Used in createCustomer() method in main and to create customers from customers.txt
public Customer(String customerName, String customerEmail, String customerPhone, String customerLocation, String customerAddress) {
this.customerName = customerName;
this.customerEmail = customerEmail;
this.customerPhone = customerPhone;
this.customerLocation = customerLocation;
this.customerAddress = customerAddress;
}
// Default customer constructor used in Invoice class's empty constructor.
public Customer() {
this.customerName = "customerName";
this.customerEmail = "[email protected]";
this.customerPhone = "customerPhone";
this.customerLocation = "customerLocation";
this.customerAddress = "customerAddress";
}
// Getters used in Invoice class toString() overridden method and in createInvoice() method in main.
public String getCustomerName() {
return customerName;
}
public String getCustomerEmail() {
return customerEmail;
}
public String getCustomerPhone() {
return customerPhone;
}
public String getCustomerLocation() {
return customerLocation;
}
public String getCustomerAddress() {
return customerAddress;
}
// Used to show new customer details in customer creation
public void printCustomerSummary() {
System.out.println("Customer: " + customerName + '\n' +
"Email: " + customerEmail + '\n' +
"Phone Number: " + customerPhone + '\n' +
"Location: " + customerLocation + '\n' +
"Address: " + customerAddress);
}
}