-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContact.java
83 lines (69 loc) · 2.16 KB
/
Contact.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
79
80
81
82
83
/**
* A class for a human contact
*/
public class Contact
{
private String firstName;
private String lastName;
private String phoneNumber;
private String emailAddress;
private String relationToPerson;
/**
* To instantiate a contact with the following attributes
* @param firstName A string for the contact's first name
* @param lastName A string for the contact's last name
* @param phoneNumber A string fot the contact's phone number
* @param emailAddress A string for their email address
* @param relationToPerson A strig for the contact's relation to the subject
*/
public Contact(String firstName, String lastName, String phoneNumber, String emailAddress, String relationToPerson)
{
this.firstName = firstName;
this.lastName = lastName;
this.phoneNumber = phoneNumber;
this.emailAddress = emailAddress;
this.relationToPerson = relationToPerson;
}
public Contact()
{
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getPhoneNumber() {
return phoneNumber;
}
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
public String getEmailAddress() {
return emailAddress;
}
public void setEmailAddress(String emailAddress) {
this.emailAddress = emailAddress;
}
public String getRelationToPerson() {
return relationToPerson;
}
public void setRelationToPerson(String relationToPerson) {
this.relationToPerson = relationToPerson;
}
/**
* A pretty description of the Contact in string form
* @return A string for the description of the contact
*/
public String toString()
{
return "Name: " + firstName + " " + lastName + "\nPhone Number: " + phoneNumber
+ "\nEmail: " + emailAddress + "\nRelation: " + relationToPerson;
}
}