Subversion Repositories SmartDukaan

Rev

Rev 7322 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
7311 kshitij.so 1
/**
2
 * Autogenerated by Thrift Compiler (0.7.0)
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.nio.ByteBuffer;
19
import java.util.Arrays;
20
import org.slf4j.Logger;
21
import org.slf4j.LoggerFactory;
22
 
23
public class AmazonOrder implements org.apache.thrift.TBase<AmazonOrder, AmazonOrder._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AmazonOrder");
25
 
26
  private static final org.apache.thrift.protocol.TField ORDER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("orderId", org.apache.thrift.protocol.TType.I64, (short)1);
27
  private static final org.apache.thrift.protocol.TField AMAZON_ORDER_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("amazonOrderCode", org.apache.thrift.protocol.TType.I64, (short)2);
28
  private static final org.apache.thrift.protocol.TField AMAZON_ORDER_ITEM_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("amazonOrderItemCode", org.apache.thrift.protocol.TType.I64, (short)3);
29
  private static final org.apache.thrift.protocol.TField TRANSACTION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("transactionId", org.apache.thrift.protocol.TType.I64, (short)4);
30
  private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("item_id", org.apache.thrift.protocol.TType.I64, (short)5);
31
  private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRING, (short)6);
32
 
33
  private long orderId; // required
34
  private long amazonOrderCode; // required
35
  private long amazonOrderItemCode; // required
36
  private long transactionId; // required
37
  private long item_id; // required
38
  private String status; // required
39
 
40
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
41
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
42
    ORDER_ID((short)1, "orderId"),
43
    AMAZON_ORDER_CODE((short)2, "amazonOrderCode"),
44
    AMAZON_ORDER_ITEM_CODE((short)3, "amazonOrderItemCode"),
45
    TRANSACTION_ID((short)4, "transactionId"),
46
    ITEM_ID((short)5, "item_id"),
47
    STATUS((short)6, "status");
48
 
49
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
50
 
51
    static {
52
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
53
        byName.put(field.getFieldName(), field);
54
      }
55
    }
56
 
57
    /**
58
     * Find the _Fields constant that matches fieldId, or null if its not found.
59
     */
60
    public static _Fields findByThriftId(int fieldId) {
61
      switch(fieldId) {
62
        case 1: // ORDER_ID
63
          return ORDER_ID;
64
        case 2: // AMAZON_ORDER_CODE
65
          return AMAZON_ORDER_CODE;
66
        case 3: // AMAZON_ORDER_ITEM_CODE
67
          return AMAZON_ORDER_ITEM_CODE;
68
        case 4: // TRANSACTION_ID
69
          return TRANSACTION_ID;
70
        case 5: // ITEM_ID
71
          return ITEM_ID;
72
        case 6: // STATUS
73
          return STATUS;
74
        default:
75
          return null;
76
      }
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 __ORDERID_ISSET_ID = 0;
115
  private static final int __AMAZONORDERCODE_ISSET_ID = 1;
116
  private static final int __AMAZONORDERITEMCODE_ISSET_ID = 2;
117
  private static final int __TRANSACTIONID_ISSET_ID = 3;
118
  private static final int __ITEM_ID_ISSET_ID = 4;
119
  private BitSet __isset_bit_vector = new BitSet(5);
120
 
121
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
122
  static {
123
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
124
    tmpMap.put(_Fields.ORDER_ID, new org.apache.thrift.meta_data.FieldMetaData("orderId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
125
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
126
    tmpMap.put(_Fields.AMAZON_ORDER_CODE, new org.apache.thrift.meta_data.FieldMetaData("amazonOrderCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
127
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
128
    tmpMap.put(_Fields.AMAZON_ORDER_ITEM_CODE, new org.apache.thrift.meta_data.FieldMetaData("amazonOrderItemCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
129
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
130
    tmpMap.put(_Fields.TRANSACTION_ID, new org.apache.thrift.meta_data.FieldMetaData("transactionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
131
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
132
    tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("item_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
133
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
134
    tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.DEFAULT, 
135
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
136
    metaDataMap = Collections.unmodifiableMap(tmpMap);
137
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(AmazonOrder.class, metaDataMap);
138
  }
139
 
140
  public AmazonOrder() {
141
  }
142
 
143
  public AmazonOrder(
144
    long orderId,
145
    long amazonOrderCode,
146
    long amazonOrderItemCode,
147
    long transactionId,
148
    long item_id,
149
    String status)
150
  {
151
    this();
152
    this.orderId = orderId;
153
    setOrderIdIsSet(true);
154
    this.amazonOrderCode = amazonOrderCode;
155
    setAmazonOrderCodeIsSet(true);
156
    this.amazonOrderItemCode = amazonOrderItemCode;
157
    setAmazonOrderItemCodeIsSet(true);
158
    this.transactionId = transactionId;
159
    setTransactionIdIsSet(true);
160
    this.item_id = item_id;
161
    setItem_idIsSet(true);
162
    this.status = status;
163
  }
164
 
165
  /**
166
   * Performs a deep copy on <i>other</i>.
167
   */
168
  public AmazonOrder(AmazonOrder other) {
169
    __isset_bit_vector.clear();
170
    __isset_bit_vector.or(other.__isset_bit_vector);
171
    this.orderId = other.orderId;
172
    this.amazonOrderCode = other.amazonOrderCode;
173
    this.amazonOrderItemCode = other.amazonOrderItemCode;
174
    this.transactionId = other.transactionId;
175
    this.item_id = other.item_id;
176
    if (other.isSetStatus()) {
177
      this.status = other.status;
178
    }
179
  }
180
 
181
  public AmazonOrder deepCopy() {
182
    return new AmazonOrder(this);
183
  }
184
 
185
  @Override
186
  public void clear() {
187
    setOrderIdIsSet(false);
188
    this.orderId = 0;
189
    setAmazonOrderCodeIsSet(false);
190
    this.amazonOrderCode = 0;
191
    setAmazonOrderItemCodeIsSet(false);
192
    this.amazonOrderItemCode = 0;
193
    setTransactionIdIsSet(false);
194
    this.transactionId = 0;
195
    setItem_idIsSet(false);
196
    this.item_id = 0;
197
    this.status = null;
198
  }
199
 
200
  public long getOrderId() {
201
    return this.orderId;
202
  }
203
 
204
  public void setOrderId(long orderId) {
205
    this.orderId = orderId;
206
    setOrderIdIsSet(true);
207
  }
208
 
209
  public void unsetOrderId() {
210
    __isset_bit_vector.clear(__ORDERID_ISSET_ID);
211
  }
212
 
213
  /** Returns true if field orderId is set (has been assigned a value) and false otherwise */
214
  public boolean isSetOrderId() {
215
    return __isset_bit_vector.get(__ORDERID_ISSET_ID);
216
  }
217
 
218
  public void setOrderIdIsSet(boolean value) {
219
    __isset_bit_vector.set(__ORDERID_ISSET_ID, value);
220
  }
221
 
222
  public long getAmazonOrderCode() {
223
    return this.amazonOrderCode;
224
  }
225
 
226
  public void setAmazonOrderCode(long amazonOrderCode) {
227
    this.amazonOrderCode = amazonOrderCode;
228
    setAmazonOrderCodeIsSet(true);
229
  }
230
 
231
  public void unsetAmazonOrderCode() {
232
    __isset_bit_vector.clear(__AMAZONORDERCODE_ISSET_ID);
233
  }
234
 
235
  /** Returns true if field amazonOrderCode is set (has been assigned a value) and false otherwise */
236
  public boolean isSetAmazonOrderCode() {
237
    return __isset_bit_vector.get(__AMAZONORDERCODE_ISSET_ID);
238
  }
239
 
240
  public void setAmazonOrderCodeIsSet(boolean value) {
241
    __isset_bit_vector.set(__AMAZONORDERCODE_ISSET_ID, value);
242
  }
243
 
244
  public long getAmazonOrderItemCode() {
245
    return this.amazonOrderItemCode;
246
  }
247
 
248
  public void setAmazonOrderItemCode(long amazonOrderItemCode) {
249
    this.amazonOrderItemCode = amazonOrderItemCode;
250
    setAmazonOrderItemCodeIsSet(true);
251
  }
252
 
253
  public void unsetAmazonOrderItemCode() {
254
    __isset_bit_vector.clear(__AMAZONORDERITEMCODE_ISSET_ID);
255
  }
256
 
257
  /** Returns true if field amazonOrderItemCode is set (has been assigned a value) and false otherwise */
258
  public boolean isSetAmazonOrderItemCode() {
259
    return __isset_bit_vector.get(__AMAZONORDERITEMCODE_ISSET_ID);
260
  }
261
 
262
  public void setAmazonOrderItemCodeIsSet(boolean value) {
263
    __isset_bit_vector.set(__AMAZONORDERITEMCODE_ISSET_ID, value);
264
  }
265
 
266
  public long getTransactionId() {
267
    return this.transactionId;
268
  }
269
 
270
  public void setTransactionId(long transactionId) {
271
    this.transactionId = transactionId;
272
    setTransactionIdIsSet(true);
273
  }
274
 
275
  public void unsetTransactionId() {
276
    __isset_bit_vector.clear(__TRANSACTIONID_ISSET_ID);
277
  }
278
 
279
  /** Returns true if field transactionId is set (has been assigned a value) and false otherwise */
280
  public boolean isSetTransactionId() {
281
    return __isset_bit_vector.get(__TRANSACTIONID_ISSET_ID);
282
  }
283
 
284
  public void setTransactionIdIsSet(boolean value) {
285
    __isset_bit_vector.set(__TRANSACTIONID_ISSET_ID, value);
286
  }
287
 
288
  public long getItem_id() {
289
    return this.item_id;
290
  }
291
 
292
  public void setItem_id(long item_id) {
293
    this.item_id = item_id;
294
    setItem_idIsSet(true);
295
  }
296
 
297
  public void unsetItem_id() {
298
    __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
299
  }
300
 
301
  /** Returns true if field item_id is set (has been assigned a value) and false otherwise */
302
  public boolean isSetItem_id() {
303
    return __isset_bit_vector.get(__ITEM_ID_ISSET_ID);
304
  }
305
 
306
  public void setItem_idIsSet(boolean value) {
307
    __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
308
  }
309
 
310
  public String getStatus() {
311
    return this.status;
312
  }
313
 
314
  public void setStatus(String status) {
315
    this.status = status;
316
  }
317
 
318
  public void unsetStatus() {
319
    this.status = null;
320
  }
321
 
322
  /** Returns true if field status is set (has been assigned a value) and false otherwise */
323
  public boolean isSetStatus() {
324
    return this.status != null;
325
  }
326
 
327
  public void setStatusIsSet(boolean value) {
328
    if (!value) {
329
      this.status = null;
330
    }
331
  }
332
 
333
  public void setFieldValue(_Fields field, Object value) {
334
    switch (field) {
335
    case ORDER_ID:
336
      if (value == null) {
337
        unsetOrderId();
338
      } else {
339
        setOrderId((Long)value);
340
      }
341
      break;
342
 
343
    case AMAZON_ORDER_CODE:
344
      if (value == null) {
345
        unsetAmazonOrderCode();
346
      } else {
347
        setAmazonOrderCode((Long)value);
348
      }
349
      break;
350
 
351
    case AMAZON_ORDER_ITEM_CODE:
352
      if (value == null) {
353
        unsetAmazonOrderItemCode();
354
      } else {
355
        setAmazonOrderItemCode((Long)value);
356
      }
357
      break;
358
 
359
    case TRANSACTION_ID:
360
      if (value == null) {
361
        unsetTransactionId();
362
      } else {
363
        setTransactionId((Long)value);
364
      }
365
      break;
366
 
367
    case ITEM_ID:
368
      if (value == null) {
369
        unsetItem_id();
370
      } else {
371
        setItem_id((Long)value);
372
      }
373
      break;
374
 
375
    case STATUS:
376
      if (value == null) {
377
        unsetStatus();
378
      } else {
379
        setStatus((String)value);
380
      }
381
      break;
382
 
383
    }
384
  }
385
 
386
  public Object getFieldValue(_Fields field) {
387
    switch (field) {
388
    case ORDER_ID:
389
      return Long.valueOf(getOrderId());
390
 
391
    case AMAZON_ORDER_CODE:
392
      return Long.valueOf(getAmazonOrderCode());
393
 
394
    case AMAZON_ORDER_ITEM_CODE:
395
      return Long.valueOf(getAmazonOrderItemCode());
396
 
397
    case TRANSACTION_ID:
398
      return Long.valueOf(getTransactionId());
399
 
400
    case ITEM_ID:
401
      return Long.valueOf(getItem_id());
402
 
403
    case STATUS:
404
      return getStatus();
405
 
406
    }
407
    throw new IllegalStateException();
408
  }
409
 
410
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
411
  public boolean isSet(_Fields field) {
412
    if (field == null) {
413
      throw new IllegalArgumentException();
414
    }
415
 
416
    switch (field) {
417
    case ORDER_ID:
418
      return isSetOrderId();
419
    case AMAZON_ORDER_CODE:
420
      return isSetAmazonOrderCode();
421
    case AMAZON_ORDER_ITEM_CODE:
422
      return isSetAmazonOrderItemCode();
423
    case TRANSACTION_ID:
424
      return isSetTransactionId();
425
    case ITEM_ID:
426
      return isSetItem_id();
427
    case STATUS:
428
      return isSetStatus();
429
    }
430
    throw new IllegalStateException();
431
  }
432
 
433
  @Override
434
  public boolean equals(Object that) {
435
    if (that == null)
436
      return false;
437
    if (that instanceof AmazonOrder)
438
      return this.equals((AmazonOrder)that);
439
    return false;
440
  }
441
 
442
  public boolean equals(AmazonOrder that) {
443
    if (that == null)
444
      return false;
445
 
446
    boolean this_present_orderId = true;
447
    boolean that_present_orderId = true;
448
    if (this_present_orderId || that_present_orderId) {
449
      if (!(this_present_orderId && that_present_orderId))
450
        return false;
451
      if (this.orderId != that.orderId)
452
        return false;
453
    }
454
 
455
    boolean this_present_amazonOrderCode = true;
456
    boolean that_present_amazonOrderCode = true;
457
    if (this_present_amazonOrderCode || that_present_amazonOrderCode) {
458
      if (!(this_present_amazonOrderCode && that_present_amazonOrderCode))
459
        return false;
460
      if (this.amazonOrderCode != that.amazonOrderCode)
461
        return false;
462
    }
463
 
464
    boolean this_present_amazonOrderItemCode = true;
465
    boolean that_present_amazonOrderItemCode = true;
466
    if (this_present_amazonOrderItemCode || that_present_amazonOrderItemCode) {
467
      if (!(this_present_amazonOrderItemCode && that_present_amazonOrderItemCode))
468
        return false;
469
      if (this.amazonOrderItemCode != that.amazonOrderItemCode)
470
        return false;
471
    }
472
 
473
    boolean this_present_transactionId = true;
474
    boolean that_present_transactionId = true;
475
    if (this_present_transactionId || that_present_transactionId) {
476
      if (!(this_present_transactionId && that_present_transactionId))
477
        return false;
478
      if (this.transactionId != that.transactionId)
479
        return false;
480
    }
481
 
482
    boolean this_present_item_id = true;
483
    boolean that_present_item_id = true;
484
    if (this_present_item_id || that_present_item_id) {
485
      if (!(this_present_item_id && that_present_item_id))
486
        return false;
487
      if (this.item_id != that.item_id)
488
        return false;
489
    }
490
 
491
    boolean this_present_status = true && this.isSetStatus();
492
    boolean that_present_status = true && that.isSetStatus();
493
    if (this_present_status || that_present_status) {
494
      if (!(this_present_status && that_present_status))
495
        return false;
496
      if (!this.status.equals(that.status))
497
        return false;
498
    }
499
 
500
    return true;
501
  }
502
 
503
  @Override
504
  public int hashCode() {
505
    return 0;
506
  }
507
 
508
  public int compareTo(AmazonOrder other) {
509
    if (!getClass().equals(other.getClass())) {
510
      return getClass().getName().compareTo(other.getClass().getName());
511
    }
512
 
513
    int lastComparison = 0;
514
    AmazonOrder typedOther = (AmazonOrder)other;
515
 
516
    lastComparison = Boolean.valueOf(isSetOrderId()).compareTo(typedOther.isSetOrderId());
517
    if (lastComparison != 0) {
518
      return lastComparison;
519
    }
520
    if (isSetOrderId()) {
521
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.orderId, typedOther.orderId);
522
      if (lastComparison != 0) {
523
        return lastComparison;
524
      }
525
    }
526
    lastComparison = Boolean.valueOf(isSetAmazonOrderCode()).compareTo(typedOther.isSetAmazonOrderCode());
527
    if (lastComparison != 0) {
528
      return lastComparison;
529
    }
530
    if (isSetAmazonOrderCode()) {
531
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amazonOrderCode, typedOther.amazonOrderCode);
532
      if (lastComparison != 0) {
533
        return lastComparison;
534
      }
535
    }
536
    lastComparison = Boolean.valueOf(isSetAmazonOrderItemCode()).compareTo(typedOther.isSetAmazonOrderItemCode());
537
    if (lastComparison != 0) {
538
      return lastComparison;
539
    }
540
    if (isSetAmazonOrderItemCode()) {
541
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amazonOrderItemCode, typedOther.amazonOrderItemCode);
542
      if (lastComparison != 0) {
543
        return lastComparison;
544
      }
545
    }
546
    lastComparison = Boolean.valueOf(isSetTransactionId()).compareTo(typedOther.isSetTransactionId());
547
    if (lastComparison != 0) {
548
      return lastComparison;
549
    }
550
    if (isSetTransactionId()) {
551
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transactionId, typedOther.transactionId);
552
      if (lastComparison != 0) {
553
        return lastComparison;
554
      }
555
    }
556
    lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(typedOther.isSetItem_id());
557
    if (lastComparison != 0) {
558
      return lastComparison;
559
    }
560
    if (isSetItem_id()) {
561
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.item_id, typedOther.item_id);
562
      if (lastComparison != 0) {
563
        return lastComparison;
564
      }
565
    }
566
    lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus());
567
    if (lastComparison != 0) {
568
      return lastComparison;
569
    }
570
    if (isSetStatus()) {
571
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status);
572
      if (lastComparison != 0) {
573
        return lastComparison;
574
      }
575
    }
576
    return 0;
577
  }
578
 
579
  public _Fields fieldForId(int fieldId) {
580
    return _Fields.findByThriftId(fieldId);
581
  }
582
 
583
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
584
    org.apache.thrift.protocol.TField field;
585
    iprot.readStructBegin();
586
    while (true)
587
    {
588
      field = iprot.readFieldBegin();
589
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
590
        break;
591
      }
592
      switch (field.id) {
593
        case 1: // ORDER_ID
594
          if (field.type == org.apache.thrift.protocol.TType.I64) {
595
            this.orderId = iprot.readI64();
596
            setOrderIdIsSet(true);
597
          } else { 
598
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
599
          }
600
          break;
601
        case 2: // AMAZON_ORDER_CODE
602
          if (field.type == org.apache.thrift.protocol.TType.I64) {
603
            this.amazonOrderCode = iprot.readI64();
604
            setAmazonOrderCodeIsSet(true);
605
          } else { 
606
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
607
          }
608
          break;
609
        case 3: // AMAZON_ORDER_ITEM_CODE
610
          if (field.type == org.apache.thrift.protocol.TType.I64) {
611
            this.amazonOrderItemCode = iprot.readI64();
612
            setAmazonOrderItemCodeIsSet(true);
613
          } else { 
614
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
615
          }
616
          break;
617
        case 4: // TRANSACTION_ID
618
          if (field.type == org.apache.thrift.protocol.TType.I64) {
619
            this.transactionId = iprot.readI64();
620
            setTransactionIdIsSet(true);
621
          } else { 
622
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
623
          }
624
          break;
625
        case 5: // ITEM_ID
626
          if (field.type == org.apache.thrift.protocol.TType.I64) {
627
            this.item_id = iprot.readI64();
628
            setItem_idIsSet(true);
629
          } else { 
630
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
631
          }
632
          break;
633
        case 6: // STATUS
634
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
635
            this.status = iprot.readString();
636
          } else { 
637
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
638
          }
639
          break;
640
        default:
641
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
642
      }
643
      iprot.readFieldEnd();
644
    }
645
    iprot.readStructEnd();
646
    validate();
647
  }
648
 
649
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
650
    validate();
651
 
652
    oprot.writeStructBegin(STRUCT_DESC);
653
    oprot.writeFieldBegin(ORDER_ID_FIELD_DESC);
654
    oprot.writeI64(this.orderId);
655
    oprot.writeFieldEnd();
656
    oprot.writeFieldBegin(AMAZON_ORDER_CODE_FIELD_DESC);
657
    oprot.writeI64(this.amazonOrderCode);
658
    oprot.writeFieldEnd();
659
    oprot.writeFieldBegin(AMAZON_ORDER_ITEM_CODE_FIELD_DESC);
660
    oprot.writeI64(this.amazonOrderItemCode);
661
    oprot.writeFieldEnd();
662
    oprot.writeFieldBegin(TRANSACTION_ID_FIELD_DESC);
663
    oprot.writeI64(this.transactionId);
664
    oprot.writeFieldEnd();
665
    oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
666
    oprot.writeI64(this.item_id);
667
    oprot.writeFieldEnd();
668
    if (this.status != null) {
669
      oprot.writeFieldBegin(STATUS_FIELD_DESC);
670
      oprot.writeString(this.status);
671
      oprot.writeFieldEnd();
672
    }
673
    oprot.writeFieldStop();
674
    oprot.writeStructEnd();
675
  }
676
 
677
  @Override
678
  public String toString() {
679
    StringBuilder sb = new StringBuilder("AmazonOrder(");
680
    boolean first = true;
681
 
682
    sb.append("orderId:");
683
    sb.append(this.orderId);
684
    first = false;
685
    if (!first) sb.append(", ");
686
    sb.append("amazonOrderCode:");
687
    sb.append(this.amazonOrderCode);
688
    first = false;
689
    if (!first) sb.append(", ");
690
    sb.append("amazonOrderItemCode:");
691
    sb.append(this.amazonOrderItemCode);
692
    first = false;
693
    if (!first) sb.append(", ");
694
    sb.append("transactionId:");
695
    sb.append(this.transactionId);
696
    first = false;
697
    if (!first) sb.append(", ");
698
    sb.append("item_id:");
699
    sb.append(this.item_id);
700
    first = false;
701
    if (!first) sb.append(", ");
702
    sb.append("status:");
703
    if (this.status == null) {
704
      sb.append("null");
705
    } else {
706
      sb.append(this.status);
707
    }
708
    first = false;
709
    sb.append(")");
710
    return sb.toString();
711
  }
712
 
713
  public void validate() throws org.apache.thrift.TException {
714
    // check for required fields
715
  }
716
 
717
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
718
    try {
719
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
720
    } catch (org.apache.thrift.TException te) {
721
      throw new java.io.IOException(te);
722
    }
723
  }
724
 
725
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
726
    try {
727
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
728
      __isset_bit_vector = new BitSet(1);
729
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
730
    } catch (org.apache.thrift.TException te) {
731
      throw new java.io.IOException(te);
732
    }
733
  }
734
 
735
}
736