-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathClient.java
78 lines (67 loc) · 1.6 KB
/
Client.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import java.io.Serializable;
/**
* This class creates a Client and assigns a unique ID to the Client upon creation
* @author Matt Carlson, Jamison Czech, Slava Makharovich, Prashant Shrestha
*/
public class Client implements Serializable{
// Unique identifier assigned to a new client
private static long ID = 1L;
private String name;
private String address;
private String phoneNumber;
private String clientID;
private double balance;
/**
* Creates a new Client assigning a unique ID and default balance
* @param name
* @param address
* @param phoneNumber
*/
public Client(String name, String address, String phoneNumber) {
this.name = name;
this.address = address;
this.phoneNumber = phoneNumber;
this.balance = 0;
this.clientID = Long.toString(ID);
ID++;
}
/**
* Gets client's name
* @return a string of the client's name
*/
public String getName() {
return name;
}
/**
* Gets client's address
* @return a string of the client's address
*/
public String getAddress() {
return address;
}
/**
* Gets client's phone number
* @return a string of the client's phone number
*/
public String getPhoneNumber() {
return phoneNumber;
}
/**
* Get the client's ID number
* @return a long of the client's ID number
*/
public String getClientID() {
return clientID;
}
/**
* String representing a client
* @return a string representing a client
*/
@Override
public String toString() {
return "Client ID #: " + clientID + ", Name: " + name + ", Address: "
+ address + ", Phone number: " + phoneNumber + ", Balance: $" +
""
+ balance;
}
}