-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathLineItem.java
More file actions
319 lines (240 loc) · 6.71 KB
/
LineItem.java
File metadata and controls
319 lines (240 loc) · 6.71 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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
package com.riskified.models;
import java.util.*;
import java.util.jar.Attributes;
import com.riskified.validations.*;
public class LineItem implements IValidated {
private Double price;
private Integer quantity;
private String title;
private String sku;
private String productId;
private String fulfillmentService;
private String fulfillmentStatus;
private Float grams;
private String variantId;
private String variantTitle;
private String variantInventoryManagement;
private String vendor;
private String name;
private Boolean requiresShipping;
private Boolean taxable;
private Boolean productExists;
private List<Attributes> properties;
private List<TaxLine> taxLines;
private String category;
private String subCategory;
private String condition;
private Seller seller;
private String brand;
private String productType;
private String size;
private Date deliveredAt;
private String deliveredTo;
private String color;
private RegistryType registryType;
private Policy policy;
public LineItem() {
}
public LineItem(double price, int quantity, String title) {
this.properties = new ArrayList<Attributes>();
this.taxLines = new ArrayList<TaxLine>();
this.price = price;
this.quantity = quantity;
this.title = title;
}
public LineItem(double price, int quantity, String title, String productId) {
this.properties = new ArrayList<Attributes>();
this.taxLines = new ArrayList<TaxLine>();
this.price = price;
this.quantity = quantity;
this.title = title;
this.productId = productId;
}
public void validate(Validation validationType)
throws FieldBadFormatException {
if (validationType == Validation.ALL) {
Validate.notNull(this, this.price, "Price");
Validate.notNull(this, this.quantity, "Quantity");
Validate.notNullOrEmpty(this, this.title, "Title");
}
if (seller != null) {
seller.validate(validationType);
}
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
public Integer getQuantity() {
return quantity;
}
public void setQuantity(Integer quantity) {
this.quantity = quantity;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getSku() {
return sku;
}
public void setSku(String sku) {
this.sku = sku;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
public String getCondition() {
return condition;
}
public void setCondition(String condition) {
this.condition = condition;
}
public String getProductId() {
return productId;
}
public void setProductId(String productId) {
this.productId = productId;
}
public String getFulfillmentService() {
return fulfillmentService;
}
public void setFulfillmentService(String fulfillmentService) {
this.fulfillmentService = fulfillmentService;
}
public String getFulfillmentStatus() {
return fulfillmentStatus;
}
public void setFulfillmentStatus(String fulfillmentStatus) {
this.fulfillmentStatus = fulfillmentStatus;
}
public Float getGrams() {
return grams;
}
public void setGrams(Float grams) {
this.grams = grams;
}
public String getVariantId() {
return variantId;
}
public void setVariantId(String variantId) {
this.variantId = variantId;
}
public String getVariantTitle() {
return variantTitle;
}
public void setVariantTitle(String variantTitle) {
this.variantTitle = variantTitle;
}
public String getVariantInventoryManagement() {
return variantInventoryManagement;
}
public void setVariantInventoryManagement(String variantInventoryManagement) {
this.variantInventoryManagement = variantInventoryManagement;
}
public String getVendor() {
return vendor;
}
public void setVendor(String vendor) {
this.vendor = vendor;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Boolean getRequiresShipping() {
return requiresShipping;
}
public void setRequiresShipping(Boolean requiresShipping) {
this.requiresShipping = requiresShipping;
}
public Boolean getTaxable() {
return taxable;
}
public void setTaxable(Boolean taxable) {
this.taxable = taxable;
}
public Boolean getProductExists() {
return productExists;
}
public void setProductExists(Boolean productExists) {
this.productExists = productExists;
}
public Seller getSeller() {
return seller;
}
public void setSeller(Seller seller) {
this.seller = seller;
}
public List<Attributes> getProperties() {
return properties;
}
public void setProperties(List<Attributes> properties) {
this.properties = properties;
}
public List<TaxLine> getTaxLines() {
return taxLines;
}
public void setTaxLines(List<TaxLine> taxLines) {
this.taxLines = taxLines;
}
public String getBrand() {
return brand;
}
public void setBrand(String brand) {
this.brand = brand;
}
public String getProductType() {
return productType;
}
public void setProductType(String productType) {
this.productType = productType;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getSubCategory() {
return subCategory;
}
public void setSubCategory(String subCategory) {
this.subCategory = subCategory;
}
public String getSize() {
return size;
}
public void setSize(String size) {
this.size = size;
}
public Date getDeliveredAt() {
return deliveredAt;
}
public void setDeliveredAt(Date deliveredAt) {
this.deliveredAt = deliveredAt;
}
public String getDeliveredTo() {
return deliveredTo;
}
public void setDeliveredTo(String deliveredTo) {
this.deliveredTo = deliveredTo;
}
public RegistryType getRegistryType() { return registryType; }
public void setRegistryType(RegistryType registryType) { this.registryType = registryType; }
public Policy getPolicy() {
return policy;
}
public void setPolicy(Policy policy) {
this.policy = policy;
}
}