Subversion Repositories SmartDukaan

Rev

Rev 7308 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
7256 rajveer 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 StorePricing implements org.apache.thrift.TBase<StorePricing, StorePricing._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("StorePricing");
25
 
26
  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)1);
27
  private static final org.apache.thrift.protocol.TField RECOMMENDED_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("recommendedPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)2);
28
  private static final org.apache.thrift.protocol.TField MIN_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("minPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)3);
29
  private static final org.apache.thrift.protocol.TField MAX_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("maxPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)4);
30
  private static final org.apache.thrift.protocol.TField MIN_ADVANCE_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("minAdvancePrice", org.apache.thrift.protocol.TType.DOUBLE, (short)5);
7351 rajveer 31
  private static final org.apache.thrift.protocol.TField ABSOLUTE_MIN_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("absoluteMinPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)6);
32
  private static final org.apache.thrift.protocol.TField FREEBIE_ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("freebieItemId", org.apache.thrift.protocol.TType.I64, (short)7);
33
  private static final org.apache.thrift.protocol.TField BEST_DEAL_TEXT_FIELD_DESC = new org.apache.thrift.protocol.TField("bestDealText", org.apache.thrift.protocol.TType.STRING, (short)8);
7256 rajveer 34
 
35
  private long itemId; // required
36
  private double recommendedPrice; // required
37
  private double minPrice; // required
38
  private double maxPrice; // required
39
  private double minAdvancePrice; // required
7351 rajveer 40
  private double absoluteMinPrice; // required
7308 rajveer 41
  private long freebieItemId; // required
42
  private String bestDealText; // required
7256 rajveer 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, "itemId"),
47
    RECOMMENDED_PRICE((short)2, "recommendedPrice"),
48
    MIN_PRICE((short)3, "minPrice"),
49
    MAX_PRICE((short)4, "maxPrice"),
7308 rajveer 50
    MIN_ADVANCE_PRICE((short)5, "minAdvancePrice"),
7351 rajveer 51
    ABSOLUTE_MIN_PRICE((short)6, "absoluteMinPrice"),
52
    FREEBIE_ITEM_ID((short)7, "freebieItemId"),
53
    BEST_DEAL_TEXT((short)8, "bestDealText");
7256 rajveer 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: // RECOMMENDED_PRICE
71
          return RECOMMENDED_PRICE;
72
        case 3: // MIN_PRICE
73
          return MIN_PRICE;
74
        case 4: // MAX_PRICE
75
          return MAX_PRICE;
76
        case 5: // MIN_ADVANCE_PRICE
77
          return MIN_ADVANCE_PRICE;
7351 rajveer 78
        case 6: // ABSOLUTE_MIN_PRICE
79
          return ABSOLUTE_MIN_PRICE;
80
        case 7: // FREEBIE_ITEM_ID
7308 rajveer 81
          return FREEBIE_ITEM_ID;
7351 rajveer 82
        case 8: // BEST_DEAL_TEXT
7308 rajveer 83
          return BEST_DEAL_TEXT;
7256 rajveer 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 __ITEMID_ISSET_ID = 0;
125
  private static final int __RECOMMENDEDPRICE_ISSET_ID = 1;
126
  private static final int __MINPRICE_ISSET_ID = 2;
127
  private static final int __MAXPRICE_ISSET_ID = 3;
128
  private static final int __MINADVANCEPRICE_ISSET_ID = 4;
7351 rajveer 129
  private static final int __ABSOLUTEMINPRICE_ISSET_ID = 5;
130
  private static final int __FREEBIEITEMID_ISSET_ID = 6;
131
  private BitSet __isset_bit_vector = new BitSet(7);
7256 rajveer 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("itemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
137
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
138
    tmpMap.put(_Fields.RECOMMENDED_PRICE, new org.apache.thrift.meta_data.FieldMetaData("recommendedPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
139
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
140
    tmpMap.put(_Fields.MIN_PRICE, new org.apache.thrift.meta_data.FieldMetaData("minPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
141
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
142
    tmpMap.put(_Fields.MAX_PRICE, new org.apache.thrift.meta_data.FieldMetaData("maxPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
143
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
144
    tmpMap.put(_Fields.MIN_ADVANCE_PRICE, new org.apache.thrift.meta_data.FieldMetaData("minAdvancePrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
145
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
7351 rajveer 146
    tmpMap.put(_Fields.ABSOLUTE_MIN_PRICE, new org.apache.thrift.meta_data.FieldMetaData("absoluteMinPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
147
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
7308 rajveer 148
    tmpMap.put(_Fields.FREEBIE_ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("freebieItemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
149
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
150
    tmpMap.put(_Fields.BEST_DEAL_TEXT, new org.apache.thrift.meta_data.FieldMetaData("bestDealText", org.apache.thrift.TFieldRequirementType.DEFAULT, 
151
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
7256 rajveer 152
    metaDataMap = Collections.unmodifiableMap(tmpMap);
153
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(StorePricing.class, metaDataMap);
154
  }
155
 
156
  public StorePricing() {
157
  }
158
 
159
  public StorePricing(
160
    long itemId,
161
    double recommendedPrice,
162
    double minPrice,
163
    double maxPrice,
7308 rajveer 164
    double minAdvancePrice,
7351 rajveer 165
    double absoluteMinPrice,
7308 rajveer 166
    long freebieItemId,
167
    String bestDealText)
7256 rajveer 168
  {
169
    this();
170
    this.itemId = itemId;
171
    setItemIdIsSet(true);
172
    this.recommendedPrice = recommendedPrice;
173
    setRecommendedPriceIsSet(true);
174
    this.minPrice = minPrice;
175
    setMinPriceIsSet(true);
176
    this.maxPrice = maxPrice;
177
    setMaxPriceIsSet(true);
178
    this.minAdvancePrice = minAdvancePrice;
179
    setMinAdvancePriceIsSet(true);
7351 rajveer 180
    this.absoluteMinPrice = absoluteMinPrice;
181
    setAbsoluteMinPriceIsSet(true);
7308 rajveer 182
    this.freebieItemId = freebieItemId;
183
    setFreebieItemIdIsSet(true);
184
    this.bestDealText = bestDealText;
7256 rajveer 185
  }
186
 
187
  /**
188
   * Performs a deep copy on <i>other</i>.
189
   */
190
  public StorePricing(StorePricing other) {
191
    __isset_bit_vector.clear();
192
    __isset_bit_vector.or(other.__isset_bit_vector);
193
    this.itemId = other.itemId;
194
    this.recommendedPrice = other.recommendedPrice;
195
    this.minPrice = other.minPrice;
196
    this.maxPrice = other.maxPrice;
197
    this.minAdvancePrice = other.minAdvancePrice;
7351 rajveer 198
    this.absoluteMinPrice = other.absoluteMinPrice;
7308 rajveer 199
    this.freebieItemId = other.freebieItemId;
200
    if (other.isSetBestDealText()) {
201
      this.bestDealText = other.bestDealText;
202
    }
7256 rajveer 203
  }
204
 
205
  public StorePricing deepCopy() {
206
    return new StorePricing(this);
207
  }
208
 
209
  @Override
210
  public void clear() {
211
    setItemIdIsSet(false);
212
    this.itemId = 0;
213
    setRecommendedPriceIsSet(false);
214
    this.recommendedPrice = 0.0;
215
    setMinPriceIsSet(false);
216
    this.minPrice = 0.0;
217
    setMaxPriceIsSet(false);
218
    this.maxPrice = 0.0;
219
    setMinAdvancePriceIsSet(false);
220
    this.minAdvancePrice = 0.0;
7351 rajveer 221
    setAbsoluteMinPriceIsSet(false);
222
    this.absoluteMinPrice = 0.0;
7308 rajveer 223
    setFreebieItemIdIsSet(false);
224
    this.freebieItemId = 0;
225
    this.bestDealText = null;
7256 rajveer 226
  }
227
 
228
  public long getItemId() {
229
    return this.itemId;
230
  }
231
 
232
  public void setItemId(long itemId) {
233
    this.itemId = itemId;
234
    setItemIdIsSet(true);
235
  }
236
 
237
  public void unsetItemId() {
238
    __isset_bit_vector.clear(__ITEMID_ISSET_ID);
239
  }
240
 
241
  /** Returns true if field itemId is set (has been assigned a value) and false otherwise */
242
  public boolean isSetItemId() {
243
    return __isset_bit_vector.get(__ITEMID_ISSET_ID);
244
  }
245
 
246
  public void setItemIdIsSet(boolean value) {
247
    __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
248
  }
249
 
250
  public double getRecommendedPrice() {
251
    return this.recommendedPrice;
252
  }
253
 
254
  public void setRecommendedPrice(double recommendedPrice) {
255
    this.recommendedPrice = recommendedPrice;
256
    setRecommendedPriceIsSet(true);
257
  }
258
 
259
  public void unsetRecommendedPrice() {
260
    __isset_bit_vector.clear(__RECOMMENDEDPRICE_ISSET_ID);
261
  }
262
 
263
  /** Returns true if field recommendedPrice is set (has been assigned a value) and false otherwise */
264
  public boolean isSetRecommendedPrice() {
265
    return __isset_bit_vector.get(__RECOMMENDEDPRICE_ISSET_ID);
266
  }
267
 
268
  public void setRecommendedPriceIsSet(boolean value) {
269
    __isset_bit_vector.set(__RECOMMENDEDPRICE_ISSET_ID, value);
270
  }
271
 
272
  public double getMinPrice() {
273
    return this.minPrice;
274
  }
275
 
276
  public void setMinPrice(double minPrice) {
277
    this.minPrice = minPrice;
278
    setMinPriceIsSet(true);
279
  }
280
 
281
  public void unsetMinPrice() {
282
    __isset_bit_vector.clear(__MINPRICE_ISSET_ID);
283
  }
284
 
285
  /** Returns true if field minPrice is set (has been assigned a value) and false otherwise */
286
  public boolean isSetMinPrice() {
287
    return __isset_bit_vector.get(__MINPRICE_ISSET_ID);
288
  }
289
 
290
  public void setMinPriceIsSet(boolean value) {
291
    __isset_bit_vector.set(__MINPRICE_ISSET_ID, value);
292
  }
293
 
294
  public double getMaxPrice() {
295
    return this.maxPrice;
296
  }
297
 
298
  public void setMaxPrice(double maxPrice) {
299
    this.maxPrice = maxPrice;
300
    setMaxPriceIsSet(true);
301
  }
302
 
303
  public void unsetMaxPrice() {
304
    __isset_bit_vector.clear(__MAXPRICE_ISSET_ID);
305
  }
306
 
307
  /** Returns true if field maxPrice is set (has been assigned a value) and false otherwise */
308
  public boolean isSetMaxPrice() {
309
    return __isset_bit_vector.get(__MAXPRICE_ISSET_ID);
310
  }
311
 
312
  public void setMaxPriceIsSet(boolean value) {
313
    __isset_bit_vector.set(__MAXPRICE_ISSET_ID, value);
314
  }
315
 
316
  public double getMinAdvancePrice() {
317
    return this.minAdvancePrice;
318
  }
319
 
320
  public void setMinAdvancePrice(double minAdvancePrice) {
321
    this.minAdvancePrice = minAdvancePrice;
322
    setMinAdvancePriceIsSet(true);
323
  }
324
 
325
  public void unsetMinAdvancePrice() {
326
    __isset_bit_vector.clear(__MINADVANCEPRICE_ISSET_ID);
327
  }
328
 
329
  /** Returns true if field minAdvancePrice is set (has been assigned a value) and false otherwise */
330
  public boolean isSetMinAdvancePrice() {
331
    return __isset_bit_vector.get(__MINADVANCEPRICE_ISSET_ID);
332
  }
333
 
334
  public void setMinAdvancePriceIsSet(boolean value) {
335
    __isset_bit_vector.set(__MINADVANCEPRICE_ISSET_ID, value);
336
  }
337
 
7351 rajveer 338
  public double getAbsoluteMinPrice() {
339
    return this.absoluteMinPrice;
340
  }
341
 
342
  public void setAbsoluteMinPrice(double absoluteMinPrice) {
343
    this.absoluteMinPrice = absoluteMinPrice;
344
    setAbsoluteMinPriceIsSet(true);
345
  }
346
 
347
  public void unsetAbsoluteMinPrice() {
348
    __isset_bit_vector.clear(__ABSOLUTEMINPRICE_ISSET_ID);
349
  }
350
 
351
  /** Returns true if field absoluteMinPrice is set (has been assigned a value) and false otherwise */
352
  public boolean isSetAbsoluteMinPrice() {
353
    return __isset_bit_vector.get(__ABSOLUTEMINPRICE_ISSET_ID);
354
  }
355
 
356
  public void setAbsoluteMinPriceIsSet(boolean value) {
357
    __isset_bit_vector.set(__ABSOLUTEMINPRICE_ISSET_ID, value);
358
  }
359
 
7308 rajveer 360
  public long getFreebieItemId() {
361
    return this.freebieItemId;
362
  }
363
 
364
  public void setFreebieItemId(long freebieItemId) {
365
    this.freebieItemId = freebieItemId;
366
    setFreebieItemIdIsSet(true);
367
  }
368
 
369
  public void unsetFreebieItemId() {
370
    __isset_bit_vector.clear(__FREEBIEITEMID_ISSET_ID);
371
  }
372
 
373
  /** Returns true if field freebieItemId is set (has been assigned a value) and false otherwise */
374
  public boolean isSetFreebieItemId() {
375
    return __isset_bit_vector.get(__FREEBIEITEMID_ISSET_ID);
376
  }
377
 
378
  public void setFreebieItemIdIsSet(boolean value) {
379
    __isset_bit_vector.set(__FREEBIEITEMID_ISSET_ID, value);
380
  }
381
 
382
  public String getBestDealText() {
383
    return this.bestDealText;
384
  }
385
 
386
  public void setBestDealText(String bestDealText) {
387
    this.bestDealText = bestDealText;
388
  }
389
 
390
  public void unsetBestDealText() {
391
    this.bestDealText = null;
392
  }
393
 
394
  /** Returns true if field bestDealText is set (has been assigned a value) and false otherwise */
395
  public boolean isSetBestDealText() {
396
    return this.bestDealText != null;
397
  }
398
 
399
  public void setBestDealTextIsSet(boolean value) {
400
    if (!value) {
401
      this.bestDealText = null;
402
    }
403
  }
404
 
7256 rajveer 405
  public void setFieldValue(_Fields field, Object value) {
406
    switch (field) {
407
    case ITEM_ID:
408
      if (value == null) {
409
        unsetItemId();
410
      } else {
411
        setItemId((Long)value);
412
      }
413
      break;
414
 
415
    case RECOMMENDED_PRICE:
416
      if (value == null) {
417
        unsetRecommendedPrice();
418
      } else {
419
        setRecommendedPrice((Double)value);
420
      }
421
      break;
422
 
423
    case MIN_PRICE:
424
      if (value == null) {
425
        unsetMinPrice();
426
      } else {
427
        setMinPrice((Double)value);
428
      }
429
      break;
430
 
431
    case MAX_PRICE:
432
      if (value == null) {
433
        unsetMaxPrice();
434
      } else {
435
        setMaxPrice((Double)value);
436
      }
437
      break;
438
 
439
    case MIN_ADVANCE_PRICE:
440
      if (value == null) {
441
        unsetMinAdvancePrice();
442
      } else {
443
        setMinAdvancePrice((Double)value);
444
      }
445
      break;
446
 
7351 rajveer 447
    case ABSOLUTE_MIN_PRICE:
448
      if (value == null) {
449
        unsetAbsoluteMinPrice();
450
      } else {
451
        setAbsoluteMinPrice((Double)value);
452
      }
453
      break;
454
 
7308 rajveer 455
    case FREEBIE_ITEM_ID:
456
      if (value == null) {
457
        unsetFreebieItemId();
458
      } else {
459
        setFreebieItemId((Long)value);
460
      }
461
      break;
462
 
463
    case BEST_DEAL_TEXT:
464
      if (value == null) {
465
        unsetBestDealText();
466
      } else {
467
        setBestDealText((String)value);
468
      }
469
      break;
470
 
7256 rajveer 471
    }
472
  }
473
 
474
  public Object getFieldValue(_Fields field) {
475
    switch (field) {
476
    case ITEM_ID:
477
      return Long.valueOf(getItemId());
478
 
479
    case RECOMMENDED_PRICE:
480
      return Double.valueOf(getRecommendedPrice());
481
 
482
    case MIN_PRICE:
483
      return Double.valueOf(getMinPrice());
484
 
485
    case MAX_PRICE:
486
      return Double.valueOf(getMaxPrice());
487
 
488
    case MIN_ADVANCE_PRICE:
489
      return Double.valueOf(getMinAdvancePrice());
490
 
7351 rajveer 491
    case ABSOLUTE_MIN_PRICE:
492
      return Double.valueOf(getAbsoluteMinPrice());
493
 
7308 rajveer 494
    case FREEBIE_ITEM_ID:
495
      return Long.valueOf(getFreebieItemId());
496
 
497
    case BEST_DEAL_TEXT:
498
      return getBestDealText();
499
 
7256 rajveer 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 isSetItemId();
513
    case RECOMMENDED_PRICE:
514
      return isSetRecommendedPrice();
515
    case MIN_PRICE:
516
      return isSetMinPrice();
517
    case MAX_PRICE:
518
      return isSetMaxPrice();
519
    case MIN_ADVANCE_PRICE:
520
      return isSetMinAdvancePrice();
7351 rajveer 521
    case ABSOLUTE_MIN_PRICE:
522
      return isSetAbsoluteMinPrice();
7308 rajveer 523
    case FREEBIE_ITEM_ID:
524
      return isSetFreebieItemId();
525
    case BEST_DEAL_TEXT:
526
      return isSetBestDealText();
7256 rajveer 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 StorePricing)
536
      return this.equals((StorePricing)that);
537
    return false;
538
  }
539
 
540
  public boolean equals(StorePricing that) {
541
    if (that == null)
542
      return false;
543
 
544
    boolean this_present_itemId = true;
545
    boolean that_present_itemId = true;
546
    if (this_present_itemId || that_present_itemId) {
547
      if (!(this_present_itemId && that_present_itemId))
548
        return false;
549
      if (this.itemId != that.itemId)
550
        return false;
551
    }
552
 
553
    boolean this_present_recommendedPrice = true;
554
    boolean that_present_recommendedPrice = true;
555
    if (this_present_recommendedPrice || that_present_recommendedPrice) {
556
      if (!(this_present_recommendedPrice && that_present_recommendedPrice))
557
        return false;
558
      if (this.recommendedPrice != that.recommendedPrice)
559
        return false;
560
    }
561
 
562
    boolean this_present_minPrice = true;
563
    boolean that_present_minPrice = true;
564
    if (this_present_minPrice || that_present_minPrice) {
565
      if (!(this_present_minPrice && that_present_minPrice))
566
        return false;
567
      if (this.minPrice != that.minPrice)
568
        return false;
569
    }
570
 
571
    boolean this_present_maxPrice = true;
572
    boolean that_present_maxPrice = true;
573
    if (this_present_maxPrice || that_present_maxPrice) {
574
      if (!(this_present_maxPrice && that_present_maxPrice))
575
        return false;
576
      if (this.maxPrice != that.maxPrice)
577
        return false;
578
    }
579
 
580
    boolean this_present_minAdvancePrice = true;
581
    boolean that_present_minAdvancePrice = true;
582
    if (this_present_minAdvancePrice || that_present_minAdvancePrice) {
583
      if (!(this_present_minAdvancePrice && that_present_minAdvancePrice))
584
        return false;
585
      if (this.minAdvancePrice != that.minAdvancePrice)
586
        return false;
587
    }
588
 
7351 rajveer 589
    boolean this_present_absoluteMinPrice = true;
590
    boolean that_present_absoluteMinPrice = true;
591
    if (this_present_absoluteMinPrice || that_present_absoluteMinPrice) {
592
      if (!(this_present_absoluteMinPrice && that_present_absoluteMinPrice))
593
        return false;
594
      if (this.absoluteMinPrice != that.absoluteMinPrice)
595
        return false;
596
    }
597
 
7308 rajveer 598
    boolean this_present_freebieItemId = true;
599
    boolean that_present_freebieItemId = true;
600
    if (this_present_freebieItemId || that_present_freebieItemId) {
601
      if (!(this_present_freebieItemId && that_present_freebieItemId))
602
        return false;
603
      if (this.freebieItemId != that.freebieItemId)
604
        return false;
605
    }
606
 
607
    boolean this_present_bestDealText = true && this.isSetBestDealText();
608
    boolean that_present_bestDealText = true && that.isSetBestDealText();
609
    if (this_present_bestDealText || that_present_bestDealText) {
610
      if (!(this_present_bestDealText && that_present_bestDealText))
611
        return false;
612
      if (!this.bestDealText.equals(that.bestDealText))
613
        return false;
614
    }
615
 
7256 rajveer 616
    return true;
617
  }
618
 
619
  @Override
620
  public int hashCode() {
621
    return 0;
622
  }
623
 
624
  public int compareTo(StorePricing other) {
625
    if (!getClass().equals(other.getClass())) {
626
      return getClass().getName().compareTo(other.getClass().getName());
627
    }
628
 
629
    int lastComparison = 0;
630
    StorePricing typedOther = (StorePricing)other;
631
 
632
    lastComparison = Boolean.valueOf(isSetItemId()).compareTo(typedOther.isSetItemId());
633
    if (lastComparison != 0) {
634
      return lastComparison;
635
    }
636
    if (isSetItemId()) {
637
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemId, typedOther.itemId);
638
      if (lastComparison != 0) {
639
        return lastComparison;
640
      }
641
    }
642
    lastComparison = Boolean.valueOf(isSetRecommendedPrice()).compareTo(typedOther.isSetRecommendedPrice());
643
    if (lastComparison != 0) {
644
      return lastComparison;
645
    }
646
    if (isSetRecommendedPrice()) {
647
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.recommendedPrice, typedOther.recommendedPrice);
648
      if (lastComparison != 0) {
649
        return lastComparison;
650
      }
651
    }
652
    lastComparison = Boolean.valueOf(isSetMinPrice()).compareTo(typedOther.isSetMinPrice());
653
    if (lastComparison != 0) {
654
      return lastComparison;
655
    }
656
    if (isSetMinPrice()) {
657
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.minPrice, typedOther.minPrice);
658
      if (lastComparison != 0) {
659
        return lastComparison;
660
      }
661
    }
662
    lastComparison = Boolean.valueOf(isSetMaxPrice()).compareTo(typedOther.isSetMaxPrice());
663
    if (lastComparison != 0) {
664
      return lastComparison;
665
    }
666
    if (isSetMaxPrice()) {
667
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxPrice, typedOther.maxPrice);
668
      if (lastComparison != 0) {
669
        return lastComparison;
670
      }
671
    }
672
    lastComparison = Boolean.valueOf(isSetMinAdvancePrice()).compareTo(typedOther.isSetMinAdvancePrice());
673
    if (lastComparison != 0) {
674
      return lastComparison;
675
    }
676
    if (isSetMinAdvancePrice()) {
677
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.minAdvancePrice, typedOther.minAdvancePrice);
678
      if (lastComparison != 0) {
679
        return lastComparison;
680
      }
681
    }
7351 rajveer 682
    lastComparison = Boolean.valueOf(isSetAbsoluteMinPrice()).compareTo(typedOther.isSetAbsoluteMinPrice());
683
    if (lastComparison != 0) {
684
      return lastComparison;
685
    }
686
    if (isSetAbsoluteMinPrice()) {
687
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.absoluteMinPrice, typedOther.absoluteMinPrice);
688
      if (lastComparison != 0) {
689
        return lastComparison;
690
      }
691
    }
7308 rajveer 692
    lastComparison = Boolean.valueOf(isSetFreebieItemId()).compareTo(typedOther.isSetFreebieItemId());
693
    if (lastComparison != 0) {
694
      return lastComparison;
695
    }
696
    if (isSetFreebieItemId()) {
697
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.freebieItemId, typedOther.freebieItemId);
698
      if (lastComparison != 0) {
699
        return lastComparison;
700
      }
701
    }
702
    lastComparison = Boolean.valueOf(isSetBestDealText()).compareTo(typedOther.isSetBestDealText());
703
    if (lastComparison != 0) {
704
      return lastComparison;
705
    }
706
    if (isSetBestDealText()) {
707
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bestDealText, typedOther.bestDealText);
708
      if (lastComparison != 0) {
709
        return lastComparison;
710
      }
711
    }
7256 rajveer 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.itemId = iprot.readI64();
732
            setItemIdIsSet(true);
733
          } else { 
734
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
735
          }
736
          break;
737
        case 2: // RECOMMENDED_PRICE
738
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
739
            this.recommendedPrice = iprot.readDouble();
740
            setRecommendedPriceIsSet(true);
741
          } else { 
742
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
743
          }
744
          break;
745
        case 3: // MIN_PRICE
746
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
747
            this.minPrice = iprot.readDouble();
748
            setMinPriceIsSet(true);
749
          } else { 
750
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
751
          }
752
          break;
753
        case 4: // MAX_PRICE
754
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
755
            this.maxPrice = iprot.readDouble();
756
            setMaxPriceIsSet(true);
757
          } else { 
758
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
759
          }
760
          break;
761
        case 5: // MIN_ADVANCE_PRICE
762
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
763
            this.minAdvancePrice = iprot.readDouble();
764
            setMinAdvancePriceIsSet(true);
765
          } else { 
766
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
767
          }
768
          break;
7351 rajveer 769
        case 6: // ABSOLUTE_MIN_PRICE
770
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
771
            this.absoluteMinPrice = iprot.readDouble();
772
            setAbsoluteMinPriceIsSet(true);
773
          } else { 
774
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
775
          }
776
          break;
777
        case 7: // FREEBIE_ITEM_ID
7308 rajveer 778
          if (field.type == org.apache.thrift.protocol.TType.I64) {
779
            this.freebieItemId = iprot.readI64();
780
            setFreebieItemIdIsSet(true);
781
          } else { 
782
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
783
          }
784
          break;
7351 rajveer 785
        case 8: // BEST_DEAL_TEXT
7308 rajveer 786
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
787
            this.bestDealText = iprot.readString();
788
          } else { 
789
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
790
          }
791
          break;
7256 rajveer 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.itemId);
807
    oprot.writeFieldEnd();
808
    oprot.writeFieldBegin(RECOMMENDED_PRICE_FIELD_DESC);
809
    oprot.writeDouble(this.recommendedPrice);
810
    oprot.writeFieldEnd();
811
    oprot.writeFieldBegin(MIN_PRICE_FIELD_DESC);
812
    oprot.writeDouble(this.minPrice);
813
    oprot.writeFieldEnd();
814
    oprot.writeFieldBegin(MAX_PRICE_FIELD_DESC);
815
    oprot.writeDouble(this.maxPrice);
816
    oprot.writeFieldEnd();
817
    oprot.writeFieldBegin(MIN_ADVANCE_PRICE_FIELD_DESC);
818
    oprot.writeDouble(this.minAdvancePrice);
819
    oprot.writeFieldEnd();
7351 rajveer 820
    oprot.writeFieldBegin(ABSOLUTE_MIN_PRICE_FIELD_DESC);
821
    oprot.writeDouble(this.absoluteMinPrice);
822
    oprot.writeFieldEnd();
7308 rajveer 823
    oprot.writeFieldBegin(FREEBIE_ITEM_ID_FIELD_DESC);
824
    oprot.writeI64(this.freebieItemId);
825
    oprot.writeFieldEnd();
826
    if (this.bestDealText != null) {
827
      oprot.writeFieldBegin(BEST_DEAL_TEXT_FIELD_DESC);
828
      oprot.writeString(this.bestDealText);
829
      oprot.writeFieldEnd();
830
    }
7256 rajveer 831
    oprot.writeFieldStop();
832
    oprot.writeStructEnd();
833
  }
834
 
835
  @Override
836
  public String toString() {
837
    StringBuilder sb = new StringBuilder("StorePricing(");
838
    boolean first = true;
839
 
840
    sb.append("itemId:");
841
    sb.append(this.itemId);
842
    first = false;
843
    if (!first) sb.append(", ");
844
    sb.append("recommendedPrice:");
845
    sb.append(this.recommendedPrice);
846
    first = false;
847
    if (!first) sb.append(", ");
848
    sb.append("minPrice:");
849
    sb.append(this.minPrice);
850
    first = false;
851
    if (!first) sb.append(", ");
852
    sb.append("maxPrice:");
853
    sb.append(this.maxPrice);
854
    first = false;
855
    if (!first) sb.append(", ");
856
    sb.append("minAdvancePrice:");
857
    sb.append(this.minAdvancePrice);
858
    first = false;
7308 rajveer 859
    if (!first) sb.append(", ");
7351 rajveer 860
    sb.append("absoluteMinPrice:");
861
    sb.append(this.absoluteMinPrice);
862
    first = false;
863
    if (!first) sb.append(", ");
7308 rajveer 864
    sb.append("freebieItemId:");
865
    sb.append(this.freebieItemId);
866
    first = false;
867
    if (!first) sb.append(", ");
868
    sb.append("bestDealText:");
869
    if (this.bestDealText == null) {
870
      sb.append("null");
871
    } else {
872
      sb.append(this.bestDealText);
873
    }
874
    first = false;
7256 rajveer 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