Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
11905 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.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 PdPriceComp implements org.apache.thrift.TBase<PdPriceComp, PdPriceComp._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("PdPriceComp");
25
 
26
  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)1);
27
  private static final org.apache.thrift.protocol.TField DEAL_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("dealPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)2);
28
  private static final org.apache.thrift.protocol.TField SAHOLIC_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("saholicPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)3);
29
  private static final org.apache.thrift.protocol.TField SD_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("sdPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)4);
30
  private static final org.apache.thrift.protocol.TField FK_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("fkPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)5);
31
  private static final org.apache.thrift.protocol.TField AMAZON_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("amazonPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)6);
32
  private static final org.apache.thrift.protocol.TField PRODUCT_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("productName", org.apache.thrift.protocol.TType.STRING, (short)7);
33
 
34
  private long item_id; // required
35
  private double dealPrice; // required
36
  private double saholicPrice; // required
37
  private double sdPrice; // required
38
  private double fkPrice; // required
39
  private double amazonPrice; // required
40
  private String productName; // 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
    ITEM_ID((short)1, "item_id"),
45
    DEAL_PRICE((short)2, "dealPrice"),
46
    SAHOLIC_PRICE((short)3, "saholicPrice"),
47
    SD_PRICE((short)4, "sdPrice"),
48
    FK_PRICE((short)5, "fkPrice"),
49
    AMAZON_PRICE((short)6, "amazonPrice"),
50
    PRODUCT_NAME((short)7, "productName");
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: // ITEM_ID
66
          return ITEM_ID;
67
        case 2: // DEAL_PRICE
68
          return DEAL_PRICE;
69
        case 3: // SAHOLIC_PRICE
70
          return SAHOLIC_PRICE;
71
        case 4: // SD_PRICE
72
          return SD_PRICE;
73
        case 5: // FK_PRICE
74
          return FK_PRICE;
75
        case 6: // AMAZON_PRICE
76
          return AMAZON_PRICE;
77
        case 7: // PRODUCT_NAME
78
          return PRODUCT_NAME;
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 __ITEM_ID_ISSET_ID = 0;
120
  private static final int __DEALPRICE_ISSET_ID = 1;
121
  private static final int __SAHOLICPRICE_ISSET_ID = 2;
122
  private static final int __SDPRICE_ISSET_ID = 3;
123
  private static final int __FKPRICE_ISSET_ID = 4;
124
  private static final int __AMAZONPRICE_ISSET_ID = 5;
125
  private BitSet __isset_bit_vector = new BitSet(6);
126
 
127
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
128
  static {
129
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
130
    tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("item_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
131
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
132
    tmpMap.put(_Fields.DEAL_PRICE, new org.apache.thrift.meta_data.FieldMetaData("dealPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
133
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
134
    tmpMap.put(_Fields.SAHOLIC_PRICE, new org.apache.thrift.meta_data.FieldMetaData("saholicPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
135
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
136
    tmpMap.put(_Fields.SD_PRICE, new org.apache.thrift.meta_data.FieldMetaData("sdPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
137
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
138
    tmpMap.put(_Fields.FK_PRICE, new org.apache.thrift.meta_data.FieldMetaData("fkPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
139
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
140
    tmpMap.put(_Fields.AMAZON_PRICE, new org.apache.thrift.meta_data.FieldMetaData("amazonPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
141
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
142
    tmpMap.put(_Fields.PRODUCT_NAME, new org.apache.thrift.meta_data.FieldMetaData("productName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
143
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
144
    metaDataMap = Collections.unmodifiableMap(tmpMap);
145
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PdPriceComp.class, metaDataMap);
146
  }
147
 
148
  public PdPriceComp() {
149
  }
150
 
151
  public PdPriceComp(
152
    long item_id,
153
    double dealPrice,
154
    double saholicPrice,
155
    double sdPrice,
156
    double fkPrice,
157
    double amazonPrice,
158
    String productName)
159
  {
160
    this();
161
    this.item_id = item_id;
162
    setItem_idIsSet(true);
163
    this.dealPrice = dealPrice;
164
    setDealPriceIsSet(true);
165
    this.saholicPrice = saholicPrice;
166
    setSaholicPriceIsSet(true);
167
    this.sdPrice = sdPrice;
168
    setSdPriceIsSet(true);
169
    this.fkPrice = fkPrice;
170
    setFkPriceIsSet(true);
171
    this.amazonPrice = amazonPrice;
172
    setAmazonPriceIsSet(true);
173
    this.productName = productName;
174
  }
175
 
176
  /**
177
   * Performs a deep copy on <i>other</i>.
178
   */
179
  public PdPriceComp(PdPriceComp other) {
180
    __isset_bit_vector.clear();
181
    __isset_bit_vector.or(other.__isset_bit_vector);
182
    this.item_id = other.item_id;
183
    this.dealPrice = other.dealPrice;
184
    this.saholicPrice = other.saholicPrice;
185
    this.sdPrice = other.sdPrice;
186
    this.fkPrice = other.fkPrice;
187
    this.amazonPrice = other.amazonPrice;
188
    if (other.isSetProductName()) {
189
      this.productName = other.productName;
190
    }
191
  }
192
 
193
  public PdPriceComp deepCopy() {
194
    return new PdPriceComp(this);
195
  }
196
 
197
  @Override
198
  public void clear() {
199
    setItem_idIsSet(false);
200
    this.item_id = 0;
201
    setDealPriceIsSet(false);
202
    this.dealPrice = 0.0;
203
    setSaholicPriceIsSet(false);
204
    this.saholicPrice = 0.0;
205
    setSdPriceIsSet(false);
206
    this.sdPrice = 0.0;
207
    setFkPriceIsSet(false);
208
    this.fkPrice = 0.0;
209
    setAmazonPriceIsSet(false);
210
    this.amazonPrice = 0.0;
211
    this.productName = null;
212
  }
213
 
214
  public long getItem_id() {
215
    return this.item_id;
216
  }
217
 
218
  public void setItem_id(long item_id) {
219
    this.item_id = item_id;
220
    setItem_idIsSet(true);
221
  }
222
 
223
  public void unsetItem_id() {
224
    __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
225
  }
226
 
227
  /** Returns true if field item_id is set (has been assigned a value) and false otherwise */
228
  public boolean isSetItem_id() {
229
    return __isset_bit_vector.get(__ITEM_ID_ISSET_ID);
230
  }
231
 
232
  public void setItem_idIsSet(boolean value) {
233
    __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
234
  }
235
 
236
  public double getDealPrice() {
237
    return this.dealPrice;
238
  }
239
 
240
  public void setDealPrice(double dealPrice) {
241
    this.dealPrice = dealPrice;
242
    setDealPriceIsSet(true);
243
  }
244
 
245
  public void unsetDealPrice() {
246
    __isset_bit_vector.clear(__DEALPRICE_ISSET_ID);
247
  }
248
 
249
  /** Returns true if field dealPrice is set (has been assigned a value) and false otherwise */
250
  public boolean isSetDealPrice() {
251
    return __isset_bit_vector.get(__DEALPRICE_ISSET_ID);
252
  }
253
 
254
  public void setDealPriceIsSet(boolean value) {
255
    __isset_bit_vector.set(__DEALPRICE_ISSET_ID, value);
256
  }
257
 
258
  public double getSaholicPrice() {
259
    return this.saholicPrice;
260
  }
261
 
262
  public void setSaholicPrice(double saholicPrice) {
263
    this.saholicPrice = saholicPrice;
264
    setSaholicPriceIsSet(true);
265
  }
266
 
267
  public void unsetSaholicPrice() {
268
    __isset_bit_vector.clear(__SAHOLICPRICE_ISSET_ID);
269
  }
270
 
271
  /** Returns true if field saholicPrice is set (has been assigned a value) and false otherwise */
272
  public boolean isSetSaholicPrice() {
273
    return __isset_bit_vector.get(__SAHOLICPRICE_ISSET_ID);
274
  }
275
 
276
  public void setSaholicPriceIsSet(boolean value) {
277
    __isset_bit_vector.set(__SAHOLICPRICE_ISSET_ID, value);
278
  }
279
 
280
  public double getSdPrice() {
281
    return this.sdPrice;
282
  }
283
 
284
  public void setSdPrice(double sdPrice) {
285
    this.sdPrice = sdPrice;
286
    setSdPriceIsSet(true);
287
  }
288
 
289
  public void unsetSdPrice() {
290
    __isset_bit_vector.clear(__SDPRICE_ISSET_ID);
291
  }
292
 
293
  /** Returns true if field sdPrice is set (has been assigned a value) and false otherwise */
294
  public boolean isSetSdPrice() {
295
    return __isset_bit_vector.get(__SDPRICE_ISSET_ID);
296
  }
297
 
298
  public void setSdPriceIsSet(boolean value) {
299
    __isset_bit_vector.set(__SDPRICE_ISSET_ID, value);
300
  }
301
 
302
  public double getFkPrice() {
303
    return this.fkPrice;
304
  }
305
 
306
  public void setFkPrice(double fkPrice) {
307
    this.fkPrice = fkPrice;
308
    setFkPriceIsSet(true);
309
  }
310
 
311
  public void unsetFkPrice() {
312
    __isset_bit_vector.clear(__FKPRICE_ISSET_ID);
313
  }
314
 
315
  /** Returns true if field fkPrice is set (has been assigned a value) and false otherwise */
316
  public boolean isSetFkPrice() {
317
    return __isset_bit_vector.get(__FKPRICE_ISSET_ID);
318
  }
319
 
320
  public void setFkPriceIsSet(boolean value) {
321
    __isset_bit_vector.set(__FKPRICE_ISSET_ID, value);
322
  }
323
 
324
  public double getAmazonPrice() {
325
    return this.amazonPrice;
326
  }
327
 
328
  public void setAmazonPrice(double amazonPrice) {
329
    this.amazonPrice = amazonPrice;
330
    setAmazonPriceIsSet(true);
331
  }
332
 
333
  public void unsetAmazonPrice() {
334
    __isset_bit_vector.clear(__AMAZONPRICE_ISSET_ID);
335
  }
336
 
337
  /** Returns true if field amazonPrice is set (has been assigned a value) and false otherwise */
338
  public boolean isSetAmazonPrice() {
339
    return __isset_bit_vector.get(__AMAZONPRICE_ISSET_ID);
340
  }
341
 
342
  public void setAmazonPriceIsSet(boolean value) {
343
    __isset_bit_vector.set(__AMAZONPRICE_ISSET_ID, value);
344
  }
345
 
346
  public String getProductName() {
347
    return this.productName;
348
  }
349
 
350
  public void setProductName(String productName) {
351
    this.productName = productName;
352
  }
353
 
354
  public void unsetProductName() {
355
    this.productName = null;
356
  }
357
 
358
  /** Returns true if field productName is set (has been assigned a value) and false otherwise */
359
  public boolean isSetProductName() {
360
    return this.productName != null;
361
  }
362
 
363
  public void setProductNameIsSet(boolean value) {
364
    if (!value) {
365
      this.productName = null;
366
    }
367
  }
368
 
369
  public void setFieldValue(_Fields field, Object value) {
370
    switch (field) {
371
    case ITEM_ID:
372
      if (value == null) {
373
        unsetItem_id();
374
      } else {
375
        setItem_id((Long)value);
376
      }
377
      break;
378
 
379
    case DEAL_PRICE:
380
      if (value == null) {
381
        unsetDealPrice();
382
      } else {
383
        setDealPrice((Double)value);
384
      }
385
      break;
386
 
387
    case SAHOLIC_PRICE:
388
      if (value == null) {
389
        unsetSaholicPrice();
390
      } else {
391
        setSaholicPrice((Double)value);
392
      }
393
      break;
394
 
395
    case SD_PRICE:
396
      if (value == null) {
397
        unsetSdPrice();
398
      } else {
399
        setSdPrice((Double)value);
400
      }
401
      break;
402
 
403
    case FK_PRICE:
404
      if (value == null) {
405
        unsetFkPrice();
406
      } else {
407
        setFkPrice((Double)value);
408
      }
409
      break;
410
 
411
    case AMAZON_PRICE:
412
      if (value == null) {
413
        unsetAmazonPrice();
414
      } else {
415
        setAmazonPrice((Double)value);
416
      }
417
      break;
418
 
419
    case PRODUCT_NAME:
420
      if (value == null) {
421
        unsetProductName();
422
      } else {
423
        setProductName((String)value);
424
      }
425
      break;
426
 
427
    }
428
  }
429
 
430
  public Object getFieldValue(_Fields field) {
431
    switch (field) {
432
    case ITEM_ID:
433
      return Long.valueOf(getItem_id());
434
 
435
    case DEAL_PRICE:
436
      return Double.valueOf(getDealPrice());
437
 
438
    case SAHOLIC_PRICE:
439
      return Double.valueOf(getSaholicPrice());
440
 
441
    case SD_PRICE:
442
      return Double.valueOf(getSdPrice());
443
 
444
    case FK_PRICE:
445
      return Double.valueOf(getFkPrice());
446
 
447
    case AMAZON_PRICE:
448
      return Double.valueOf(getAmazonPrice());
449
 
450
    case PRODUCT_NAME:
451
      return getProductName();
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 ITEM_ID:
465
      return isSetItem_id();
466
    case DEAL_PRICE:
467
      return isSetDealPrice();
468
    case SAHOLIC_PRICE:
469
      return isSetSaholicPrice();
470
    case SD_PRICE:
471
      return isSetSdPrice();
472
    case FK_PRICE:
473
      return isSetFkPrice();
474
    case AMAZON_PRICE:
475
      return isSetAmazonPrice();
476
    case PRODUCT_NAME:
477
      return isSetProductName();
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 PdPriceComp)
487
      return this.equals((PdPriceComp)that);
488
    return false;
489
  }
490
 
491
  public boolean equals(PdPriceComp that) {
492
    if (that == null)
493
      return false;
494
 
495
    boolean this_present_item_id = true;
496
    boolean that_present_item_id = true;
497
    if (this_present_item_id || that_present_item_id) {
498
      if (!(this_present_item_id && that_present_item_id))
499
        return false;
500
      if (this.item_id != that.item_id)
501
        return false;
502
    }
503
 
504
    boolean this_present_dealPrice = true;
505
    boolean that_present_dealPrice = true;
506
    if (this_present_dealPrice || that_present_dealPrice) {
507
      if (!(this_present_dealPrice && that_present_dealPrice))
508
        return false;
509
      if (this.dealPrice != that.dealPrice)
510
        return false;
511
    }
512
 
513
    boolean this_present_saholicPrice = true;
514
    boolean that_present_saholicPrice = true;
515
    if (this_present_saholicPrice || that_present_saholicPrice) {
516
      if (!(this_present_saholicPrice && that_present_saholicPrice))
517
        return false;
518
      if (this.saholicPrice != that.saholicPrice)
519
        return false;
520
    }
521
 
522
    boolean this_present_sdPrice = true;
523
    boolean that_present_sdPrice = true;
524
    if (this_present_sdPrice || that_present_sdPrice) {
525
      if (!(this_present_sdPrice && that_present_sdPrice))
526
        return false;
527
      if (this.sdPrice != that.sdPrice)
528
        return false;
529
    }
530
 
531
    boolean this_present_fkPrice = true;
532
    boolean that_present_fkPrice = true;
533
    if (this_present_fkPrice || that_present_fkPrice) {
534
      if (!(this_present_fkPrice && that_present_fkPrice))
535
        return false;
536
      if (this.fkPrice != that.fkPrice)
537
        return false;
538
    }
539
 
540
    boolean this_present_amazonPrice = true;
541
    boolean that_present_amazonPrice = true;
542
    if (this_present_amazonPrice || that_present_amazonPrice) {
543
      if (!(this_present_amazonPrice && that_present_amazonPrice))
544
        return false;
545
      if (this.amazonPrice != that.amazonPrice)
546
        return false;
547
    }
548
 
549
    boolean this_present_productName = true && this.isSetProductName();
550
    boolean that_present_productName = true && that.isSetProductName();
551
    if (this_present_productName || that_present_productName) {
552
      if (!(this_present_productName && that_present_productName))
553
        return false;
554
      if (!this.productName.equals(that.productName))
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(PdPriceComp other) {
567
    if (!getClass().equals(other.getClass())) {
568
      return getClass().getName().compareTo(other.getClass().getName());
569
    }
570
 
571
    int lastComparison = 0;
572
    PdPriceComp typedOther = (PdPriceComp)other;
573
 
574
    lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(typedOther.isSetItem_id());
575
    if (lastComparison != 0) {
576
      return lastComparison;
577
    }
578
    if (isSetItem_id()) {
579
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.item_id, typedOther.item_id);
580
      if (lastComparison != 0) {
581
        return lastComparison;
582
      }
583
    }
584
    lastComparison = Boolean.valueOf(isSetDealPrice()).compareTo(typedOther.isSetDealPrice());
585
    if (lastComparison != 0) {
586
      return lastComparison;
587
    }
588
    if (isSetDealPrice()) {
589
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dealPrice, typedOther.dealPrice);
590
      if (lastComparison != 0) {
591
        return lastComparison;
592
      }
593
    }
594
    lastComparison = Boolean.valueOf(isSetSaholicPrice()).compareTo(typedOther.isSetSaholicPrice());
595
    if (lastComparison != 0) {
596
      return lastComparison;
597
    }
598
    if (isSetSaholicPrice()) {
599
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.saholicPrice, typedOther.saholicPrice);
600
      if (lastComparison != 0) {
601
        return lastComparison;
602
      }
603
    }
604
    lastComparison = Boolean.valueOf(isSetSdPrice()).compareTo(typedOther.isSetSdPrice());
605
    if (lastComparison != 0) {
606
      return lastComparison;
607
    }
608
    if (isSetSdPrice()) {
609
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sdPrice, typedOther.sdPrice);
610
      if (lastComparison != 0) {
611
        return lastComparison;
612
      }
613
    }
614
    lastComparison = Boolean.valueOf(isSetFkPrice()).compareTo(typedOther.isSetFkPrice());
615
    if (lastComparison != 0) {
616
      return lastComparison;
617
    }
618
    if (isSetFkPrice()) {
619
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fkPrice, typedOther.fkPrice);
620
      if (lastComparison != 0) {
621
        return lastComparison;
622
      }
623
    }
624
    lastComparison = Boolean.valueOf(isSetAmazonPrice()).compareTo(typedOther.isSetAmazonPrice());
625
    if (lastComparison != 0) {
626
      return lastComparison;
627
    }
628
    if (isSetAmazonPrice()) {
629
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amazonPrice, typedOther.amazonPrice);
630
      if (lastComparison != 0) {
631
        return lastComparison;
632
      }
633
    }
634
    lastComparison = Boolean.valueOf(isSetProductName()).compareTo(typedOther.isSetProductName());
635
    if (lastComparison != 0) {
636
      return lastComparison;
637
    }
638
    if (isSetProductName()) {
639
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.productName, typedOther.productName);
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: // ITEM_ID
662
          if (field.type == org.apache.thrift.protocol.TType.I64) {
663
            this.item_id = iprot.readI64();
664
            setItem_idIsSet(true);
665
          } else { 
666
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
667
          }
668
          break;
669
        case 2: // DEAL_PRICE
670
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
671
            this.dealPrice = iprot.readDouble();
672
            setDealPriceIsSet(true);
673
          } else { 
674
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
675
          }
676
          break;
677
        case 3: // SAHOLIC_PRICE
678
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
679
            this.saholicPrice = iprot.readDouble();
680
            setSaholicPriceIsSet(true);
681
          } else { 
682
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
683
          }
684
          break;
685
        case 4: // SD_PRICE
686
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
687
            this.sdPrice = iprot.readDouble();
688
            setSdPriceIsSet(true);
689
          } else { 
690
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
691
          }
692
          break;
693
        case 5: // FK_PRICE
694
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
695
            this.fkPrice = iprot.readDouble();
696
            setFkPriceIsSet(true);
697
          } else { 
698
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
699
          }
700
          break;
701
        case 6: // AMAZON_PRICE
702
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
703
            this.amazonPrice = iprot.readDouble();
704
            setAmazonPriceIsSet(true);
705
          } else { 
706
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
707
          }
708
          break;
709
        case 7: // PRODUCT_NAME
710
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
711
            this.productName = iprot.readString();
712
          } else { 
713
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
714
          }
715
          break;
716
        default:
717
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
718
      }
719
      iprot.readFieldEnd();
720
    }
721
    iprot.readStructEnd();
722
    validate();
723
  }
724
 
725
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
726
    validate();
727
 
728
    oprot.writeStructBegin(STRUCT_DESC);
729
    oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
730
    oprot.writeI64(this.item_id);
731
    oprot.writeFieldEnd();
732
    oprot.writeFieldBegin(DEAL_PRICE_FIELD_DESC);
733
    oprot.writeDouble(this.dealPrice);
734
    oprot.writeFieldEnd();
735
    oprot.writeFieldBegin(SAHOLIC_PRICE_FIELD_DESC);
736
    oprot.writeDouble(this.saholicPrice);
737
    oprot.writeFieldEnd();
738
    oprot.writeFieldBegin(SD_PRICE_FIELD_DESC);
739
    oprot.writeDouble(this.sdPrice);
740
    oprot.writeFieldEnd();
741
    oprot.writeFieldBegin(FK_PRICE_FIELD_DESC);
742
    oprot.writeDouble(this.fkPrice);
743
    oprot.writeFieldEnd();
744
    oprot.writeFieldBegin(AMAZON_PRICE_FIELD_DESC);
745
    oprot.writeDouble(this.amazonPrice);
746
    oprot.writeFieldEnd();
747
    if (this.productName != null) {
748
      oprot.writeFieldBegin(PRODUCT_NAME_FIELD_DESC);
749
      oprot.writeString(this.productName);
750
      oprot.writeFieldEnd();
751
    }
752
    oprot.writeFieldStop();
753
    oprot.writeStructEnd();
754
  }
755
 
756
  @Override
757
  public String toString() {
758
    StringBuilder sb = new StringBuilder("PdPriceComp(");
759
    boolean first = true;
760
 
761
    sb.append("item_id:");
762
    sb.append(this.item_id);
763
    first = false;
764
    if (!first) sb.append(", ");
765
    sb.append("dealPrice:");
766
    sb.append(this.dealPrice);
767
    first = false;
768
    if (!first) sb.append(", ");
769
    sb.append("saholicPrice:");
770
    sb.append(this.saholicPrice);
771
    first = false;
772
    if (!first) sb.append(", ");
773
    sb.append("sdPrice:");
774
    sb.append(this.sdPrice);
775
    first = false;
776
    if (!first) sb.append(", ");
777
    sb.append("fkPrice:");
778
    sb.append(this.fkPrice);
779
    first = false;
780
    if (!first) sb.append(", ");
781
    sb.append("amazonPrice:");
782
    sb.append(this.amazonPrice);
783
    first = false;
784
    if (!first) sb.append(", ");
785
    sb.append("productName:");
786
    if (this.productName == null) {
787
      sb.append("null");
788
    } else {
789
      sb.append(this.productName);
790
    }
791
    first = false;
792
    sb.append(")");
793
    return sb.toString();
794
  }
795
 
796
  public void validate() throws org.apache.thrift.TException {
797
    // check for required fields
798
  }
799
 
800
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
801
    try {
802
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
803
    } catch (org.apache.thrift.TException te) {
804
      throw new java.io.IOException(te);
805
    }
806
  }
807
 
808
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
809
    try {
810
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
811
      __isset_bit_vector = new BitSet(1);
812
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
813
    } catch (org.apache.thrift.TException te) {
814
      throw new java.io.IOException(te);
815
    }
816
  }
817
 
818
}
819