-
Notifications
You must be signed in to change notification settings - Fork 1
/
Address.java
70 lines (61 loc) · 2.05 KB
/
Address.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
package Two;
import java.util.Objects;
public class Address {
private String webPageAddress;
private String emailAddress;
private String telecomAddress;
private CivicAddress civicAddress;
public Address(String webPageAddress, String emailAddress, String telecomAddress, CivicAddress civicAddress) {
this.webPageAddress = webPageAddress;
this.emailAddress = emailAddress;
this.telecomAddress = telecomAddress;
this.civicAddress = civicAddress;
}
public Address(){
}
public Address(Address a){
webPageAddress = a.webPageAddress;
emailAddress = a.emailAddress;
telecomAddress = a.telecomAddress;
}
public void setWebPageAddress(String s) {
webPageAddress = s;
}
public void setEmailAddress(String s) {
emailAddress = s;
}
public void setTelecomAddress(String s) {
telecomAddress = s;
}
public void setCivicAddress(CivicAddress s) {
civicAddress = s;
}
public String getWebPageAddress() {
return webPageAddress;
}
public String getEmailAddress() {
return emailAddress;
}
public String getTelecomAddress() {
return telecomAddress;
}
public CivicAddress getCivicAddress() {
return civicAddress;
}
@Override
public String toString() {
return "Address{" +
"webPageAddress='" + webPageAddress + '\'' +
", emailAddress='" + emailAddress + '\'' +
", telecomAddress='" + telecomAddress + '\'' +
", civicAddress=" + civicAddress +
'}';
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Address address = (Address) o;
return Objects.equals(webPageAddress, address.webPageAddress) && Objects.equals(emailAddress, address.emailAddress) && Objects.equals(telecomAddress, address.telecomAddress) && Objects.equals(civicAddress, address.civicAddress);
}
}