-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathAddress.java
More file actions
180 lines (142 loc) · 3.98 KB
/
Address.java
File metadata and controls
180 lines (142 loc) · 3.98 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
package com.riskified.models;
import com.riskified.validations.*;
public class Address implements IValidated {
private String firstName;
private String lastName;
private String city;
private String phone;
private Boolean verifiedPhone;
private String country;
private String countryCode;
private String name;
private String company;
private String address1;
private String address2;
private String province;
private String provinceCode;
private String zip;
private Float latitude;
private Float longitude;
public Address(String firstName, String lastName, String address1, String city, String phone, String country) {
this.firstName = firstName;
this.lastName = lastName;
this.city = city;
this.phone = phone;
this.country = country;
this.address1 = address1;
}
public Address() {
}
public void validate(Validation validationType) throws FieldBadFormatException {
if (validationType == Validation.ALL) {
Validate.notNullOrEmpty(this, this.firstName, "First Name");
Validate.notNullOrEmpty(this, this.lastName, "Last Name");
Validate.notNullOrEmpty(this, this.address1, "Address1");
Validate.notNullOrEmpty(this, this.country, "Country");
Validate.notNullOrEmpty(this, this.city, "City");
Validate.notNullOrEmpty(this, this.phone, "Phone");
}
if (this.countryCode != null) {
Validate.countryCode(this, this.countryCode, "Country Code");
}
if (this.provinceCode != null) {
Validate.provinceCode(this, this.provinceCode, "Province Code");
}
}
public String getFirstName() {
return firstName;
}
public String getLastName() {
return lastName;
}
public String getCity() {
return city;
}
public String getPhone() {
return phone;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public void setCity(String city) {
this.city = city;
}
public void setCountry(String country) {
this.country = country;
}
public String getCountry() {
return country;
}
public String getCountryCode() {
return countryCode;
}
public void setCountryCode(String countryCode) {
this.countryCode = countryCode;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCompany() {
return company;
}
public void setCompany(String company) {
this.company = company;
}
public void setAddress1(String address1) {
this.address1 = address1;
}
public String getAddress1() {
return address1;
}
public String getAddress2() {
return address2;
}
public void setAddress2(String address2) {
this.address2 = address2;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getProvinceCode() {
return provinceCode;
}
public void setProvinceCode(String provinceCode) {
this.provinceCode = provinceCode;
}
public String getZip() {
return zip;
}
public void setZip(String zip) {
this.zip = zip;
}
public Float getLatitude() {
return latitude;
}
public void setLatitude(Float latitude) {
this.latitude = latitude;
}
public Float getLongitude() {
return longitude;
}
public void setLongitude(Float longitude) {
this.longitude = longitude;
}
public Boolean getVerifiedPhone() {
return verifiedPhone;
}
public void setVerifiedPhone(Boolean verifiedPhone) {
this.verifiedPhone = verifiedPhone;
}
public void setPhone(String phone) {
this.phone = phone;
}
}