| 68 |
ashish |
1 |
/**
|
|
|
2 |
* Autogenerated by Thrift
|
|
|
3 |
*
|
|
|
4 |
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
|
|
5 |
*/
|
|
|
6 |
package in.shop2020.model.v1.order;
|
|
|
7 |
|
|
|
8 |
import java.util.List;
|
|
|
9 |
import java.util.ArrayList;
|
|
|
10 |
import java.util.Map;
|
|
|
11 |
import java.util.HashMap;
|
|
|
12 |
import java.util.EnumMap;
|
|
|
13 |
import java.util.Set;
|
|
|
14 |
import java.util.HashSet;
|
|
|
15 |
import java.util.EnumSet;
|
|
|
16 |
import java.util.Collections;
|
|
|
17 |
import java.util.BitSet;
|
|
|
18 |
import java.util.Arrays;
|
|
|
19 |
import org.slf4j.Logger;
|
|
|
20 |
import org.slf4j.LoggerFactory;
|
|
|
21 |
|
|
|
22 |
import org.apache.thrift.*;
|
|
|
23 |
import org.apache.thrift.meta_data.*;
|
|
|
24 |
import org.apache.thrift.protocol.*;
|
|
|
25 |
|
|
|
26 |
public class Transaction implements TBase<Transaction._Fields>, java.io.Serializable, Cloneable {
|
|
|
27 |
private static final TStruct STRUCT_DESC = new TStruct("Transaction");
|
|
|
28 |
|
|
|
29 |
private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)1);
|
| 483 |
rajveer |
30 |
private static final TField ORDERS_FIELD_DESC = new TField("orders", TType.LIST, (short)2);
|
|
|
31 |
private static final TField PAYMENT_INFO_FIELD_DESC = new TField("paymentInfo", TType.STRUCT, (short)3);
|
|
|
32 |
private static final TField CREATED_ON_FIELD_DESC = new TField("createdOn", TType.I64, (short)4);
|
|
|
33 |
private static final TField TRANSACTION_STATUS_FIELD_DESC = new TField("transactionStatus", TType.I32, (short)5);
|
|
|
34 |
private static final TField STATUS_DESCRIPTION_FIELD_DESC = new TField("statusDescription", TType.STRING, (short)6);
|
|
|
35 |
private static final TField SHOPPING_CARTID_FIELD_DESC = new TField("shoppingCartid", TType.I64, (short)7);
|
|
|
36 |
private static final TField CUSTOMER_ID_FIELD_DESC = new TField("customer_id", TType.I64, (short)8);
|
| 68 |
ashish |
37 |
|
|
|
38 |
private long id;
|
| 483 |
rajveer |
39 |
private List<Order> orders;
|
| 68 |
ashish |
40 |
private PaymentInfo paymentInfo;
|
|
|
41 |
private long createdOn;
|
|
|
42 |
private TransactionStatus transactionStatus;
|
|
|
43 |
private String statusDescription;
|
| 483 |
rajveer |
44 |
private long shoppingCartid;
|
| 68 |
ashish |
45 |
private long customer_id;
|
|
|
46 |
|
|
|
47 |
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
|
|
|
48 |
public enum _Fields implements TFieldIdEnum {
|
|
|
49 |
ID((short)1, "id"),
|
| 483 |
rajveer |
50 |
ORDERS((short)2, "orders"),
|
|
|
51 |
PAYMENT_INFO((short)3, "paymentInfo"),
|
|
|
52 |
CREATED_ON((short)4, "createdOn"),
|
| 68 |
ashish |
53 |
/**
|
|
|
54 |
*
|
|
|
55 |
* @see TransactionStatus
|
|
|
56 |
*/
|
| 483 |
rajveer |
57 |
TRANSACTION_STATUS((short)5, "transactionStatus"),
|
|
|
58 |
STATUS_DESCRIPTION((short)6, "statusDescription"),
|
|
|
59 |
SHOPPING_CARTID((short)7, "shoppingCartid"),
|
|
|
60 |
CUSTOMER_ID((short)8, "customer_id");
|
| 68 |
ashish |
61 |
|
|
|
62 |
private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
|
|
|
63 |
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
|
|
|
64 |
|
|
|
65 |
static {
|
|
|
66 |
for (_Fields field : EnumSet.allOf(_Fields.class)) {
|
|
|
67 |
byId.put((int)field._thriftId, field);
|
|
|
68 |
byName.put(field.getFieldName(), field);
|
|
|
69 |
}
|
|
|
70 |
}
|
|
|
71 |
|
|
|
72 |
/**
|
|
|
73 |
* Find the _Fields constant that matches fieldId, or null if its not found.
|
|
|
74 |
*/
|
|
|
75 |
public static _Fields findByThriftId(int fieldId) {
|
|
|
76 |
return byId.get(fieldId);
|
|
|
77 |
}
|
|
|
78 |
|
|
|
79 |
/**
|
|
|
80 |
* Find the _Fields constant that matches fieldId, throwing an exception
|
|
|
81 |
* if it is not found.
|
|
|
82 |
*/
|
|
|
83 |
public static _Fields findByThriftIdOrThrow(int fieldId) {
|
|
|
84 |
_Fields fields = findByThriftId(fieldId);
|
|
|
85 |
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
|
|
|
86 |
return fields;
|
|
|
87 |
}
|
|
|
88 |
|
|
|
89 |
/**
|
|
|
90 |
* Find the _Fields constant that matches name, or null if its not found.
|
|
|
91 |
*/
|
|
|
92 |
public static _Fields findByName(String name) {
|
|
|
93 |
return byName.get(name);
|
|
|
94 |
}
|
|
|
95 |
|
|
|
96 |
private final short _thriftId;
|
|
|
97 |
private final String _fieldName;
|
|
|
98 |
|
|
|
99 |
_Fields(short thriftId, String fieldName) {
|
|
|
100 |
_thriftId = thriftId;
|
|
|
101 |
_fieldName = fieldName;
|
|
|
102 |
}
|
|
|
103 |
|
|
|
104 |
public short getThriftFieldId() {
|
|
|
105 |
return _thriftId;
|
|
|
106 |
}
|
|
|
107 |
|
|
|
108 |
public String getFieldName() {
|
|
|
109 |
return _fieldName;
|
|
|
110 |
}
|
|
|
111 |
}
|
|
|
112 |
|
|
|
113 |
// isset id assignments
|
|
|
114 |
private static final int __ID_ISSET_ID = 0;
|
|
|
115 |
private static final int __CREATEDON_ISSET_ID = 1;
|
| 483 |
rajveer |
116 |
private static final int __SHOPPINGCARTID_ISSET_ID = 2;
|
| 68 |
ashish |
117 |
private static final int __CUSTOMER_ID_ISSET_ID = 3;
|
| 483 |
rajveer |
118 |
private BitSet __isset_bit_vector = new BitSet(4);
|
| 68 |
ashish |
119 |
|
|
|
120 |
public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
|
|
|
121 |
put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT,
|
|
|
122 |
new FieldValueMetaData(TType.I64)));
|
| 483 |
rajveer |
123 |
put(_Fields.ORDERS, new FieldMetaData("orders", TFieldRequirementType.DEFAULT,
|
|
|
124 |
new ListMetaData(TType.LIST,
|
|
|
125 |
new StructMetaData(TType.STRUCT, Order.class))));
|
| 68 |
ashish |
126 |
put(_Fields.PAYMENT_INFO, new FieldMetaData("paymentInfo", TFieldRequirementType.DEFAULT,
|
|
|
127 |
new StructMetaData(TType.STRUCT, PaymentInfo.class)));
|
|
|
128 |
put(_Fields.CREATED_ON, new FieldMetaData("createdOn", TFieldRequirementType.DEFAULT,
|
|
|
129 |
new FieldValueMetaData(TType.I64)));
|
|
|
130 |
put(_Fields.TRANSACTION_STATUS, new FieldMetaData("transactionStatus", TFieldRequirementType.DEFAULT,
|
|
|
131 |
new EnumMetaData(TType.ENUM, TransactionStatus.class)));
|
|
|
132 |
put(_Fields.STATUS_DESCRIPTION, new FieldMetaData("statusDescription", TFieldRequirementType.DEFAULT,
|
|
|
133 |
new FieldValueMetaData(TType.STRING)));
|
| 132 |
ashish |
134 |
put(_Fields.SHOPPING_CARTID, new FieldMetaData("shoppingCartid", TFieldRequirementType.DEFAULT,
|
|
|
135 |
new FieldValueMetaData(TType.I64)));
|
| 483 |
rajveer |
136 |
put(_Fields.CUSTOMER_ID, new FieldMetaData("customer_id", TFieldRequirementType.DEFAULT,
|
| 358 |
ashish |
137 |
new FieldValueMetaData(TType.I64)));
|
| 68 |
ashish |
138 |
}});
|
|
|
139 |
|
|
|
140 |
static {
|
|
|
141 |
FieldMetaData.addStructMetaDataMap(Transaction.class, metaDataMap);
|
|
|
142 |
}
|
|
|
143 |
|
|
|
144 |
public Transaction() {
|
|
|
145 |
}
|
|
|
146 |
|
|
|
147 |
public Transaction(
|
|
|
148 |
long id,
|
| 483 |
rajveer |
149 |
List<Order> orders,
|
| 68 |
ashish |
150 |
PaymentInfo paymentInfo,
|
|
|
151 |
long createdOn,
|
|
|
152 |
TransactionStatus transactionStatus,
|
|
|
153 |
String statusDescription,
|
| 358 |
ashish |
154 |
long shoppingCartid,
|
| 483 |
rajveer |
155 |
long customer_id)
|
| 68 |
ashish |
156 |
{
|
|
|
157 |
this();
|
|
|
158 |
this.id = id;
|
|
|
159 |
setIdIsSet(true);
|
| 483 |
rajveer |
160 |
this.orders = orders;
|
| 68 |
ashish |
161 |
this.paymentInfo = paymentInfo;
|
|
|
162 |
this.createdOn = createdOn;
|
|
|
163 |
setCreatedOnIsSet(true);
|
|
|
164 |
this.transactionStatus = transactionStatus;
|
|
|
165 |
this.statusDescription = statusDescription;
|
| 483 |
rajveer |
166 |
this.shoppingCartid = shoppingCartid;
|
|
|
167 |
setShoppingCartidIsSet(true);
|
| 68 |
ashish |
168 |
this.customer_id = customer_id;
|
|
|
169 |
setCustomer_idIsSet(true);
|
|
|
170 |
}
|
|
|
171 |
|
|
|
172 |
/**
|
|
|
173 |
* Performs a deep copy on <i>other</i>.
|
|
|
174 |
*/
|
|
|
175 |
public Transaction(Transaction other) {
|
|
|
176 |
__isset_bit_vector.clear();
|
|
|
177 |
__isset_bit_vector.or(other.__isset_bit_vector);
|
|
|
178 |
this.id = other.id;
|
| 483 |
rajveer |
179 |
if (other.isSetOrders()) {
|
|
|
180 |
List<Order> __this__orders = new ArrayList<Order>();
|
|
|
181 |
for (Order other_element : other.orders) {
|
|
|
182 |
__this__orders.add(new Order(other_element));
|
|
|
183 |
}
|
|
|
184 |
this.orders = __this__orders;
|
| 68 |
ashish |
185 |
}
|
|
|
186 |
if (other.isSetPaymentInfo()) {
|
|
|
187 |
this.paymentInfo = new PaymentInfo(other.paymentInfo);
|
|
|
188 |
}
|
|
|
189 |
this.createdOn = other.createdOn;
|
|
|
190 |
if (other.isSetTransactionStatus()) {
|
|
|
191 |
this.transactionStatus = other.transactionStatus;
|
|
|
192 |
}
|
|
|
193 |
if (other.isSetStatusDescription()) {
|
|
|
194 |
this.statusDescription = other.statusDescription;
|
|
|
195 |
}
|
| 483 |
rajveer |
196 |
this.shoppingCartid = other.shoppingCartid;
|
| 68 |
ashish |
197 |
this.customer_id = other.customer_id;
|
|
|
198 |
}
|
|
|
199 |
|
|
|
200 |
public Transaction deepCopy() {
|
|
|
201 |
return new Transaction(this);
|
|
|
202 |
}
|
|
|
203 |
|
|
|
204 |
@Deprecated
|
|
|
205 |
public Transaction clone() {
|
|
|
206 |
return new Transaction(this);
|
|
|
207 |
}
|
|
|
208 |
|
|
|
209 |
public long getId() {
|
|
|
210 |
return this.id;
|
|
|
211 |
}
|
|
|
212 |
|
|
|
213 |
public Transaction setId(long id) {
|
|
|
214 |
this.id = id;
|
|
|
215 |
setIdIsSet(true);
|
|
|
216 |
return this;
|
|
|
217 |
}
|
|
|
218 |
|
|
|
219 |
public void unsetId() {
|
|
|
220 |
__isset_bit_vector.clear(__ID_ISSET_ID);
|
|
|
221 |
}
|
|
|
222 |
|
|
|
223 |
/** Returns true if field id is set (has been asigned a value) and false otherwise */
|
|
|
224 |
public boolean isSetId() {
|
|
|
225 |
return __isset_bit_vector.get(__ID_ISSET_ID);
|
|
|
226 |
}
|
|
|
227 |
|
|
|
228 |
public void setIdIsSet(boolean value) {
|
|
|
229 |
__isset_bit_vector.set(__ID_ISSET_ID, value);
|
|
|
230 |
}
|
|
|
231 |
|
| 483 |
rajveer |
232 |
public int getOrdersSize() {
|
|
|
233 |
return (this.orders == null) ? 0 : this.orders.size();
|
| 68 |
ashish |
234 |
}
|
|
|
235 |
|
| 483 |
rajveer |
236 |
public java.util.Iterator<Order> getOrdersIterator() {
|
|
|
237 |
return (this.orders == null) ? null : this.orders.iterator();
|
| 68 |
ashish |
238 |
}
|
|
|
239 |
|
| 483 |
rajveer |
240 |
public void addToOrders(Order elem) {
|
|
|
241 |
if (this.orders == null) {
|
|
|
242 |
this.orders = new ArrayList<Order>();
|
| 68 |
ashish |
243 |
}
|
| 483 |
rajveer |
244 |
this.orders.add(elem);
|
| 68 |
ashish |
245 |
}
|
|
|
246 |
|
| 483 |
rajveer |
247 |
public List<Order> getOrders() {
|
|
|
248 |
return this.orders;
|
| 68 |
ashish |
249 |
}
|
|
|
250 |
|
| 483 |
rajveer |
251 |
public Transaction setOrders(List<Order> orders) {
|
|
|
252 |
this.orders = orders;
|
| 68 |
ashish |
253 |
return this;
|
|
|
254 |
}
|
|
|
255 |
|
| 483 |
rajveer |
256 |
public void unsetOrders() {
|
|
|
257 |
this.orders = null;
|
| 68 |
ashish |
258 |
}
|
|
|
259 |
|
| 483 |
rajveer |
260 |
/** Returns true if field orders is set (has been asigned a value) and false otherwise */
|
|
|
261 |
public boolean isSetOrders() {
|
|
|
262 |
return this.orders != null;
|
| 68 |
ashish |
263 |
}
|
|
|
264 |
|
| 483 |
rajveer |
265 |
public void setOrdersIsSet(boolean value) {
|
| 68 |
ashish |
266 |
if (!value) {
|
| 483 |
rajveer |
267 |
this.orders = null;
|
| 68 |
ashish |
268 |
}
|
|
|
269 |
}
|
|
|
270 |
|
|
|
271 |
public PaymentInfo getPaymentInfo() {
|
|
|
272 |
return this.paymentInfo;
|
|
|
273 |
}
|
|
|
274 |
|
|
|
275 |
public Transaction setPaymentInfo(PaymentInfo paymentInfo) {
|
|
|
276 |
this.paymentInfo = paymentInfo;
|
|
|
277 |
return this;
|
|
|
278 |
}
|
|
|
279 |
|
|
|
280 |
public void unsetPaymentInfo() {
|
|
|
281 |
this.paymentInfo = null;
|
|
|
282 |
}
|
|
|
283 |
|
|
|
284 |
/** Returns true if field paymentInfo is set (has been asigned a value) and false otherwise */
|
|
|
285 |
public boolean isSetPaymentInfo() {
|
|
|
286 |
return this.paymentInfo != null;
|
|
|
287 |
}
|
|
|
288 |
|
|
|
289 |
public void setPaymentInfoIsSet(boolean value) {
|
|
|
290 |
if (!value) {
|
|
|
291 |
this.paymentInfo = null;
|
|
|
292 |
}
|
|
|
293 |
}
|
|
|
294 |
|
|
|
295 |
public long getCreatedOn() {
|
|
|
296 |
return this.createdOn;
|
|
|
297 |
}
|
|
|
298 |
|
|
|
299 |
public Transaction setCreatedOn(long createdOn) {
|
|
|
300 |
this.createdOn = createdOn;
|
|
|
301 |
setCreatedOnIsSet(true);
|
|
|
302 |
return this;
|
|
|
303 |
}
|
|
|
304 |
|
|
|
305 |
public void unsetCreatedOn() {
|
|
|
306 |
__isset_bit_vector.clear(__CREATEDON_ISSET_ID);
|
|
|
307 |
}
|
|
|
308 |
|
|
|
309 |
/** Returns true if field createdOn is set (has been asigned a value) and false otherwise */
|
|
|
310 |
public boolean isSetCreatedOn() {
|
|
|
311 |
return __isset_bit_vector.get(__CREATEDON_ISSET_ID);
|
|
|
312 |
}
|
|
|
313 |
|
|
|
314 |
public void setCreatedOnIsSet(boolean value) {
|
|
|
315 |
__isset_bit_vector.set(__CREATEDON_ISSET_ID, value);
|
|
|
316 |
}
|
|
|
317 |
|
|
|
318 |
/**
|
|
|
319 |
*
|
|
|
320 |
* @see TransactionStatus
|
|
|
321 |
*/
|
|
|
322 |
public TransactionStatus getTransactionStatus() {
|
|
|
323 |
return this.transactionStatus;
|
|
|
324 |
}
|
|
|
325 |
|
|
|
326 |
/**
|
|
|
327 |
*
|
|
|
328 |
* @see TransactionStatus
|
|
|
329 |
*/
|
|
|
330 |
public Transaction setTransactionStatus(TransactionStatus transactionStatus) {
|
|
|
331 |
this.transactionStatus = transactionStatus;
|
|
|
332 |
return this;
|
|
|
333 |
}
|
|
|
334 |
|
|
|
335 |
public void unsetTransactionStatus() {
|
|
|
336 |
this.transactionStatus = null;
|
|
|
337 |
}
|
|
|
338 |
|
|
|
339 |
/** Returns true if field transactionStatus is set (has been asigned a value) and false otherwise */
|
|
|
340 |
public boolean isSetTransactionStatus() {
|
|
|
341 |
return this.transactionStatus != null;
|
|
|
342 |
}
|
|
|
343 |
|
|
|
344 |
public void setTransactionStatusIsSet(boolean value) {
|
|
|
345 |
if (!value) {
|
|
|
346 |
this.transactionStatus = null;
|
|
|
347 |
}
|
|
|
348 |
}
|
|
|
349 |
|
|
|
350 |
public String getStatusDescription() {
|
|
|
351 |
return this.statusDescription;
|
|
|
352 |
}
|
|
|
353 |
|
|
|
354 |
public Transaction setStatusDescription(String statusDescription) {
|
|
|
355 |
this.statusDescription = statusDescription;
|
|
|
356 |
return this;
|
|
|
357 |
}
|
|
|
358 |
|
|
|
359 |
public void unsetStatusDescription() {
|
|
|
360 |
this.statusDescription = null;
|
|
|
361 |
}
|
|
|
362 |
|
|
|
363 |
/** Returns true if field statusDescription is set (has been asigned a value) and false otherwise */
|
|
|
364 |
public boolean isSetStatusDescription() {
|
|
|
365 |
return this.statusDescription != null;
|
|
|
366 |
}
|
|
|
367 |
|
|
|
368 |
public void setStatusDescriptionIsSet(boolean value) {
|
|
|
369 |
if (!value) {
|
|
|
370 |
this.statusDescription = null;
|
|
|
371 |
}
|
|
|
372 |
}
|
|
|
373 |
|
| 132 |
ashish |
374 |
public long getShoppingCartid() {
|
|
|
375 |
return this.shoppingCartid;
|
|
|
376 |
}
|
|
|
377 |
|
|
|
378 |
public Transaction setShoppingCartid(long shoppingCartid) {
|
|
|
379 |
this.shoppingCartid = shoppingCartid;
|
|
|
380 |
setShoppingCartidIsSet(true);
|
|
|
381 |
return this;
|
|
|
382 |
}
|
|
|
383 |
|
|
|
384 |
public void unsetShoppingCartid() {
|
|
|
385 |
__isset_bit_vector.clear(__SHOPPINGCARTID_ISSET_ID);
|
|
|
386 |
}
|
|
|
387 |
|
|
|
388 |
/** Returns true if field shoppingCartid is set (has been asigned a value) and false otherwise */
|
|
|
389 |
public boolean isSetShoppingCartid() {
|
|
|
390 |
return __isset_bit_vector.get(__SHOPPINGCARTID_ISSET_ID);
|
|
|
391 |
}
|
|
|
392 |
|
|
|
393 |
public void setShoppingCartidIsSet(boolean value) {
|
|
|
394 |
__isset_bit_vector.set(__SHOPPINGCARTID_ISSET_ID, value);
|
|
|
395 |
}
|
|
|
396 |
|
| 483 |
rajveer |
397 |
public long getCustomer_id() {
|
|
|
398 |
return this.customer_id;
|
| 358 |
ashish |
399 |
}
|
|
|
400 |
|
| 483 |
rajveer |
401 |
public Transaction setCustomer_id(long customer_id) {
|
|
|
402 |
this.customer_id = customer_id;
|
|
|
403 |
setCustomer_idIsSet(true);
|
| 358 |
ashish |
404 |
return this;
|
|
|
405 |
}
|
|
|
406 |
|
| 483 |
rajveer |
407 |
public void unsetCustomer_id() {
|
|
|
408 |
__isset_bit_vector.clear(__CUSTOMER_ID_ISSET_ID);
|
| 358 |
ashish |
409 |
}
|
|
|
410 |
|
| 483 |
rajveer |
411 |
/** Returns true if field customer_id is set (has been asigned a value) and false otherwise */
|
|
|
412 |
public boolean isSetCustomer_id() {
|
|
|
413 |
return __isset_bit_vector.get(__CUSTOMER_ID_ISSET_ID);
|
| 358 |
ashish |
414 |
}
|
|
|
415 |
|
| 483 |
rajveer |
416 |
public void setCustomer_idIsSet(boolean value) {
|
|
|
417 |
__isset_bit_vector.set(__CUSTOMER_ID_ISSET_ID, value);
|
| 358 |
ashish |
418 |
}
|
|
|
419 |
|
| 68 |
ashish |
420 |
public void setFieldValue(_Fields field, Object value) {
|
|
|
421 |
switch (field) {
|
|
|
422 |
case ID:
|
|
|
423 |
if (value == null) {
|
|
|
424 |
unsetId();
|
|
|
425 |
} else {
|
|
|
426 |
setId((Long)value);
|
|
|
427 |
}
|
|
|
428 |
break;
|
|
|
429 |
|
| 483 |
rajveer |
430 |
case ORDERS:
|
| 68 |
ashish |
431 |
if (value == null) {
|
| 483 |
rajveer |
432 |
unsetOrders();
|
| 68 |
ashish |
433 |
} else {
|
| 483 |
rajveer |
434 |
setOrders((List<Order>)value);
|
| 68 |
ashish |
435 |
}
|
|
|
436 |
break;
|
|
|
437 |
|
|
|
438 |
case PAYMENT_INFO:
|
|
|
439 |
if (value == null) {
|
|
|
440 |
unsetPaymentInfo();
|
|
|
441 |
} else {
|
|
|
442 |
setPaymentInfo((PaymentInfo)value);
|
|
|
443 |
}
|
|
|
444 |
break;
|
|
|
445 |
|
|
|
446 |
case CREATED_ON:
|
|
|
447 |
if (value == null) {
|
|
|
448 |
unsetCreatedOn();
|
|
|
449 |
} else {
|
|
|
450 |
setCreatedOn((Long)value);
|
|
|
451 |
}
|
|
|
452 |
break;
|
|
|
453 |
|
|
|
454 |
case TRANSACTION_STATUS:
|
|
|
455 |
if (value == null) {
|
|
|
456 |
unsetTransactionStatus();
|
|
|
457 |
} else {
|
|
|
458 |
setTransactionStatus((TransactionStatus)value);
|
|
|
459 |
}
|
|
|
460 |
break;
|
|
|
461 |
|
|
|
462 |
case STATUS_DESCRIPTION:
|
|
|
463 |
if (value == null) {
|
|
|
464 |
unsetStatusDescription();
|
|
|
465 |
} else {
|
|
|
466 |
setStatusDescription((String)value);
|
|
|
467 |
}
|
|
|
468 |
break;
|
|
|
469 |
|
| 132 |
ashish |
470 |
case SHOPPING_CARTID:
|
|
|
471 |
if (value == null) {
|
|
|
472 |
unsetShoppingCartid();
|
|
|
473 |
} else {
|
|
|
474 |
setShoppingCartid((Long)value);
|
|
|
475 |
}
|
|
|
476 |
break;
|
|
|
477 |
|
| 483 |
rajveer |
478 |
case CUSTOMER_ID:
|
| 358 |
ashish |
479 |
if (value == null) {
|
| 483 |
rajveer |
480 |
unsetCustomer_id();
|
| 358 |
ashish |
481 |
} else {
|
| 483 |
rajveer |
482 |
setCustomer_id((Long)value);
|
| 358 |
ashish |
483 |
}
|
|
|
484 |
break;
|
|
|
485 |
|
| 68 |
ashish |
486 |
}
|
|
|
487 |
}
|
|
|
488 |
|
|
|
489 |
public void setFieldValue(int fieldID, Object value) {
|
|
|
490 |
setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
|
|
|
491 |
}
|
|
|
492 |
|
|
|
493 |
public Object getFieldValue(_Fields field) {
|
|
|
494 |
switch (field) {
|
|
|
495 |
case ID:
|
|
|
496 |
return new Long(getId());
|
|
|
497 |
|
| 483 |
rajveer |
498 |
case ORDERS:
|
|
|
499 |
return getOrders();
|
| 68 |
ashish |
500 |
|
|
|
501 |
case PAYMENT_INFO:
|
|
|
502 |
return getPaymentInfo();
|
|
|
503 |
|
|
|
504 |
case CREATED_ON:
|
|
|
505 |
return new Long(getCreatedOn());
|
|
|
506 |
|
|
|
507 |
case TRANSACTION_STATUS:
|
|
|
508 |
return getTransactionStatus();
|
|
|
509 |
|
|
|
510 |
case STATUS_DESCRIPTION:
|
|
|
511 |
return getStatusDescription();
|
|
|
512 |
|
| 132 |
ashish |
513 |
case SHOPPING_CARTID:
|
|
|
514 |
return new Long(getShoppingCartid());
|
|
|
515 |
|
| 483 |
rajveer |
516 |
case CUSTOMER_ID:
|
|
|
517 |
return new Long(getCustomer_id());
|
| 358 |
ashish |
518 |
|
| 68 |
ashish |
519 |
}
|
|
|
520 |
throw new IllegalStateException();
|
|
|
521 |
}
|
|
|
522 |
|
|
|
523 |
public Object getFieldValue(int fieldId) {
|
|
|
524 |
return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
|
|
|
525 |
}
|
|
|
526 |
|
|
|
527 |
/** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
|
|
|
528 |
public boolean isSet(_Fields field) {
|
|
|
529 |
switch (field) {
|
|
|
530 |
case ID:
|
|
|
531 |
return isSetId();
|
| 483 |
rajveer |
532 |
case ORDERS:
|
|
|
533 |
return isSetOrders();
|
| 68 |
ashish |
534 |
case PAYMENT_INFO:
|
|
|
535 |
return isSetPaymentInfo();
|
|
|
536 |
case CREATED_ON:
|
|
|
537 |
return isSetCreatedOn();
|
|
|
538 |
case TRANSACTION_STATUS:
|
|
|
539 |
return isSetTransactionStatus();
|
|
|
540 |
case STATUS_DESCRIPTION:
|
|
|
541 |
return isSetStatusDescription();
|
| 483 |
rajveer |
542 |
case SHOPPING_CARTID:
|
|
|
543 |
return isSetShoppingCartid();
|
| 68 |
ashish |
544 |
case CUSTOMER_ID:
|
|
|
545 |
return isSetCustomer_id();
|
|
|
546 |
}
|
|
|
547 |
throw new IllegalStateException();
|
|
|
548 |
}
|
|
|
549 |
|
|
|
550 |
public boolean isSet(int fieldID) {
|
|
|
551 |
return isSet(_Fields.findByThriftIdOrThrow(fieldID));
|
|
|
552 |
}
|
|
|
553 |
|
|
|
554 |
@Override
|
|
|
555 |
public boolean equals(Object that) {
|
|
|
556 |
if (that == null)
|
|
|
557 |
return false;
|
|
|
558 |
if (that instanceof Transaction)
|
|
|
559 |
return this.equals((Transaction)that);
|
|
|
560 |
return false;
|
|
|
561 |
}
|
|
|
562 |
|
|
|
563 |
public boolean equals(Transaction that) {
|
|
|
564 |
if (that == null)
|
|
|
565 |
return false;
|
|
|
566 |
|
|
|
567 |
boolean this_present_id = true;
|
|
|
568 |
boolean that_present_id = true;
|
|
|
569 |
if (this_present_id || that_present_id) {
|
|
|
570 |
if (!(this_present_id && that_present_id))
|
|
|
571 |
return false;
|
|
|
572 |
if (this.id != that.id)
|
|
|
573 |
return false;
|
|
|
574 |
}
|
|
|
575 |
|
| 483 |
rajveer |
576 |
boolean this_present_orders = true && this.isSetOrders();
|
|
|
577 |
boolean that_present_orders = true && that.isSetOrders();
|
|
|
578 |
if (this_present_orders || that_present_orders) {
|
|
|
579 |
if (!(this_present_orders && that_present_orders))
|
| 68 |
ashish |
580 |
return false;
|
| 483 |
rajveer |
581 |
if (!this.orders.equals(that.orders))
|
| 68 |
ashish |
582 |
return false;
|
|
|
583 |
}
|
|
|
584 |
|
|
|
585 |
boolean this_present_paymentInfo = true && this.isSetPaymentInfo();
|
|
|
586 |
boolean that_present_paymentInfo = true && that.isSetPaymentInfo();
|
|
|
587 |
if (this_present_paymentInfo || that_present_paymentInfo) {
|
|
|
588 |
if (!(this_present_paymentInfo && that_present_paymentInfo))
|
|
|
589 |
return false;
|
|
|
590 |
if (!this.paymentInfo.equals(that.paymentInfo))
|
|
|
591 |
return false;
|
|
|
592 |
}
|
|
|
593 |
|
|
|
594 |
boolean this_present_createdOn = true;
|
|
|
595 |
boolean that_present_createdOn = true;
|
|
|
596 |
if (this_present_createdOn || that_present_createdOn) {
|
|
|
597 |
if (!(this_present_createdOn && that_present_createdOn))
|
|
|
598 |
return false;
|
|
|
599 |
if (this.createdOn != that.createdOn)
|
|
|
600 |
return false;
|
|
|
601 |
}
|
|
|
602 |
|
|
|
603 |
boolean this_present_transactionStatus = true && this.isSetTransactionStatus();
|
|
|
604 |
boolean that_present_transactionStatus = true && that.isSetTransactionStatus();
|
|
|
605 |
if (this_present_transactionStatus || that_present_transactionStatus) {
|
|
|
606 |
if (!(this_present_transactionStatus && that_present_transactionStatus))
|
|
|
607 |
return false;
|
|
|
608 |
if (!this.transactionStatus.equals(that.transactionStatus))
|
|
|
609 |
return false;
|
|
|
610 |
}
|
|
|
611 |
|
|
|
612 |
boolean this_present_statusDescription = true && this.isSetStatusDescription();
|
|
|
613 |
boolean that_present_statusDescription = true && that.isSetStatusDescription();
|
|
|
614 |
if (this_present_statusDescription || that_present_statusDescription) {
|
|
|
615 |
if (!(this_present_statusDescription && that_present_statusDescription))
|
|
|
616 |
return false;
|
|
|
617 |
if (!this.statusDescription.equals(that.statusDescription))
|
|
|
618 |
return false;
|
|
|
619 |
}
|
|
|
620 |
|
| 132 |
ashish |
621 |
boolean this_present_shoppingCartid = true;
|
|
|
622 |
boolean that_present_shoppingCartid = true;
|
|
|
623 |
if (this_present_shoppingCartid || that_present_shoppingCartid) {
|
|
|
624 |
if (!(this_present_shoppingCartid && that_present_shoppingCartid))
|
|
|
625 |
return false;
|
|
|
626 |
if (this.shoppingCartid != that.shoppingCartid)
|
|
|
627 |
return false;
|
|
|
628 |
}
|
|
|
629 |
|
| 483 |
rajveer |
630 |
boolean this_present_customer_id = true;
|
|
|
631 |
boolean that_present_customer_id = true;
|
|
|
632 |
if (this_present_customer_id || that_present_customer_id) {
|
|
|
633 |
if (!(this_present_customer_id && that_present_customer_id))
|
| 358 |
ashish |
634 |
return false;
|
| 483 |
rajveer |
635 |
if (this.customer_id != that.customer_id)
|
| 358 |
ashish |
636 |
return false;
|
|
|
637 |
}
|
|
|
638 |
|
| 68 |
ashish |
639 |
return true;
|
|
|
640 |
}
|
|
|
641 |
|
|
|
642 |
@Override
|
|
|
643 |
public int hashCode() {
|
|
|
644 |
return 0;
|
|
|
645 |
}
|
|
|
646 |
|
|
|
647 |
public void read(TProtocol iprot) throws TException {
|
|
|
648 |
TField field;
|
|
|
649 |
iprot.readStructBegin();
|
|
|
650 |
while (true)
|
|
|
651 |
{
|
|
|
652 |
field = iprot.readFieldBegin();
|
|
|
653 |
if (field.type == TType.STOP) {
|
|
|
654 |
break;
|
|
|
655 |
}
|
|
|
656 |
_Fields fieldId = _Fields.findByThriftId(field.id);
|
|
|
657 |
if (fieldId == null) {
|
|
|
658 |
TProtocolUtil.skip(iprot, field.type);
|
|
|
659 |
} else {
|
|
|
660 |
switch (fieldId) {
|
|
|
661 |
case ID:
|
|
|
662 |
if (field.type == TType.I64) {
|
|
|
663 |
this.id = iprot.readI64();
|
|
|
664 |
setIdIsSet(true);
|
|
|
665 |
} else {
|
|
|
666 |
TProtocolUtil.skip(iprot, field.type);
|
|
|
667 |
}
|
|
|
668 |
break;
|
| 483 |
rajveer |
669 |
case ORDERS:
|
|
|
670 |
if (field.type == TType.LIST) {
|
|
|
671 |
{
|
|
|
672 |
TList _list9 = iprot.readListBegin();
|
|
|
673 |
this.orders = new ArrayList<Order>(_list9.size);
|
|
|
674 |
for (int _i10 = 0; _i10 < _list9.size; ++_i10)
|
|
|
675 |
{
|
|
|
676 |
Order _elem11;
|
|
|
677 |
_elem11 = new Order();
|
|
|
678 |
_elem11.read(iprot);
|
|
|
679 |
this.orders.add(_elem11);
|
|
|
680 |
}
|
|
|
681 |
iprot.readListEnd();
|
|
|
682 |
}
|
| 68 |
ashish |
683 |
} else {
|
|
|
684 |
TProtocolUtil.skip(iprot, field.type);
|
|
|
685 |
}
|
|
|
686 |
break;
|
|
|
687 |
case PAYMENT_INFO:
|
|
|
688 |
if (field.type == TType.STRUCT) {
|
|
|
689 |
this.paymentInfo = new PaymentInfo();
|
|
|
690 |
this.paymentInfo.read(iprot);
|
|
|
691 |
} else {
|
|
|
692 |
TProtocolUtil.skip(iprot, field.type);
|
|
|
693 |
}
|
|
|
694 |
break;
|
|
|
695 |
case CREATED_ON:
|
|
|
696 |
if (field.type == TType.I64) {
|
|
|
697 |
this.createdOn = iprot.readI64();
|
|
|
698 |
setCreatedOnIsSet(true);
|
|
|
699 |
} else {
|
|
|
700 |
TProtocolUtil.skip(iprot, field.type);
|
|
|
701 |
}
|
|
|
702 |
break;
|
|
|
703 |
case TRANSACTION_STATUS:
|
|
|
704 |
if (field.type == TType.I32) {
|
|
|
705 |
this.transactionStatus = TransactionStatus.findByValue(iprot.readI32());
|
|
|
706 |
} else {
|
|
|
707 |
TProtocolUtil.skip(iprot, field.type);
|
|
|
708 |
}
|
|
|
709 |
break;
|
|
|
710 |
case STATUS_DESCRIPTION:
|
|
|
711 |
if (field.type == TType.STRING) {
|
|
|
712 |
this.statusDescription = iprot.readString();
|
|
|
713 |
} else {
|
|
|
714 |
TProtocolUtil.skip(iprot, field.type);
|
|
|
715 |
}
|
|
|
716 |
break;
|
| 132 |
ashish |
717 |
case SHOPPING_CARTID:
|
|
|
718 |
if (field.type == TType.I64) {
|
|
|
719 |
this.shoppingCartid = iprot.readI64();
|
|
|
720 |
setShoppingCartidIsSet(true);
|
|
|
721 |
} else {
|
|
|
722 |
TProtocolUtil.skip(iprot, field.type);
|
|
|
723 |
}
|
|
|
724 |
break;
|
| 483 |
rajveer |
725 |
case CUSTOMER_ID:
|
| 358 |
ashish |
726 |
if (field.type == TType.I64) {
|
| 483 |
rajveer |
727 |
this.customer_id = iprot.readI64();
|
|
|
728 |
setCustomer_idIsSet(true);
|
| 358 |
ashish |
729 |
} else {
|
|
|
730 |
TProtocolUtil.skip(iprot, field.type);
|
|
|
731 |
}
|
|
|
732 |
break;
|
| 68 |
ashish |
733 |
}
|
|
|
734 |
iprot.readFieldEnd();
|
|
|
735 |
}
|
|
|
736 |
}
|
|
|
737 |
iprot.readStructEnd();
|
|
|
738 |
validate();
|
|
|
739 |
}
|
|
|
740 |
|
|
|
741 |
public void write(TProtocol oprot) throws TException {
|
|
|
742 |
validate();
|
|
|
743 |
|
|
|
744 |
oprot.writeStructBegin(STRUCT_DESC);
|
|
|
745 |
oprot.writeFieldBegin(ID_FIELD_DESC);
|
|
|
746 |
oprot.writeI64(this.id);
|
|
|
747 |
oprot.writeFieldEnd();
|
| 483 |
rajveer |
748 |
if (this.orders != null) {
|
|
|
749 |
oprot.writeFieldBegin(ORDERS_FIELD_DESC);
|
|
|
750 |
{
|
|
|
751 |
oprot.writeListBegin(new TList(TType.STRUCT, this.orders.size()));
|
|
|
752 |
for (Order _iter12 : this.orders)
|
|
|
753 |
{
|
|
|
754 |
_iter12.write(oprot);
|
|
|
755 |
}
|
|
|
756 |
oprot.writeListEnd();
|
|
|
757 |
}
|
| 68 |
ashish |
758 |
oprot.writeFieldEnd();
|
|
|
759 |
}
|
|
|
760 |
if (this.paymentInfo != null) {
|
|
|
761 |
oprot.writeFieldBegin(PAYMENT_INFO_FIELD_DESC);
|
|
|
762 |
this.paymentInfo.write(oprot);
|
|
|
763 |
oprot.writeFieldEnd();
|
|
|
764 |
}
|
|
|
765 |
oprot.writeFieldBegin(CREATED_ON_FIELD_DESC);
|
|
|
766 |
oprot.writeI64(this.createdOn);
|
|
|
767 |
oprot.writeFieldEnd();
|
|
|
768 |
if (this.transactionStatus != null) {
|
|
|
769 |
oprot.writeFieldBegin(TRANSACTION_STATUS_FIELD_DESC);
|
|
|
770 |
oprot.writeI32(this.transactionStatus.getValue());
|
|
|
771 |
oprot.writeFieldEnd();
|
|
|
772 |
}
|
|
|
773 |
if (this.statusDescription != null) {
|
|
|
774 |
oprot.writeFieldBegin(STATUS_DESCRIPTION_FIELD_DESC);
|
|
|
775 |
oprot.writeString(this.statusDescription);
|
|
|
776 |
oprot.writeFieldEnd();
|
|
|
777 |
}
|
| 132 |
ashish |
778 |
oprot.writeFieldBegin(SHOPPING_CARTID_FIELD_DESC);
|
|
|
779 |
oprot.writeI64(this.shoppingCartid);
|
|
|
780 |
oprot.writeFieldEnd();
|
| 483 |
rajveer |
781 |
oprot.writeFieldBegin(CUSTOMER_ID_FIELD_DESC);
|
|
|
782 |
oprot.writeI64(this.customer_id);
|
| 358 |
ashish |
783 |
oprot.writeFieldEnd();
|
| 68 |
ashish |
784 |
oprot.writeFieldStop();
|
|
|
785 |
oprot.writeStructEnd();
|
|
|
786 |
}
|
|
|
787 |
|
|
|
788 |
@Override
|
|
|
789 |
public String toString() {
|
|
|
790 |
StringBuilder sb = new StringBuilder("Transaction(");
|
|
|
791 |
boolean first = true;
|
|
|
792 |
|
|
|
793 |
sb.append("id:");
|
|
|
794 |
sb.append(this.id);
|
|
|
795 |
first = false;
|
|
|
796 |
if (!first) sb.append(", ");
|
| 483 |
rajveer |
797 |
sb.append("orders:");
|
|
|
798 |
if (this.orders == null) {
|
| 68 |
ashish |
799 |
sb.append("null");
|
|
|
800 |
} else {
|
| 483 |
rajveer |
801 |
sb.append(this.orders);
|
| 68 |
ashish |
802 |
}
|
|
|
803 |
first = false;
|
|
|
804 |
if (!first) sb.append(", ");
|
|
|
805 |
sb.append("paymentInfo:");
|
|
|
806 |
if (this.paymentInfo == null) {
|
|
|
807 |
sb.append("null");
|
|
|
808 |
} else {
|
|
|
809 |
sb.append(this.paymentInfo);
|
|
|
810 |
}
|
|
|
811 |
first = false;
|
|
|
812 |
if (!first) sb.append(", ");
|
|
|
813 |
sb.append("createdOn:");
|
|
|
814 |
sb.append(this.createdOn);
|
|
|
815 |
first = false;
|
|
|
816 |
if (!first) sb.append(", ");
|
|
|
817 |
sb.append("transactionStatus:");
|
|
|
818 |
if (this.transactionStatus == null) {
|
|
|
819 |
sb.append("null");
|
|
|
820 |
} else {
|
|
|
821 |
String transactionStatus_name = transactionStatus.name();
|
|
|
822 |
if (transactionStatus_name != null) {
|
|
|
823 |
sb.append(transactionStatus_name);
|
|
|
824 |
sb.append(" (");
|
|
|
825 |
}
|
|
|
826 |
sb.append(this.transactionStatus);
|
|
|
827 |
if (transactionStatus_name != null) {
|
|
|
828 |
sb.append(")");
|
|
|
829 |
}
|
|
|
830 |
}
|
|
|
831 |
first = false;
|
|
|
832 |
if (!first) sb.append(", ");
|
|
|
833 |
sb.append("statusDescription:");
|
|
|
834 |
if (this.statusDescription == null) {
|
|
|
835 |
sb.append("null");
|
|
|
836 |
} else {
|
|
|
837 |
sb.append(this.statusDescription);
|
|
|
838 |
}
|
|
|
839 |
first = false;
|
|
|
840 |
if (!first) sb.append(", ");
|
| 132 |
ashish |
841 |
sb.append("shoppingCartid:");
|
|
|
842 |
sb.append(this.shoppingCartid);
|
|
|
843 |
first = false;
|
| 358 |
ashish |
844 |
if (!first) sb.append(", ");
|
| 483 |
rajveer |
845 |
sb.append("customer_id:");
|
|
|
846 |
sb.append(this.customer_id);
|
| 358 |
ashish |
847 |
first = false;
|
| 68 |
ashish |
848 |
sb.append(")");
|
|
|
849 |
return sb.toString();
|
|
|
850 |
}
|
|
|
851 |
|
|
|
852 |
public void validate() throws TException {
|
|
|
853 |
// check for required fields
|
|
|
854 |
}
|
|
|
855 |
|
|
|
856 |
}
|
|
|
857 |
|