Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
8182 amar.kumar 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.catalog;
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 EbayItem implements org.apache.thrift.TBase<EbayItem, EbayItem._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("EbayItem");
25
 
26
  private static final org.apache.thrift.protocol.TField EBAY_LISTING_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("ebayListingId", org.apache.thrift.protocol.TType.STRING, (short)1);
27
  private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("itemId", org.apache.thrift.protocol.TType.I64, (short)2);
28
  private static final org.apache.thrift.protocol.TField LISTING_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("listingName", org.apache.thrift.protocol.TType.STRING, (short)3);
29
  private static final org.apache.thrift.protocol.TField LISTING_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("listingPrice", org.apache.thrift.protocol.TType.I64, (short)4);
30
  private static final org.apache.thrift.protocol.TField LISTING_EXPIRY_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("listingExpiryDate", org.apache.thrift.protocol.TType.I64, (short)5);
31
  private static final org.apache.thrift.protocol.TField SUBSIDY_FIELD_DESC = new org.apache.thrift.protocol.TField("subsidy", org.apache.thrift.protocol.TType.DOUBLE, (short)6);
32
  private static final org.apache.thrift.protocol.TField DEFAULT_WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("defaultWarehouseId", org.apache.thrift.protocol.TType.I64, (short)7);
33
 
34
  private String ebayListingId; // required
35
  private long itemId; // required
36
  private String listingName; // required
37
  private long listingPrice; // required
38
  private long listingExpiryDate; // required
39
  private double subsidy; // required
40
  private long defaultWarehouseId; // required
41
 
42
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
43
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
44
    EBAY_LISTING_ID((short)1, "ebayListingId"),
45
    ITEM_ID((short)2, "itemId"),
46
    LISTING_NAME((short)3, "listingName"),
47
    LISTING_PRICE((short)4, "listingPrice"),
48
    LISTING_EXPIRY_DATE((short)5, "listingExpiryDate"),
49
    SUBSIDY((short)6, "subsidy"),
50
    DEFAULT_WAREHOUSE_ID((short)7, "defaultWarehouseId");
51
 
52
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
53
 
54
    static {
55
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
56
        byName.put(field.getFieldName(), field);
57
      }
58
    }
59
 
60
    /**
61
     * Find the _Fields constant that matches fieldId, or null if its not found.
62
     */
63
    public static _Fields findByThriftId(int fieldId) {
64
      switch(fieldId) {
65
        case 1: // EBAY_LISTING_ID
66
          return EBAY_LISTING_ID;
67
        case 2: // ITEM_ID
68
          return ITEM_ID;
69
        case 3: // LISTING_NAME
70
          return LISTING_NAME;
71
        case 4: // LISTING_PRICE
72
          return LISTING_PRICE;
73
        case 5: // LISTING_EXPIRY_DATE
74
          return LISTING_EXPIRY_DATE;
75
        case 6: // SUBSIDY
76
          return SUBSIDY;
77
        case 7: // DEFAULT_WAREHOUSE_ID
78
          return DEFAULT_WAREHOUSE_ID;
79
        default:
80
          return null;
81
      }
82
    }
83
 
84
    /**
85
     * Find the _Fields constant that matches fieldId, throwing an exception
86
     * if it is not found.
87
     */
88
    public static _Fields findByThriftIdOrThrow(int fieldId) {
89
      _Fields fields = findByThriftId(fieldId);
90
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
91
      return fields;
92
    }
93
 
94
    /**
95
     * Find the _Fields constant that matches name, or null if its not found.
96
     */
97
    public static _Fields findByName(String name) {
98
      return byName.get(name);
99
    }
100
 
101
    private final short _thriftId;
102
    private final String _fieldName;
103
 
104
    _Fields(short thriftId, String fieldName) {
105
      _thriftId = thriftId;
106
      _fieldName = fieldName;
107
    }
108
 
109
    public short getThriftFieldId() {
110
      return _thriftId;
111
    }
112
 
113
    public String getFieldName() {
114
      return _fieldName;
115
    }
116
  }
117
 
118
  // isset id assignments
119
  private static final int __ITEMID_ISSET_ID = 0;
120
  private static final int __LISTINGPRICE_ISSET_ID = 1;
121
  private static final int __LISTINGEXPIRYDATE_ISSET_ID = 2;
122
  private static final int __SUBSIDY_ISSET_ID = 3;
123
  private static final int __DEFAULTWAREHOUSEID_ISSET_ID = 4;
124
  private BitSet __isset_bit_vector = new BitSet(5);
125
 
126
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
127
  static {
128
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
129
    tmpMap.put(_Fields.EBAY_LISTING_ID, new org.apache.thrift.meta_data.FieldMetaData("ebayListingId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
130
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
131
    tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("itemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
132
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
133
    tmpMap.put(_Fields.LISTING_NAME, new org.apache.thrift.meta_data.FieldMetaData("listingName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
134
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
135
    tmpMap.put(_Fields.LISTING_PRICE, new org.apache.thrift.meta_data.FieldMetaData("listingPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
136
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
137
    tmpMap.put(_Fields.LISTING_EXPIRY_DATE, new org.apache.thrift.meta_data.FieldMetaData("listingExpiryDate", org.apache.thrift.TFieldRequirementType.DEFAULT, 
138
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
139
    tmpMap.put(_Fields.SUBSIDY, new org.apache.thrift.meta_data.FieldMetaData("subsidy", org.apache.thrift.TFieldRequirementType.DEFAULT, 
140
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
141
    tmpMap.put(_Fields.DEFAULT_WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("defaultWarehouseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
142
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
143
    metaDataMap = Collections.unmodifiableMap(tmpMap);
144
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(EbayItem.class, metaDataMap);
145
  }
146
 
147
  public EbayItem() {
148
  }
149
 
150
  public EbayItem(
151
    String ebayListingId,
152
    long itemId,
153
    String listingName,
154
    long listingPrice,
155
    long listingExpiryDate,
156
    double subsidy,
157
    long defaultWarehouseId)
158
  {
159
    this();
160
    this.ebayListingId = ebayListingId;
161
    this.itemId = itemId;
162
    setItemIdIsSet(true);
163
    this.listingName = listingName;
164
    this.listingPrice = listingPrice;
165
    setListingPriceIsSet(true);
166
    this.listingExpiryDate = listingExpiryDate;
167
    setListingExpiryDateIsSet(true);
168
    this.subsidy = subsidy;
169
    setSubsidyIsSet(true);
170
    this.defaultWarehouseId = defaultWarehouseId;
171
    setDefaultWarehouseIdIsSet(true);
172
  }
173
 
174
  /**
175
   * Performs a deep copy on <i>other</i>.
176
   */
177
  public EbayItem(EbayItem other) {
178
    __isset_bit_vector.clear();
179
    __isset_bit_vector.or(other.__isset_bit_vector);
180
    if (other.isSetEbayListingId()) {
181
      this.ebayListingId = other.ebayListingId;
182
    }
183
    this.itemId = other.itemId;
184
    if (other.isSetListingName()) {
185
      this.listingName = other.listingName;
186
    }
187
    this.listingPrice = other.listingPrice;
188
    this.listingExpiryDate = other.listingExpiryDate;
189
    this.subsidy = other.subsidy;
190
    this.defaultWarehouseId = other.defaultWarehouseId;
191
  }
192
 
193
  public EbayItem deepCopy() {
194
    return new EbayItem(this);
195
  }
196
 
197
  @Override
198
  public void clear() {
199
    this.ebayListingId = null;
200
    setItemIdIsSet(false);
201
    this.itemId = 0;
202
    this.listingName = null;
203
    setListingPriceIsSet(false);
204
    this.listingPrice = 0;
205
    setListingExpiryDateIsSet(false);
206
    this.listingExpiryDate = 0;
207
    setSubsidyIsSet(false);
208
    this.subsidy = 0.0;
209
    setDefaultWarehouseIdIsSet(false);
210
    this.defaultWarehouseId = 0;
211
  }
212
 
213
  public String getEbayListingId() {
214
    return this.ebayListingId;
215
  }
216
 
217
  public void setEbayListingId(String ebayListingId) {
218
    this.ebayListingId = ebayListingId;
219
  }
220
 
221
  public void unsetEbayListingId() {
222
    this.ebayListingId = null;
223
  }
224
 
225
  /** Returns true if field ebayListingId is set (has been assigned a value) and false otherwise */
226
  public boolean isSetEbayListingId() {
227
    return this.ebayListingId != null;
228
  }
229
 
230
  public void setEbayListingIdIsSet(boolean value) {
231
    if (!value) {
232
      this.ebayListingId = null;
233
    }
234
  }
235
 
236
  public long getItemId() {
237
    return this.itemId;
238
  }
239
 
240
  public void setItemId(long itemId) {
241
    this.itemId = itemId;
242
    setItemIdIsSet(true);
243
  }
244
 
245
  public void unsetItemId() {
246
    __isset_bit_vector.clear(__ITEMID_ISSET_ID);
247
  }
248
 
249
  /** Returns true if field itemId is set (has been assigned a value) and false otherwise */
250
  public boolean isSetItemId() {
251
    return __isset_bit_vector.get(__ITEMID_ISSET_ID);
252
  }
253
 
254
  public void setItemIdIsSet(boolean value) {
255
    __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
256
  }
257
 
258
  public String getListingName() {
259
    return this.listingName;
260
  }
261
 
262
  public void setListingName(String listingName) {
263
    this.listingName = listingName;
264
  }
265
 
266
  public void unsetListingName() {
267
    this.listingName = null;
268
  }
269
 
270
  /** Returns true if field listingName is set (has been assigned a value) and false otherwise */
271
  public boolean isSetListingName() {
272
    return this.listingName != null;
273
  }
274
 
275
  public void setListingNameIsSet(boolean value) {
276
    if (!value) {
277
      this.listingName = null;
278
    }
279
  }
280
 
281
  public long getListingPrice() {
282
    return this.listingPrice;
283
  }
284
 
285
  public void setListingPrice(long listingPrice) {
286
    this.listingPrice = listingPrice;
287
    setListingPriceIsSet(true);
288
  }
289
 
290
  public void unsetListingPrice() {
291
    __isset_bit_vector.clear(__LISTINGPRICE_ISSET_ID);
292
  }
293
 
294
  /** Returns true if field listingPrice is set (has been assigned a value) and false otherwise */
295
  public boolean isSetListingPrice() {
296
    return __isset_bit_vector.get(__LISTINGPRICE_ISSET_ID);
297
  }
298
 
299
  public void setListingPriceIsSet(boolean value) {
300
    __isset_bit_vector.set(__LISTINGPRICE_ISSET_ID, value);
301
  }
302
 
303
  public long getListingExpiryDate() {
304
    return this.listingExpiryDate;
305
  }
306
 
307
  public void setListingExpiryDate(long listingExpiryDate) {
308
    this.listingExpiryDate = listingExpiryDate;
309
    setListingExpiryDateIsSet(true);
310
  }
311
 
312
  public void unsetListingExpiryDate() {
313
    __isset_bit_vector.clear(__LISTINGEXPIRYDATE_ISSET_ID);
314
  }
315
 
316
  /** Returns true if field listingExpiryDate is set (has been assigned a value) and false otherwise */
317
  public boolean isSetListingExpiryDate() {
318
    return __isset_bit_vector.get(__LISTINGEXPIRYDATE_ISSET_ID);
319
  }
320
 
321
  public void setListingExpiryDateIsSet(boolean value) {
322
    __isset_bit_vector.set(__LISTINGEXPIRYDATE_ISSET_ID, value);
323
  }
324
 
325
  public double getSubsidy() {
326
    return this.subsidy;
327
  }
328
 
329
  public void setSubsidy(double subsidy) {
330
    this.subsidy = subsidy;
331
    setSubsidyIsSet(true);
332
  }
333
 
334
  public void unsetSubsidy() {
335
    __isset_bit_vector.clear(__SUBSIDY_ISSET_ID);
336
  }
337
 
338
  /** Returns true if field subsidy is set (has been assigned a value) and false otherwise */
339
  public boolean isSetSubsidy() {
340
    return __isset_bit_vector.get(__SUBSIDY_ISSET_ID);
341
  }
342
 
343
  public void setSubsidyIsSet(boolean value) {
344
    __isset_bit_vector.set(__SUBSIDY_ISSET_ID, value);
345
  }
346
 
347
  public long getDefaultWarehouseId() {
348
    return this.defaultWarehouseId;
349
  }
350
 
351
  public void setDefaultWarehouseId(long defaultWarehouseId) {
352
    this.defaultWarehouseId = defaultWarehouseId;
353
    setDefaultWarehouseIdIsSet(true);
354
  }
355
 
356
  public void unsetDefaultWarehouseId() {
357
    __isset_bit_vector.clear(__DEFAULTWAREHOUSEID_ISSET_ID);
358
  }
359
 
360
  /** Returns true if field defaultWarehouseId is set (has been assigned a value) and false otherwise */
361
  public boolean isSetDefaultWarehouseId() {
362
    return __isset_bit_vector.get(__DEFAULTWAREHOUSEID_ISSET_ID);
363
  }
364
 
365
  public void setDefaultWarehouseIdIsSet(boolean value) {
366
    __isset_bit_vector.set(__DEFAULTWAREHOUSEID_ISSET_ID, value);
367
  }
368
 
369
  public void setFieldValue(_Fields field, Object value) {
370
    switch (field) {
371
    case EBAY_LISTING_ID:
372
      if (value == null) {
373
        unsetEbayListingId();
374
      } else {
375
        setEbayListingId((String)value);
376
      }
377
      break;
378
 
379
    case ITEM_ID:
380
      if (value == null) {
381
        unsetItemId();
382
      } else {
383
        setItemId((Long)value);
384
      }
385
      break;
386
 
387
    case LISTING_NAME:
388
      if (value == null) {
389
        unsetListingName();
390
      } else {
391
        setListingName((String)value);
392
      }
393
      break;
394
 
395
    case LISTING_PRICE:
396
      if (value == null) {
397
        unsetListingPrice();
398
      } else {
399
        setListingPrice((Long)value);
400
      }
401
      break;
402
 
403
    case LISTING_EXPIRY_DATE:
404
      if (value == null) {
405
        unsetListingExpiryDate();
406
      } else {
407
        setListingExpiryDate((Long)value);
408
      }
409
      break;
410
 
411
    case SUBSIDY:
412
      if (value == null) {
413
        unsetSubsidy();
414
      } else {
415
        setSubsidy((Double)value);
416
      }
417
      break;
418
 
419
    case DEFAULT_WAREHOUSE_ID:
420
      if (value == null) {
421
        unsetDefaultWarehouseId();
422
      } else {
423
        setDefaultWarehouseId((Long)value);
424
      }
425
      break;
426
 
427
    }
428
  }
429
 
430
  public Object getFieldValue(_Fields field) {
431
    switch (field) {
432
    case EBAY_LISTING_ID:
433
      return getEbayListingId();
434
 
435
    case ITEM_ID:
436
      return Long.valueOf(getItemId());
437
 
438
    case LISTING_NAME:
439
      return getListingName();
440
 
441
    case LISTING_PRICE:
442
      return Long.valueOf(getListingPrice());
443
 
444
    case LISTING_EXPIRY_DATE:
445
      return Long.valueOf(getListingExpiryDate());
446
 
447
    case SUBSIDY:
448
      return Double.valueOf(getSubsidy());
449
 
450
    case DEFAULT_WAREHOUSE_ID:
451
      return Long.valueOf(getDefaultWarehouseId());
452
 
453
    }
454
    throw new IllegalStateException();
455
  }
456
 
457
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
458
  public boolean isSet(_Fields field) {
459
    if (field == null) {
460
      throw new IllegalArgumentException();
461
    }
462
 
463
    switch (field) {
464
    case EBAY_LISTING_ID:
465
      return isSetEbayListingId();
466
    case ITEM_ID:
467
      return isSetItemId();
468
    case LISTING_NAME:
469
      return isSetListingName();
470
    case LISTING_PRICE:
471
      return isSetListingPrice();
472
    case LISTING_EXPIRY_DATE:
473
      return isSetListingExpiryDate();
474
    case SUBSIDY:
475
      return isSetSubsidy();
476
    case DEFAULT_WAREHOUSE_ID:
477
      return isSetDefaultWarehouseId();
478
    }
479
    throw new IllegalStateException();
480
  }
481
 
482
  @Override
483
  public boolean equals(Object that) {
484
    if (that == null)
485
      return false;
486
    if (that instanceof EbayItem)
487
      return this.equals((EbayItem)that);
488
    return false;
489
  }
490
 
491
  public boolean equals(EbayItem that) {
492
    if (that == null)
493
      return false;
494
 
495
    boolean this_present_ebayListingId = true && this.isSetEbayListingId();
496
    boolean that_present_ebayListingId = true && that.isSetEbayListingId();
497
    if (this_present_ebayListingId || that_present_ebayListingId) {
498
      if (!(this_present_ebayListingId && that_present_ebayListingId))
499
        return false;
500
      if (!this.ebayListingId.equals(that.ebayListingId))
501
        return false;
502
    }
503
 
504
    boolean this_present_itemId = true;
505
    boolean that_present_itemId = true;
506
    if (this_present_itemId || that_present_itemId) {
507
      if (!(this_present_itemId && that_present_itemId))
508
        return false;
509
      if (this.itemId != that.itemId)
510
        return false;
511
    }
512
 
513
    boolean this_present_listingName = true && this.isSetListingName();
514
    boolean that_present_listingName = true && that.isSetListingName();
515
    if (this_present_listingName || that_present_listingName) {
516
      if (!(this_present_listingName && that_present_listingName))
517
        return false;
518
      if (!this.listingName.equals(that.listingName))
519
        return false;
520
    }
521
 
522
    boolean this_present_listingPrice = true;
523
    boolean that_present_listingPrice = true;
524
    if (this_present_listingPrice || that_present_listingPrice) {
525
      if (!(this_present_listingPrice && that_present_listingPrice))
526
        return false;
527
      if (this.listingPrice != that.listingPrice)
528
        return false;
529
    }
530
 
531
    boolean this_present_listingExpiryDate = true;
532
    boolean that_present_listingExpiryDate = true;
533
    if (this_present_listingExpiryDate || that_present_listingExpiryDate) {
534
      if (!(this_present_listingExpiryDate && that_present_listingExpiryDate))
535
        return false;
536
      if (this.listingExpiryDate != that.listingExpiryDate)
537
        return false;
538
    }
539
 
540
    boolean this_present_subsidy = true;
541
    boolean that_present_subsidy = true;
542
    if (this_present_subsidy || that_present_subsidy) {
543
      if (!(this_present_subsidy && that_present_subsidy))
544
        return false;
545
      if (this.subsidy != that.subsidy)
546
        return false;
547
    }
548
 
549
    boolean this_present_defaultWarehouseId = true;
550
    boolean that_present_defaultWarehouseId = true;
551
    if (this_present_defaultWarehouseId || that_present_defaultWarehouseId) {
552
      if (!(this_present_defaultWarehouseId && that_present_defaultWarehouseId))
553
        return false;
554
      if (this.defaultWarehouseId != that.defaultWarehouseId)
555
        return false;
556
    }
557
 
558
    return true;
559
  }
560
 
561
  @Override
562
  public int hashCode() {
563
    return 0;
564
  }
565
 
566
  public int compareTo(EbayItem other) {
567
    if (!getClass().equals(other.getClass())) {
568
      return getClass().getName().compareTo(other.getClass().getName());
569
    }
570
 
571
    int lastComparison = 0;
572
    EbayItem typedOther = (EbayItem)other;
573
 
574
    lastComparison = Boolean.valueOf(isSetEbayListingId()).compareTo(typedOther.isSetEbayListingId());
575
    if (lastComparison != 0) {
576
      return lastComparison;
577
    }
578
    if (isSetEbayListingId()) {
579
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ebayListingId, typedOther.ebayListingId);
580
      if (lastComparison != 0) {
581
        return lastComparison;
582
      }
583
    }
584
    lastComparison = Boolean.valueOf(isSetItemId()).compareTo(typedOther.isSetItemId());
585
    if (lastComparison != 0) {
586
      return lastComparison;
587
    }
588
    if (isSetItemId()) {
589
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemId, typedOther.itemId);
590
      if (lastComparison != 0) {
591
        return lastComparison;
592
      }
593
    }
594
    lastComparison = Boolean.valueOf(isSetListingName()).compareTo(typedOther.isSetListingName());
595
    if (lastComparison != 0) {
596
      return lastComparison;
597
    }
598
    if (isSetListingName()) {
599
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.listingName, typedOther.listingName);
600
      if (lastComparison != 0) {
601
        return lastComparison;
602
      }
603
    }
604
    lastComparison = Boolean.valueOf(isSetListingPrice()).compareTo(typedOther.isSetListingPrice());
605
    if (lastComparison != 0) {
606
      return lastComparison;
607
    }
608
    if (isSetListingPrice()) {
609
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.listingPrice, typedOther.listingPrice);
610
      if (lastComparison != 0) {
611
        return lastComparison;
612
      }
613
    }
614
    lastComparison = Boolean.valueOf(isSetListingExpiryDate()).compareTo(typedOther.isSetListingExpiryDate());
615
    if (lastComparison != 0) {
616
      return lastComparison;
617
    }
618
    if (isSetListingExpiryDate()) {
619
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.listingExpiryDate, typedOther.listingExpiryDate);
620
      if (lastComparison != 0) {
621
        return lastComparison;
622
      }
623
    }
624
    lastComparison = Boolean.valueOf(isSetSubsidy()).compareTo(typedOther.isSetSubsidy());
625
    if (lastComparison != 0) {
626
      return lastComparison;
627
    }
628
    if (isSetSubsidy()) {
629
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.subsidy, typedOther.subsidy);
630
      if (lastComparison != 0) {
631
        return lastComparison;
632
      }
633
    }
634
    lastComparison = Boolean.valueOf(isSetDefaultWarehouseId()).compareTo(typedOther.isSetDefaultWarehouseId());
635
    if (lastComparison != 0) {
636
      return lastComparison;
637
    }
638
    if (isSetDefaultWarehouseId()) {
639
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.defaultWarehouseId, typedOther.defaultWarehouseId);
640
      if (lastComparison != 0) {
641
        return lastComparison;
642
      }
643
    }
644
    return 0;
645
  }
646
 
647
  public _Fields fieldForId(int fieldId) {
648
    return _Fields.findByThriftId(fieldId);
649
  }
650
 
651
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
652
    org.apache.thrift.protocol.TField field;
653
    iprot.readStructBegin();
654
    while (true)
655
    {
656
      field = iprot.readFieldBegin();
657
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
658
        break;
659
      }
660
      switch (field.id) {
661
        case 1: // EBAY_LISTING_ID
662
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
663
            this.ebayListingId = iprot.readString();
664
          } else { 
665
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
666
          }
667
          break;
668
        case 2: // ITEM_ID
669
          if (field.type == org.apache.thrift.protocol.TType.I64) {
670
            this.itemId = iprot.readI64();
671
            setItemIdIsSet(true);
672
          } else { 
673
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
674
          }
675
          break;
676
        case 3: // LISTING_NAME
677
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
678
            this.listingName = iprot.readString();
679
          } else { 
680
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
681
          }
682
          break;
683
        case 4: // LISTING_PRICE
684
          if (field.type == org.apache.thrift.protocol.TType.I64) {
685
            this.listingPrice = iprot.readI64();
686
            setListingPriceIsSet(true);
687
          } else { 
688
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
689
          }
690
          break;
691
        case 5: // LISTING_EXPIRY_DATE
692
          if (field.type == org.apache.thrift.protocol.TType.I64) {
693
            this.listingExpiryDate = iprot.readI64();
694
            setListingExpiryDateIsSet(true);
695
          } else { 
696
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
697
          }
698
          break;
699
        case 6: // SUBSIDY
700
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
701
            this.subsidy = iprot.readDouble();
702
            setSubsidyIsSet(true);
703
          } else { 
704
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
705
          }
706
          break;
707
        case 7: // DEFAULT_WAREHOUSE_ID
708
          if (field.type == org.apache.thrift.protocol.TType.I64) {
709
            this.defaultWarehouseId = iprot.readI64();
710
            setDefaultWarehouseIdIsSet(true);
711
          } else { 
712
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
713
          }
714
          break;
715
        default:
716
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
717
      }
718
      iprot.readFieldEnd();
719
    }
720
    iprot.readStructEnd();
721
    validate();
722
  }
723
 
724
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
725
    validate();
726
 
727
    oprot.writeStructBegin(STRUCT_DESC);
728
    if (this.ebayListingId != null) {
729
      oprot.writeFieldBegin(EBAY_LISTING_ID_FIELD_DESC);
730
      oprot.writeString(this.ebayListingId);
731
      oprot.writeFieldEnd();
732
    }
733
    oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
734
    oprot.writeI64(this.itemId);
735
    oprot.writeFieldEnd();
736
    if (this.listingName != null) {
737
      oprot.writeFieldBegin(LISTING_NAME_FIELD_DESC);
738
      oprot.writeString(this.listingName);
739
      oprot.writeFieldEnd();
740
    }
741
    oprot.writeFieldBegin(LISTING_PRICE_FIELD_DESC);
742
    oprot.writeI64(this.listingPrice);
743
    oprot.writeFieldEnd();
744
    oprot.writeFieldBegin(LISTING_EXPIRY_DATE_FIELD_DESC);
745
    oprot.writeI64(this.listingExpiryDate);
746
    oprot.writeFieldEnd();
747
    oprot.writeFieldBegin(SUBSIDY_FIELD_DESC);
748
    oprot.writeDouble(this.subsidy);
749
    oprot.writeFieldEnd();
750
    oprot.writeFieldBegin(DEFAULT_WAREHOUSE_ID_FIELD_DESC);
751
    oprot.writeI64(this.defaultWarehouseId);
752
    oprot.writeFieldEnd();
753
    oprot.writeFieldStop();
754
    oprot.writeStructEnd();
755
  }
756
 
757
  @Override
758
  public String toString() {
759
    StringBuilder sb = new StringBuilder("EbayItem(");
760
    boolean first = true;
761
 
762
    sb.append("ebayListingId:");
763
    if (this.ebayListingId == null) {
764
      sb.append("null");
765
    } else {
766
      sb.append(this.ebayListingId);
767
    }
768
    first = false;
769
    if (!first) sb.append(", ");
770
    sb.append("itemId:");
771
    sb.append(this.itemId);
772
    first = false;
773
    if (!first) sb.append(", ");
774
    sb.append("listingName:");
775
    if (this.listingName == null) {
776
      sb.append("null");
777
    } else {
778
      sb.append(this.listingName);
779
    }
780
    first = false;
781
    if (!first) sb.append(", ");
782
    sb.append("listingPrice:");
783
    sb.append(this.listingPrice);
784
    first = false;
785
    if (!first) sb.append(", ");
786
    sb.append("listingExpiryDate:");
787
    sb.append(this.listingExpiryDate);
788
    first = false;
789
    if (!first) sb.append(", ");
790
    sb.append("subsidy:");
791
    sb.append(this.subsidy);
792
    first = false;
793
    if (!first) sb.append(", ");
794
    sb.append("defaultWarehouseId:");
795
    sb.append(this.defaultWarehouseId);
796
    first = false;
797
    sb.append(")");
798
    return sb.toString();
799
  }
800
 
801
  public void validate() throws org.apache.thrift.TException {
802
    // check for required fields
803
  }
804
 
805
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
806
    try {
807
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
808
    } catch (org.apache.thrift.TException te) {
809
      throw new java.io.IOException(te);
810
    }
811
  }
812
 
813
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
814
    try {
815
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
816
      __isset_bit_vector = new BitSet(1);
817
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
818
    } catch (org.apache.thrift.TException te) {
819
      throw new java.io.IOException(te);
820
    }
821
  }
822
 
823
}
824