-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCustomer.java
More file actions
64 lines (58 loc) · 1.48 KB
/
Customer.java
File metadata and controls
64 lines (58 loc) · 1.48 KB
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
54
55
56
57
58
59
60
61
62
63
64
/**
*
* @author Tory Brewer and Ryan Franklin
*/
public class Customer extends User {
private String phoneNumber;
private String address;
/**
* Constructor initializes a customer object with the provided values.
* @param id
* @param phoneNumber
* @param address
* @param firstName
* @param lastName
*/
public Customer(int id, String firstName, String lastName, String phoneNumber, String address) {
super(id, firstName, lastName, false);
this.phoneNumber = phoneNumber;
this.address = address;
}
/**
* Get the phone number.
* @return phoneNumber
*/
public String getPhoneNumber() {
return phoneNumber;
}
/**
* Set the phone number.
* @param phoneNumber
*/
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
/**
* Get the address.
* @return address
*/
public String getAddress() {
return address;
}
/**
* Set the address.
* @param address
*/
public void setAddress(String address) {
this.address = address;
}
/**
* Returns the attributes of the customer, in a formatted text fashion.
* @return Formatted Text.
*/
@Override
public String getFormattedText() {
return String.format("| %-10s| %-9s| %-12s| %-12s| Ph#: %12s, Add: %20s |%n",
"Customer", id, firstName, lastName, phoneNumber, address);
}
}