Subversion Repositories SmartDukaan

Rev

Rev 11905 | Go to most recent revision | Details | Compare with Previous | 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);
12169 kshitij.so 33
  private static final org.apache.thrift.protocol.TField LAST_PROCESSED_TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("lastProcessedTimestamp", org.apache.thrift.protocol.TType.I64, (short)8);
11905 kshitij.so 34
 
35
  private long item_id; // required
36
  private double dealPrice; // required
37
  private double saholicPrice; // required
38
  private double sdPrice; // required
39
  private double fkPrice; // required
40
  private double amazonPrice; // required
41
  private String productName; // required
12169 kshitij.so 42
  private long lastProcessedTimestamp; // required
11905 kshitij.so 43
 
44
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
45
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
46
    ITEM_ID((short)1, "item_id"),
47
    DEAL_PRICE((short)2, "dealPrice"),
48
    SAHOLIC_PRICE((short)3, "saholicPrice"),
49
    SD_PRICE((short)4, "sdPrice"),
50
    FK_PRICE((short)5, "fkPrice"),
51
    AMAZON_PRICE((short)6, "amazonPrice"),
12169 kshitij.so 52
    PRODUCT_NAME((short)7, "productName"),
53
    LAST_PROCESSED_TIMESTAMP((short)8, "lastProcessedTimestamp");
11905 kshitij.so 54
 
55
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
56
 
57
    static {
58
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
59
        byName.put(field.getFieldName(), field);
60
      }
61
    }
62
 
63
    /**
64
     * Find the _Fields constant that matches fieldId, or null if its not found.
65
     */
66
    public static _Fields findByThriftId(int fieldId) {
67
      switch(fieldId) {
68
        case 1: // ITEM_ID
69
          return ITEM_ID;
70
        case 2: // DEAL_PRICE
71
          return DEAL_PRICE;
72
        case 3: // SAHOLIC_PRICE
73
          return SAHOLIC_PRICE;
74
        case 4: // SD_PRICE
75
          return SD_PRICE;
76
        case 5: // FK_PRICE
77
          return FK_PRICE;
78
        case 6: // AMAZON_PRICE
79
          return AMAZON_PRICE;
80
        case 7: // PRODUCT_NAME
81
          return PRODUCT_NAME;
12169 kshitij.so 82
        case 8: // LAST_PROCESSED_TIMESTAMP
83
          return LAST_PROCESSED_TIMESTAMP;
11905 kshitij.so 84
        default:
85
          return null;
86
      }
87
    }
88
 
89
    /**
90
     * Find the _Fields constant that matches fieldId, throwing an exception
91
     * if it is not found.
92
     */
93
    public static _Fields findByThriftIdOrThrow(int fieldId) {
94
      _Fields fields = findByThriftId(fieldId);
95
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
96
      return fields;
97
    }
98
 
99
    /**
100
     * Find the _Fields constant that matches name, or null if its not found.
101
     */
102
    public static _Fields findByName(String name) {
103
      return byName.get(name);
104
    }
105
 
106
    private final short _thriftId;
107
    private final String _fieldName;
108
 
109
    _Fields(short thriftId, String fieldName) {
110
      _thriftId = thriftId;
111
      _fieldName = fieldName;
112
    }
113
 
114
    public short getThriftFieldId() {
115
      return _thriftId;
116
    }
117
 
118
    public String getFieldName() {
119
      return _fieldName;
120
    }
121
  }
122
 
123
  // isset id assignments
124
  private static final int __ITEM_ID_ISSET_ID = 0;
125
  private static final int __DEALPRICE_ISSET_ID = 1;
126
  private static final int __SAHOLICPRICE_ISSET_ID = 2;
127
  private static final int __SDPRICE_ISSET_ID = 3;
128
  private static final int __FKPRICE_ISSET_ID = 4;
129
  private static final int __AMAZONPRICE_ISSET_ID = 5;
12169 kshitij.so 130
  private static final int __LASTPROCESSEDTIMESTAMP_ISSET_ID = 6;
131
  private BitSet __isset_bit_vector = new BitSet(7);
11905 kshitij.so 132
 
133
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
134
  static {
135
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
136
    tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("item_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
137
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
138
    tmpMap.put(_Fields.DEAL_PRICE, new org.apache.thrift.meta_data.FieldMetaData("dealPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
139
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
140
    tmpMap.put(_Fields.SAHOLIC_PRICE, new org.apache.thrift.meta_data.FieldMetaData("saholicPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
141
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
142
    tmpMap.put(_Fields.SD_PRICE, new org.apache.thrift.meta_data.FieldMetaData("sdPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
143
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
144
    tmpMap.put(_Fields.FK_PRICE, new org.apache.thrift.meta_data.FieldMetaData("fkPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
145
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
146
    tmpMap.put(_Fields.AMAZON_PRICE, new org.apache.thrift.meta_data.FieldMetaData("amazonPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
147
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
148
    tmpMap.put(_Fields.PRODUCT_NAME, new org.apache.thrift.meta_data.FieldMetaData("productName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
149
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
12169 kshitij.so 150
    tmpMap.put(_Fields.LAST_PROCESSED_TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("lastProcessedTimestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, 
151
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
11905 kshitij.so 152
    metaDataMap = Collections.unmodifiableMap(tmpMap);
153
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PdPriceComp.class, metaDataMap);
154
  }
155
 
156
  public PdPriceComp() {
157
  }
158
 
159
  public PdPriceComp(
160
    long item_id,
161
    double dealPrice,
162
    double saholicPrice,
163
    double sdPrice,
164
    double fkPrice,
165
    double amazonPrice,
12169 kshitij.so 166
    String productName,
167
    long lastProcessedTimestamp)
11905 kshitij.so 168
  {
169
    this();
170
    this.item_id = item_id;
171
    setItem_idIsSet(true);
172
    this.dealPrice = dealPrice;
173
    setDealPriceIsSet(true);
174
    this.saholicPrice = saholicPrice;
175
    setSaholicPriceIsSet(true);
176
    this.sdPrice = sdPrice;
177
    setSdPriceIsSet(true);
178
    this.fkPrice = fkPrice;
179
    setFkPriceIsSet(true);
180
    this.amazonPrice = amazonPrice;
181
    setAmazonPriceIsSet(true);
182
    this.productName = productName;
12169 kshitij.so 183
    this.lastProcessedTimestamp = lastProcessedTimestamp;
184
    setLastProcessedTimestampIsSet(true);
11905 kshitij.so 185
  }
186
 
187
  /**
188
   * Performs a deep copy on <i>other</i>.
189
   */
190
  public PdPriceComp(PdPriceComp other) {
191
    __isset_bit_vector.clear();
192
    __isset_bit_vector.or(other.__isset_bit_vector);
193
    this.item_id = other.item_id;
194
    this.dealPrice = other.dealPrice;
195
    this.saholicPrice = other.saholicPrice;
196
    this.sdPrice = other.sdPrice;
197
    this.fkPrice = other.fkPrice;
198
    this.amazonPrice = other.amazonPrice;
199
    if (other.isSetProductName()) {
200
      this.productName = other.productName;
201
    }
12169 kshitij.so 202
    this.lastProcessedTimestamp = other.lastProcessedTimestamp;
11905 kshitij.so 203
  }
204
 
205
  public PdPriceComp deepCopy() {
206
    return new PdPriceComp(this);
207
  }
208
 
209
  @Override
210
  public void clear() {
211
    setItem_idIsSet(false);
212
    this.item_id = 0;
213
    setDealPriceIsSet(false);
214
    this.dealPrice = 0.0;
215
    setSaholicPriceIsSet(false);
216
    this.saholicPrice = 0.0;
217
    setSdPriceIsSet(false);
218
    this.sdPrice = 0.0;
219
    setFkPriceIsSet(false);
220
    this.fkPrice = 0.0;
221
    setAmazonPriceIsSet(false);
222
    this.amazonPrice = 0.0;
223
    this.productName = null;
12169 kshitij.so 224
    setLastProcessedTimestampIsSet(false);
225
    this.lastProcessedTimestamp = 0;
11905 kshitij.so 226
  }
227
 
228
  public long getItem_id() {
229
    return this.item_id;
230
  }
231
 
232
  public void setItem_id(long item_id) {
233
    this.item_id = item_id;
234
    setItem_idIsSet(true);
235
  }
236
 
237
  public void unsetItem_id() {
238
    __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
239
  }
240
 
241
  /** Returns true if field item_id is set (has been assigned a value) and false otherwise */
242
  public boolean isSetItem_id() {
243
    return __isset_bit_vector.get(__ITEM_ID_ISSET_ID);
244
  }
245
 
246
  public void setItem_idIsSet(boolean value) {
247
    __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
248
  }
249
 
250
  public double getDealPrice() {
251
    return this.dealPrice;
252
  }
253
 
254
  public void setDealPrice(double dealPrice) {
255
    this.dealPrice = dealPrice;
256
    setDealPriceIsSet(true);
257
  }
258
 
259
  public void unsetDealPrice() {
260
    __isset_bit_vector.clear(__DEALPRICE_ISSET_ID);
261
  }
262
 
263
  /** Returns true if field dealPrice is set (has been assigned a value) and false otherwise */
264
  public boolean isSetDealPrice() {
265
    return __isset_bit_vector.get(__DEALPRICE_ISSET_ID);
266
  }
267
 
268
  public void setDealPriceIsSet(boolean value) {
269
    __isset_bit_vector.set(__DEALPRICE_ISSET_ID, value);
270
  }
271
 
272
  public double getSaholicPrice() {
273
    return this.saholicPrice;
274
  }
275
 
276
  public void setSaholicPrice(double saholicPrice) {
277
    this.saholicPrice = saholicPrice;
278
    setSaholicPriceIsSet(true);
279
  }
280
 
281
  public void unsetSaholicPrice() {
282
    __isset_bit_vector.clear(__SAHOLICPRICE_ISSET_ID);
283
  }
284
 
285
  /** Returns true if field saholicPrice is set (has been assigned a value) and false otherwise */
286
  public boolean isSetSaholicPrice() {
287
    return __isset_bit_vector.get(__SAHOLICPRICE_ISSET_ID);
288
  }
289
 
290
  public void setSaholicPriceIsSet(boolean value) {
291
    __isset_bit_vector.set(__SAHOLICPRICE_ISSET_ID, value);
292
  }
293
 
294
  public double getSdPrice() {
295
    return this.sdPrice;
296
  }
297
 
298
  public void setSdPrice(double sdPrice) {
299
    this.sdPrice = sdPrice;
300
    setSdPriceIsSet(true);
301
  }
302
 
303
  public void unsetSdPrice() {
304
    __isset_bit_vector.clear(__SDPRICE_ISSET_ID);
305
  }
306
 
307
  /** Returns true if field sdPrice is set (has been assigned a value) and false otherwise */
308
  public boolean isSetSdPrice() {
309
    return __isset_bit_vector.get(__SDPRICE_ISSET_ID);
310
  }
311
 
312
  public void setSdPriceIsSet(boolean value) {
313
    __isset_bit_vector.set(__SDPRICE_ISSET_ID, value);
314
  }
315
 
316
  public double getFkPrice() {
317
    return this.fkPrice;
318
  }
319
 
320
  public void setFkPrice(double fkPrice) {
321
    this.fkPrice = fkPrice;
322
    setFkPriceIsSet(true);
323
  }
324
 
325
  public void unsetFkPrice() {
326
    __isset_bit_vector.clear(__FKPRICE_ISSET_ID);
327
  }
328
 
329
  /** Returns true if field fkPrice is set (has been assigned a value) and false otherwise */
330
  public boolean isSetFkPrice() {
331
    return __isset_bit_vector.get(__FKPRICE_ISSET_ID);
332
  }
333
 
334
  public void setFkPriceIsSet(boolean value) {
335
    __isset_bit_vector.set(__FKPRICE_ISSET_ID, value);
336
  }
337
 
338
  public double getAmazonPrice() {
339
    return this.amazonPrice;
340
  }
341
 
342
  public void setAmazonPrice(double amazonPrice) {
343
    this.amazonPrice = amazonPrice;
344
    setAmazonPriceIsSet(true);
345
  }
346
 
347
  public void unsetAmazonPrice() {
348
    __isset_bit_vector.clear(__AMAZONPRICE_ISSET_ID);
349
  }
350
 
351
  /** Returns true if field amazonPrice is set (has been assigned a value) and false otherwise */
352
  public boolean isSetAmazonPrice() {
353
    return __isset_bit_vector.get(__AMAZONPRICE_ISSET_ID);
354
  }
355
 
356
  public void setAmazonPriceIsSet(boolean value) {
357
    __isset_bit_vector.set(__AMAZONPRICE_ISSET_ID, value);
358
  }
359
 
360
  public String getProductName() {
361
    return this.productName;
362
  }
363
 
364
  public void setProductName(String productName) {
365
    this.productName = productName;
366
  }
367
 
368
  public void unsetProductName() {
369
    this.productName = null;
370
  }
371
 
372
  /** Returns true if field productName is set (has been assigned a value) and false otherwise */
373
  public boolean isSetProductName() {
374
    return this.productName != null;
375
  }
376
 
377
  public void setProductNameIsSet(boolean value) {
378
    if (!value) {
379
      this.productName = null;
380
    }
381
  }
382
 
12169 kshitij.so 383
  public long getLastProcessedTimestamp() {
384
    return this.lastProcessedTimestamp;
385
  }
386
 
387
  public void setLastProcessedTimestamp(long lastProcessedTimestamp) {
388
    this.lastProcessedTimestamp = lastProcessedTimestamp;
389
    setLastProcessedTimestampIsSet(true);
390
  }
391
 
392
  public void unsetLastProcessedTimestamp() {
393
    __isset_bit_vector.clear(__LASTPROCESSEDTIMESTAMP_ISSET_ID);
394
  }
395
 
396
  /** Returns true if field lastProcessedTimestamp is set (has been assigned a value) and false otherwise */
397
  public boolean isSetLastProcessedTimestamp() {
398
    return __isset_bit_vector.get(__LASTPROCESSEDTIMESTAMP_ISSET_ID);
399
  }
400
 
401
  public void setLastProcessedTimestampIsSet(boolean value) {
402
    __isset_bit_vector.set(__LASTPROCESSEDTIMESTAMP_ISSET_ID, value);
403
  }
404
 
11905 kshitij.so 405
  public void setFieldValue(_Fields field, Object value) {
406
    switch (field) {
407
    case ITEM_ID:
408
      if (value == null) {
409
        unsetItem_id();
410
      } else {
411
        setItem_id((Long)value);
412
      }
413
      break;
414
 
415
    case DEAL_PRICE:
416
      if (value == null) {
417
        unsetDealPrice();
418
      } else {
419
        setDealPrice((Double)value);
420
      }
421
      break;
422
 
423
    case SAHOLIC_PRICE:
424
      if (value == null) {
425
        unsetSaholicPrice();
426
      } else {
427
        setSaholicPrice((Double)value);
428
      }
429
      break;
430
 
431
    case SD_PRICE:
432
      if (value == null) {
433
        unsetSdPrice();
434
      } else {
435
        setSdPrice((Double)value);
436
      }
437
      break;
438
 
439
    case FK_PRICE:
440
      if (value == null) {
441
        unsetFkPrice();
442
      } else {
443
        setFkPrice((Double)value);
444
      }
445
      break;
446
 
447
    case AMAZON_PRICE:
448
      if (value == null) {
449
        unsetAmazonPrice();
450
      } else {
451
        setAmazonPrice((Double)value);
452
      }
453
      break;
454
 
455
    case PRODUCT_NAME:
456
      if (value == null) {
457
        unsetProductName();
458
      } else {
459
        setProductName((String)value);
460
      }
461
      break;
462
 
12169 kshitij.so 463
    case LAST_PROCESSED_TIMESTAMP:
464
      if (value == null) {
465
        unsetLastProcessedTimestamp();
466
      } else {
467
        setLastProcessedTimestamp((Long)value);
468
      }
469
      break;
470
 
11905 kshitij.so 471
    }
472
  }
473
 
474
  public Object getFieldValue(_Fields field) {
475
    switch (field) {
476
    case ITEM_ID:
477
      return Long.valueOf(getItem_id());
478
 
479
    case DEAL_PRICE:
480
      return Double.valueOf(getDealPrice());
481
 
482
    case SAHOLIC_PRICE:
483
      return Double.valueOf(getSaholicPrice());
484
 
485
    case SD_PRICE:
486
      return Double.valueOf(getSdPrice());
487
 
488
    case FK_PRICE:
489
      return Double.valueOf(getFkPrice());
490
 
491
    case AMAZON_PRICE:
492
      return Double.valueOf(getAmazonPrice());
493
 
494
    case PRODUCT_NAME:
495
      return getProductName();
496
 
12169 kshitij.so 497
    case LAST_PROCESSED_TIMESTAMP:
498
      return Long.valueOf(getLastProcessedTimestamp());
499
 
11905 kshitij.so 500
    }
501
    throw new IllegalStateException();
502
  }
503
 
504
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
505
  public boolean isSet(_Fields field) {
506
    if (field == null) {
507
      throw new IllegalArgumentException();
508
    }
509
 
510
    switch (field) {
511
    case ITEM_ID:
512
      return isSetItem_id();
513
    case DEAL_PRICE:
514
      return isSetDealPrice();
515
    case SAHOLIC_PRICE:
516
      return isSetSaholicPrice();
517
    case SD_PRICE:
518
      return isSetSdPrice();
519
    case FK_PRICE:
520
      return isSetFkPrice();
521
    case AMAZON_PRICE:
522
      return isSetAmazonPrice();
523
    case PRODUCT_NAME:
524
      return isSetProductName();
12169 kshitij.so 525
    case LAST_PROCESSED_TIMESTAMP:
526
      return isSetLastProcessedTimestamp();
11905 kshitij.so 527
    }
528
    throw new IllegalStateException();
529
  }
530
 
531
  @Override
532
  public boolean equals(Object that) {
533
    if (that == null)
534
      return false;
535
    if (that instanceof PdPriceComp)
536
      return this.equals((PdPriceComp)that);
537
    return false;
538
  }
539
 
540
  public boolean equals(PdPriceComp that) {
541
    if (that == null)
542
      return false;
543
 
544
    boolean this_present_item_id = true;
545
    boolean that_present_item_id = true;
546
    if (this_present_item_id || that_present_item_id) {
547
      if (!(this_present_item_id && that_present_item_id))
548
        return false;
549
      if (this.item_id != that.item_id)
550
        return false;
551
    }
552
 
553
    boolean this_present_dealPrice = true;
554
    boolean that_present_dealPrice = true;
555
    if (this_present_dealPrice || that_present_dealPrice) {
556
      if (!(this_present_dealPrice && that_present_dealPrice))
557
        return false;
558
      if (this.dealPrice != that.dealPrice)
559
        return false;
560
    }
561
 
562
    boolean this_present_saholicPrice = true;
563
    boolean that_present_saholicPrice = true;
564
    if (this_present_saholicPrice || that_present_saholicPrice) {
565
      if (!(this_present_saholicPrice && that_present_saholicPrice))
566
        return false;
567
      if (this.saholicPrice != that.saholicPrice)
568
        return false;
569
    }
570
 
571
    boolean this_present_sdPrice = true;
572
    boolean that_present_sdPrice = true;
573
    if (this_present_sdPrice || that_present_sdPrice) {
574
      if (!(this_present_sdPrice && that_present_sdPrice))
575
        return false;
576
      if (this.sdPrice != that.sdPrice)
577
        return false;
578
    }
579
 
580
    boolean this_present_fkPrice = true;
581
    boolean that_present_fkPrice = true;
582
    if (this_present_fkPrice || that_present_fkPrice) {
583
      if (!(this_present_fkPrice && that_present_fkPrice))
584
        return false;
585
      if (this.fkPrice != that.fkPrice)
586
        return false;
587
    }
588
 
589
    boolean this_present_amazonPrice = true;
590
    boolean that_present_amazonPrice = true;
591
    if (this_present_amazonPrice || that_present_amazonPrice) {
592
      if (!(this_present_amazonPrice && that_present_amazonPrice))
593
        return false;
594
      if (this.amazonPrice != that.amazonPrice)
595
        return false;
596
    }
597
 
598
    boolean this_present_productName = true && this.isSetProductName();
599
    boolean that_present_productName = true && that.isSetProductName();
600
    if (this_present_productName || that_present_productName) {
601
      if (!(this_present_productName && that_present_productName))
602
        return false;
603
      if (!this.productName.equals(that.productName))
604
        return false;
605
    }
606
 
12169 kshitij.so 607
    boolean this_present_lastProcessedTimestamp = true;
608
    boolean that_present_lastProcessedTimestamp = true;
609
    if (this_present_lastProcessedTimestamp || that_present_lastProcessedTimestamp) {
610
      if (!(this_present_lastProcessedTimestamp && that_present_lastProcessedTimestamp))
611
        return false;
612
      if (this.lastProcessedTimestamp != that.lastProcessedTimestamp)
613
        return false;
614
    }
615
 
11905 kshitij.so 616
    return true;
617
  }
618
 
619
  @Override
620
  public int hashCode() {
621
    return 0;
622
  }
623
 
624
  public int compareTo(PdPriceComp other) {
625
    if (!getClass().equals(other.getClass())) {
626
      return getClass().getName().compareTo(other.getClass().getName());
627
    }
628
 
629
    int lastComparison = 0;
630
    PdPriceComp typedOther = (PdPriceComp)other;
631
 
632
    lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(typedOther.isSetItem_id());
633
    if (lastComparison != 0) {
634
      return lastComparison;
635
    }
636
    if (isSetItem_id()) {
637
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.item_id, typedOther.item_id);
638
      if (lastComparison != 0) {
639
        return lastComparison;
640
      }
641
    }
642
    lastComparison = Boolean.valueOf(isSetDealPrice()).compareTo(typedOther.isSetDealPrice());
643
    if (lastComparison != 0) {
644
      return lastComparison;
645
    }
646
    if (isSetDealPrice()) {
647
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dealPrice, typedOther.dealPrice);
648
      if (lastComparison != 0) {
649
        return lastComparison;
650
      }
651
    }
652
    lastComparison = Boolean.valueOf(isSetSaholicPrice()).compareTo(typedOther.isSetSaholicPrice());
653
    if (lastComparison != 0) {
654
      return lastComparison;
655
    }
656
    if (isSetSaholicPrice()) {
657
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.saholicPrice, typedOther.saholicPrice);
658
      if (lastComparison != 0) {
659
        return lastComparison;
660
      }
661
    }
662
    lastComparison = Boolean.valueOf(isSetSdPrice()).compareTo(typedOther.isSetSdPrice());
663
    if (lastComparison != 0) {
664
      return lastComparison;
665
    }
666
    if (isSetSdPrice()) {
667
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sdPrice, typedOther.sdPrice);
668
      if (lastComparison != 0) {
669
        return lastComparison;
670
      }
671
    }
672
    lastComparison = Boolean.valueOf(isSetFkPrice()).compareTo(typedOther.isSetFkPrice());
673
    if (lastComparison != 0) {
674
      return lastComparison;
675
    }
676
    if (isSetFkPrice()) {
677
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fkPrice, typedOther.fkPrice);
678
      if (lastComparison != 0) {
679
        return lastComparison;
680
      }
681
    }
682
    lastComparison = Boolean.valueOf(isSetAmazonPrice()).compareTo(typedOther.isSetAmazonPrice());
683
    if (lastComparison != 0) {
684
      return lastComparison;
685
    }
686
    if (isSetAmazonPrice()) {
687
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.amazonPrice, typedOther.amazonPrice);
688
      if (lastComparison != 0) {
689
        return lastComparison;
690
      }
691
    }
692
    lastComparison = Boolean.valueOf(isSetProductName()).compareTo(typedOther.isSetProductName());
693
    if (lastComparison != 0) {
694
      return lastComparison;
695
    }
696
    if (isSetProductName()) {
697
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.productName, typedOther.productName);
698
      if (lastComparison != 0) {
699
        return lastComparison;
700
      }
701
    }
12169 kshitij.so 702
    lastComparison = Boolean.valueOf(isSetLastProcessedTimestamp()).compareTo(typedOther.isSetLastProcessedTimestamp());
703
    if (lastComparison != 0) {
704
      return lastComparison;
705
    }
706
    if (isSetLastProcessedTimestamp()) {
707
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lastProcessedTimestamp, typedOther.lastProcessedTimestamp);
708
      if (lastComparison != 0) {
709
        return lastComparison;
710
      }
711
    }
11905 kshitij.so 712
    return 0;
713
  }
714
 
715
  public _Fields fieldForId(int fieldId) {
716
    return _Fields.findByThriftId(fieldId);
717
  }
718
 
719
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
720
    org.apache.thrift.protocol.TField field;
721
    iprot.readStructBegin();
722
    while (true)
723
    {
724
      field = iprot.readFieldBegin();
725
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
726
        break;
727
      }
728
      switch (field.id) {
729
        case 1: // ITEM_ID
730
          if (field.type == org.apache.thrift.protocol.TType.I64) {
731
            this.item_id = iprot.readI64();
732
            setItem_idIsSet(true);
733
          } else { 
734
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
735
          }
736
          break;
737
        case 2: // DEAL_PRICE
738
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
739
            this.dealPrice = iprot.readDouble();
740
            setDealPriceIsSet(true);
741
          } else { 
742
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
743
          }
744
          break;
745
        case 3: // SAHOLIC_PRICE
746
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
747
            this.saholicPrice = iprot.readDouble();
748
            setSaholicPriceIsSet(true);
749
          } else { 
750
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
751
          }
752
          break;
753
        case 4: // SD_PRICE
754
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
755
            this.sdPrice = iprot.readDouble();
756
            setSdPriceIsSet(true);
757
          } else { 
758
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
759
          }
760
          break;
761
        case 5: // FK_PRICE
762
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
763
            this.fkPrice = iprot.readDouble();
764
            setFkPriceIsSet(true);
765
          } else { 
766
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
767
          }
768
          break;
769
        case 6: // AMAZON_PRICE
770
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
771
            this.amazonPrice = iprot.readDouble();
772
            setAmazonPriceIsSet(true);
773
          } else { 
774
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
775
          }
776
          break;
777
        case 7: // PRODUCT_NAME
778
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
779
            this.productName = iprot.readString();
780
          } else { 
781
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
782
          }
783
          break;
12169 kshitij.so 784
        case 8: // LAST_PROCESSED_TIMESTAMP
785
          if (field.type == org.apache.thrift.protocol.TType.I64) {
786
            this.lastProcessedTimestamp = iprot.readI64();
787
            setLastProcessedTimestampIsSet(true);
788
          } else { 
789
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
790
          }
791
          break;
11905 kshitij.so 792
        default:
793
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
794
      }
795
      iprot.readFieldEnd();
796
    }
797
    iprot.readStructEnd();
798
    validate();
799
  }
800
 
801
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
802
    validate();
803
 
804
    oprot.writeStructBegin(STRUCT_DESC);
805
    oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
806
    oprot.writeI64(this.item_id);
807
    oprot.writeFieldEnd();
808
    oprot.writeFieldBegin(DEAL_PRICE_FIELD_DESC);
809
    oprot.writeDouble(this.dealPrice);
810
    oprot.writeFieldEnd();
811
    oprot.writeFieldBegin(SAHOLIC_PRICE_FIELD_DESC);
812
    oprot.writeDouble(this.saholicPrice);
813
    oprot.writeFieldEnd();
814
    oprot.writeFieldBegin(SD_PRICE_FIELD_DESC);
815
    oprot.writeDouble(this.sdPrice);
816
    oprot.writeFieldEnd();
817
    oprot.writeFieldBegin(FK_PRICE_FIELD_DESC);
818
    oprot.writeDouble(this.fkPrice);
819
    oprot.writeFieldEnd();
820
    oprot.writeFieldBegin(AMAZON_PRICE_FIELD_DESC);
821
    oprot.writeDouble(this.amazonPrice);
822
    oprot.writeFieldEnd();
823
    if (this.productName != null) {
824
      oprot.writeFieldBegin(PRODUCT_NAME_FIELD_DESC);
825
      oprot.writeString(this.productName);
826
      oprot.writeFieldEnd();
827
    }
12169 kshitij.so 828
    oprot.writeFieldBegin(LAST_PROCESSED_TIMESTAMP_FIELD_DESC);
829
    oprot.writeI64(this.lastProcessedTimestamp);
830
    oprot.writeFieldEnd();
11905 kshitij.so 831
    oprot.writeFieldStop();
832
    oprot.writeStructEnd();
833
  }
834
 
835
  @Override
836
  public String toString() {
837
    StringBuilder sb = new StringBuilder("PdPriceComp(");
838
    boolean first = true;
839
 
840
    sb.append("item_id:");
841
    sb.append(this.item_id);
842
    first = false;
843
    if (!first) sb.append(", ");
844
    sb.append("dealPrice:");
845
    sb.append(this.dealPrice);
846
    first = false;
847
    if (!first) sb.append(", ");
848
    sb.append("saholicPrice:");
849
    sb.append(this.saholicPrice);
850
    first = false;
851
    if (!first) sb.append(", ");
852
    sb.append("sdPrice:");
853
    sb.append(this.sdPrice);
854
    first = false;
855
    if (!first) sb.append(", ");
856
    sb.append("fkPrice:");
857
    sb.append(this.fkPrice);
858
    first = false;
859
    if (!first) sb.append(", ");
860
    sb.append("amazonPrice:");
861
    sb.append(this.amazonPrice);
862
    first = false;
863
    if (!first) sb.append(", ");
864
    sb.append("productName:");
865
    if (this.productName == null) {
866
      sb.append("null");
867
    } else {
868
      sb.append(this.productName);
869
    }
870
    first = false;
12169 kshitij.so 871
    if (!first) sb.append(", ");
872
    sb.append("lastProcessedTimestamp:");
873
    sb.append(this.lastProcessedTimestamp);
874
    first = false;
11905 kshitij.so 875
    sb.append(")");
876
    return sb.toString();
877
  }
878
 
879
  public void validate() throws org.apache.thrift.TException {
880
    // check for required fields
881
  }
882
 
883
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
884
    try {
885
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
886
    } catch (org.apache.thrift.TException te) {
887
      throw new java.io.IOException(te);
888
    }
889
  }
890
 
891
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
892
    try {
893
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
894
      __isset_bit_vector = new BitSet(1);
895
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
896
    } catch (org.apache.thrift.TException te) {
897
      throw new java.io.IOException(te);
898
    }
899
  }
900
 
901
}
902