Subversion Repositories SmartDukaan

Rev

Rev 14384 | Rev 15903 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
14384 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.dtr;
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
/**
24
 * Objects
25
 */
26
public class LivePricing implements org.apache.thrift.TBase<LivePricing, LivePricing._Fields>, java.io.Serializable, Cloneable {
27
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("LivePricing");
28
 
29
  private static final org.apache.thrift.protocol.TField _ID_FIELD_DESC = new org.apache.thrift.protocol.TField("_id", org.apache.thrift.protocol.TType.I64, (short)1);
30
  private static final org.apache.thrift.protocol.TField AVAILABLE_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("available_price", org.apache.thrift.protocol.TType.DOUBLE, (short)2);
31
  private static final org.apache.thrift.protocol.TField MARKET_PLACE_URL_FIELD_DESC = new org.apache.thrift.protocol.TField("marketPlaceUrl", org.apache.thrift.protocol.TType.STRING, (short)3);
32
  private static final org.apache.thrift.protocol.TField IN_STOCK_FIELD_DESC = new org.apache.thrift.protocol.TField("in_stock", org.apache.thrift.protocol.TType.I64, (short)4);
33
  private static final org.apache.thrift.protocol.TField SOURCE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("source_id", org.apache.thrift.protocol.TType.I64, (short)5);
34
  private static final org.apache.thrift.protocol.TField SOURCE_PRODUCT_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("source_product_name", org.apache.thrift.protocol.TType.STRING, (short)6);
35
  private static final org.apache.thrift.protocol.TField THUMBNAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("thumbnail", org.apache.thrift.protocol.TType.STRING, (short)7);
14764 kshitij.so 36
  private static final org.apache.thrift.protocol.TField CASH_BACK_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("cash_back_type", org.apache.thrift.protocol.TType.I64, (short)8);
37
  private static final org.apache.thrift.protocol.TField CASH_BACK_FIELD_DESC = new org.apache.thrift.protocol.TField("cash_back", org.apache.thrift.protocol.TType.DOUBLE, (short)9);
14384 kshitij.so 38
 
39
  private long _id; // required
40
  private double available_price; // required
41
  private String marketPlaceUrl; // required
42
  private long in_stock; // required
43
  private long source_id; // required
44
  private String source_product_name; // required
45
  private String thumbnail; // required
14764 kshitij.so 46
  private long cash_back_type; // required
47
  private double cash_back; // required
14384 kshitij.so 48
 
49
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
50
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
51
    _ID((short)1, "_id"),
52
    AVAILABLE_PRICE((short)2, "available_price"),
53
    MARKET_PLACE_URL((short)3, "marketPlaceUrl"),
54
    IN_STOCK((short)4, "in_stock"),
55
    SOURCE_ID((short)5, "source_id"),
56
    SOURCE_PRODUCT_NAME((short)6, "source_product_name"),
14764 kshitij.so 57
    THUMBNAIL((short)7, "thumbnail"),
58
    CASH_BACK_TYPE((short)8, "cash_back_type"),
59
    CASH_BACK((short)9, "cash_back");
14384 kshitij.so 60
 
61
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
62
 
63
    static {
64
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
65
        byName.put(field.getFieldName(), field);
66
      }
67
    }
68
 
69
    /**
70
     * Find the _Fields constant that matches fieldId, or null if its not found.
71
     */
72
    public static _Fields findByThriftId(int fieldId) {
73
      switch(fieldId) {
74
        case 1: // _ID
75
          return _ID;
76
        case 2: // AVAILABLE_PRICE
77
          return AVAILABLE_PRICE;
78
        case 3: // MARKET_PLACE_URL
79
          return MARKET_PLACE_URL;
80
        case 4: // IN_STOCK
81
          return IN_STOCK;
82
        case 5: // SOURCE_ID
83
          return SOURCE_ID;
84
        case 6: // SOURCE_PRODUCT_NAME
85
          return SOURCE_PRODUCT_NAME;
86
        case 7: // THUMBNAIL
87
          return THUMBNAIL;
14764 kshitij.so 88
        case 8: // CASH_BACK_TYPE
89
          return CASH_BACK_TYPE;
90
        case 9: // CASH_BACK
91
          return CASH_BACK;
14384 kshitij.so 92
        default:
93
          return null;
94
      }
95
    }
96
 
97
    /**
98
     * Find the _Fields constant that matches fieldId, throwing an exception
99
     * if it is not found.
100
     */
101
    public static _Fields findByThriftIdOrThrow(int fieldId) {
102
      _Fields fields = findByThriftId(fieldId);
103
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
104
      return fields;
105
    }
106
 
107
    /**
108
     * Find the _Fields constant that matches name, or null if its not found.
109
     */
110
    public static _Fields findByName(String name) {
111
      return byName.get(name);
112
    }
113
 
114
    private final short _thriftId;
115
    private final String _fieldName;
116
 
117
    _Fields(short thriftId, String fieldName) {
118
      _thriftId = thriftId;
119
      _fieldName = fieldName;
120
    }
121
 
122
    public short getThriftFieldId() {
123
      return _thriftId;
124
    }
125
 
126
    public String getFieldName() {
127
      return _fieldName;
128
    }
129
  }
130
 
131
  // isset id assignments
132
  private static final int ___ID_ISSET_ID = 0;
133
  private static final int __AVAILABLE_PRICE_ISSET_ID = 1;
134
  private static final int __IN_STOCK_ISSET_ID = 2;
135
  private static final int __SOURCE_ID_ISSET_ID = 3;
14764 kshitij.so 136
  private static final int __CASH_BACK_TYPE_ISSET_ID = 4;
137
  private static final int __CASH_BACK_ISSET_ID = 5;
138
  private BitSet __isset_bit_vector = new BitSet(6);
14384 kshitij.so 139
 
140
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
141
  static {
142
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
143
    tmpMap.put(_Fields._ID, new org.apache.thrift.meta_data.FieldMetaData("_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
144
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
145
    tmpMap.put(_Fields.AVAILABLE_PRICE, new org.apache.thrift.meta_data.FieldMetaData("available_price", org.apache.thrift.TFieldRequirementType.DEFAULT, 
146
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
147
    tmpMap.put(_Fields.MARKET_PLACE_URL, new org.apache.thrift.meta_data.FieldMetaData("marketPlaceUrl", org.apache.thrift.TFieldRequirementType.DEFAULT, 
148
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
149
    tmpMap.put(_Fields.IN_STOCK, new org.apache.thrift.meta_data.FieldMetaData("in_stock", org.apache.thrift.TFieldRequirementType.DEFAULT, 
150
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
151
    tmpMap.put(_Fields.SOURCE_ID, new org.apache.thrift.meta_data.FieldMetaData("source_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
152
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
153
    tmpMap.put(_Fields.SOURCE_PRODUCT_NAME, new org.apache.thrift.meta_data.FieldMetaData("source_product_name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
154
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
155
    tmpMap.put(_Fields.THUMBNAIL, new org.apache.thrift.meta_data.FieldMetaData("thumbnail", org.apache.thrift.TFieldRequirementType.DEFAULT, 
156
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
14764 kshitij.so 157
    tmpMap.put(_Fields.CASH_BACK_TYPE, new org.apache.thrift.meta_data.FieldMetaData("cash_back_type", org.apache.thrift.TFieldRequirementType.DEFAULT, 
158
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
159
    tmpMap.put(_Fields.CASH_BACK, new org.apache.thrift.meta_data.FieldMetaData("cash_back", org.apache.thrift.TFieldRequirementType.DEFAULT, 
160
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
14384 kshitij.so 161
    metaDataMap = Collections.unmodifiableMap(tmpMap);
162
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(LivePricing.class, metaDataMap);
163
  }
164
 
165
  public LivePricing() {
166
  }
167
 
168
  public LivePricing(
169
    long _id,
170
    double available_price,
171
    String marketPlaceUrl,
172
    long in_stock,
173
    long source_id,
174
    String source_product_name,
14764 kshitij.so 175
    String thumbnail,
176
    long cash_back_type,
177
    double cash_back)
14384 kshitij.so 178
  {
179
    this();
180
    this._id = _id;
181
    set_idIsSet(true);
182
    this.available_price = available_price;
183
    setAvailable_priceIsSet(true);
184
    this.marketPlaceUrl = marketPlaceUrl;
185
    this.in_stock = in_stock;
186
    setIn_stockIsSet(true);
187
    this.source_id = source_id;
188
    setSource_idIsSet(true);
189
    this.source_product_name = source_product_name;
190
    this.thumbnail = thumbnail;
14764 kshitij.so 191
    this.cash_back_type = cash_back_type;
192
    setCash_back_typeIsSet(true);
193
    this.cash_back = cash_back;
194
    setCash_backIsSet(true);
14384 kshitij.so 195
  }
196
 
197
  /**
198
   * Performs a deep copy on <i>other</i>.
199
   */
200
  public LivePricing(LivePricing other) {
201
    __isset_bit_vector.clear();
202
    __isset_bit_vector.or(other.__isset_bit_vector);
203
    this._id = other._id;
204
    this.available_price = other.available_price;
205
    if (other.isSetMarketPlaceUrl()) {
206
      this.marketPlaceUrl = other.marketPlaceUrl;
207
    }
208
    this.in_stock = other.in_stock;
209
    this.source_id = other.source_id;
210
    if (other.isSetSource_product_name()) {
211
      this.source_product_name = other.source_product_name;
212
    }
213
    if (other.isSetThumbnail()) {
214
      this.thumbnail = other.thumbnail;
215
    }
14764 kshitij.so 216
    this.cash_back_type = other.cash_back_type;
217
    this.cash_back = other.cash_back;
14384 kshitij.so 218
  }
219
 
220
  public LivePricing deepCopy() {
221
    return new LivePricing(this);
222
  }
223
 
224
  @Override
225
  public void clear() {
226
    set_idIsSet(false);
227
    this._id = 0;
228
    setAvailable_priceIsSet(false);
229
    this.available_price = 0.0;
230
    this.marketPlaceUrl = null;
231
    setIn_stockIsSet(false);
232
    this.in_stock = 0;
233
    setSource_idIsSet(false);
234
    this.source_id = 0;
235
    this.source_product_name = null;
236
    this.thumbnail = null;
14764 kshitij.so 237
    setCash_back_typeIsSet(false);
238
    this.cash_back_type = 0;
239
    setCash_backIsSet(false);
240
    this.cash_back = 0.0;
14384 kshitij.so 241
  }
242
 
243
  public long get_id() {
244
    return this._id;
245
  }
246
 
247
  public void set_id(long _id) {
248
    this._id = _id;
249
    set_idIsSet(true);
250
  }
251
 
252
  public void unset_id() {
253
    __isset_bit_vector.clear(___ID_ISSET_ID);
254
  }
255
 
256
  /** Returns true if field _id is set (has been assigned a value) and false otherwise */
257
  public boolean isSet_id() {
258
    return __isset_bit_vector.get(___ID_ISSET_ID);
259
  }
260
 
261
  public void set_idIsSet(boolean value) {
262
    __isset_bit_vector.set(___ID_ISSET_ID, value);
263
  }
264
 
265
  public double getAvailable_price() {
266
    return this.available_price;
267
  }
268
 
269
  public void setAvailable_price(double available_price) {
270
    this.available_price = available_price;
271
    setAvailable_priceIsSet(true);
272
  }
273
 
274
  public void unsetAvailable_price() {
275
    __isset_bit_vector.clear(__AVAILABLE_PRICE_ISSET_ID);
276
  }
277
 
278
  /** Returns true if field available_price is set (has been assigned a value) and false otherwise */
279
  public boolean isSetAvailable_price() {
280
    return __isset_bit_vector.get(__AVAILABLE_PRICE_ISSET_ID);
281
  }
282
 
283
  public void setAvailable_priceIsSet(boolean value) {
284
    __isset_bit_vector.set(__AVAILABLE_PRICE_ISSET_ID, value);
285
  }
286
 
287
  public String getMarketPlaceUrl() {
288
    return this.marketPlaceUrl;
289
  }
290
 
291
  public void setMarketPlaceUrl(String marketPlaceUrl) {
292
    this.marketPlaceUrl = marketPlaceUrl;
293
  }
294
 
295
  public void unsetMarketPlaceUrl() {
296
    this.marketPlaceUrl = null;
297
  }
298
 
299
  /** Returns true if field marketPlaceUrl is set (has been assigned a value) and false otherwise */
300
  public boolean isSetMarketPlaceUrl() {
301
    return this.marketPlaceUrl != null;
302
  }
303
 
304
  public void setMarketPlaceUrlIsSet(boolean value) {
305
    if (!value) {
306
      this.marketPlaceUrl = null;
307
    }
308
  }
309
 
310
  public long getIn_stock() {
311
    return this.in_stock;
312
  }
313
 
314
  public void setIn_stock(long in_stock) {
315
    this.in_stock = in_stock;
316
    setIn_stockIsSet(true);
317
  }
318
 
319
  public void unsetIn_stock() {
320
    __isset_bit_vector.clear(__IN_STOCK_ISSET_ID);
321
  }
322
 
323
  /** Returns true if field in_stock is set (has been assigned a value) and false otherwise */
324
  public boolean isSetIn_stock() {
325
    return __isset_bit_vector.get(__IN_STOCK_ISSET_ID);
326
  }
327
 
328
  public void setIn_stockIsSet(boolean value) {
329
    __isset_bit_vector.set(__IN_STOCK_ISSET_ID, value);
330
  }
331
 
332
  public long getSource_id() {
333
    return this.source_id;
334
  }
335
 
336
  public void setSource_id(long source_id) {
337
    this.source_id = source_id;
338
    setSource_idIsSet(true);
339
  }
340
 
341
  public void unsetSource_id() {
342
    __isset_bit_vector.clear(__SOURCE_ID_ISSET_ID);
343
  }
344
 
345
  /** Returns true if field source_id is set (has been assigned a value) and false otherwise */
346
  public boolean isSetSource_id() {
347
    return __isset_bit_vector.get(__SOURCE_ID_ISSET_ID);
348
  }
349
 
350
  public void setSource_idIsSet(boolean value) {
351
    __isset_bit_vector.set(__SOURCE_ID_ISSET_ID, value);
352
  }
353
 
354
  public String getSource_product_name() {
355
    return this.source_product_name;
356
  }
357
 
358
  public void setSource_product_name(String source_product_name) {
359
    this.source_product_name = source_product_name;
360
  }
361
 
362
  public void unsetSource_product_name() {
363
    this.source_product_name = null;
364
  }
365
 
366
  /** Returns true if field source_product_name is set (has been assigned a value) and false otherwise */
367
  public boolean isSetSource_product_name() {
368
    return this.source_product_name != null;
369
  }
370
 
371
  public void setSource_product_nameIsSet(boolean value) {
372
    if (!value) {
373
      this.source_product_name = null;
374
    }
375
  }
376
 
377
  public String getThumbnail() {
378
    return this.thumbnail;
379
  }
380
 
381
  public void setThumbnail(String thumbnail) {
382
    this.thumbnail = thumbnail;
383
  }
384
 
385
  public void unsetThumbnail() {
386
    this.thumbnail = null;
387
  }
388
 
389
  /** Returns true if field thumbnail is set (has been assigned a value) and false otherwise */
390
  public boolean isSetThumbnail() {
391
    return this.thumbnail != null;
392
  }
393
 
394
  public void setThumbnailIsSet(boolean value) {
395
    if (!value) {
396
      this.thumbnail = null;
397
    }
398
  }
399
 
14764 kshitij.so 400
  public long getCash_back_type() {
401
    return this.cash_back_type;
402
  }
403
 
404
  public void setCash_back_type(long cash_back_type) {
405
    this.cash_back_type = cash_back_type;
406
    setCash_back_typeIsSet(true);
407
  }
408
 
409
  public void unsetCash_back_type() {
410
    __isset_bit_vector.clear(__CASH_BACK_TYPE_ISSET_ID);
411
  }
412
 
413
  /** Returns true if field cash_back_type is set (has been assigned a value) and false otherwise */
414
  public boolean isSetCash_back_type() {
415
    return __isset_bit_vector.get(__CASH_BACK_TYPE_ISSET_ID);
416
  }
417
 
418
  public void setCash_back_typeIsSet(boolean value) {
419
    __isset_bit_vector.set(__CASH_BACK_TYPE_ISSET_ID, value);
420
  }
421
 
422
  public double getCash_back() {
423
    return this.cash_back;
424
  }
425
 
426
  public void setCash_back(double cash_back) {
427
    this.cash_back = cash_back;
428
    setCash_backIsSet(true);
429
  }
430
 
431
  public void unsetCash_back() {
432
    __isset_bit_vector.clear(__CASH_BACK_ISSET_ID);
433
  }
434
 
435
  /** Returns true if field cash_back is set (has been assigned a value) and false otherwise */
436
  public boolean isSetCash_back() {
437
    return __isset_bit_vector.get(__CASH_BACK_ISSET_ID);
438
  }
439
 
440
  public void setCash_backIsSet(boolean value) {
441
    __isset_bit_vector.set(__CASH_BACK_ISSET_ID, value);
442
  }
443
 
14384 kshitij.so 444
  public void setFieldValue(_Fields field, Object value) {
445
    switch (field) {
446
    case _ID:
447
      if (value == null) {
448
        unset_id();
449
      } else {
450
        set_id((Long)value);
451
      }
452
      break;
453
 
454
    case AVAILABLE_PRICE:
455
      if (value == null) {
456
        unsetAvailable_price();
457
      } else {
458
        setAvailable_price((Double)value);
459
      }
460
      break;
461
 
462
    case MARKET_PLACE_URL:
463
      if (value == null) {
464
        unsetMarketPlaceUrl();
465
      } else {
466
        setMarketPlaceUrl((String)value);
467
      }
468
      break;
469
 
470
    case IN_STOCK:
471
      if (value == null) {
472
        unsetIn_stock();
473
      } else {
474
        setIn_stock((Long)value);
475
      }
476
      break;
477
 
478
    case SOURCE_ID:
479
      if (value == null) {
480
        unsetSource_id();
481
      } else {
482
        setSource_id((Long)value);
483
      }
484
      break;
485
 
486
    case SOURCE_PRODUCT_NAME:
487
      if (value == null) {
488
        unsetSource_product_name();
489
      } else {
490
        setSource_product_name((String)value);
491
      }
492
      break;
493
 
494
    case THUMBNAIL:
495
      if (value == null) {
496
        unsetThumbnail();
497
      } else {
498
        setThumbnail((String)value);
499
      }
500
      break;
501
 
14764 kshitij.so 502
    case CASH_BACK_TYPE:
503
      if (value == null) {
504
        unsetCash_back_type();
505
      } else {
506
        setCash_back_type((Long)value);
507
      }
508
      break;
509
 
510
    case CASH_BACK:
511
      if (value == null) {
512
        unsetCash_back();
513
      } else {
514
        setCash_back((Double)value);
515
      }
516
      break;
517
 
14384 kshitij.so 518
    }
519
  }
520
 
521
  public Object getFieldValue(_Fields field) {
522
    switch (field) {
523
    case _ID:
524
      return Long.valueOf(get_id());
525
 
526
    case AVAILABLE_PRICE:
527
      return Double.valueOf(getAvailable_price());
528
 
529
    case MARKET_PLACE_URL:
530
      return getMarketPlaceUrl();
531
 
532
    case IN_STOCK:
533
      return Long.valueOf(getIn_stock());
534
 
535
    case SOURCE_ID:
536
      return Long.valueOf(getSource_id());
537
 
538
    case SOURCE_PRODUCT_NAME:
539
      return getSource_product_name();
540
 
541
    case THUMBNAIL:
542
      return getThumbnail();
543
 
14764 kshitij.so 544
    case CASH_BACK_TYPE:
545
      return Long.valueOf(getCash_back_type());
546
 
547
    case CASH_BACK:
548
      return Double.valueOf(getCash_back());
549
 
14384 kshitij.so 550
    }
551
    throw new IllegalStateException();
552
  }
553
 
554
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
555
  public boolean isSet(_Fields field) {
556
    if (field == null) {
557
      throw new IllegalArgumentException();
558
    }
559
 
560
    switch (field) {
561
    case _ID:
562
      return isSet_id();
563
    case AVAILABLE_PRICE:
564
      return isSetAvailable_price();
565
    case MARKET_PLACE_URL:
566
      return isSetMarketPlaceUrl();
567
    case IN_STOCK:
568
      return isSetIn_stock();
569
    case SOURCE_ID:
570
      return isSetSource_id();
571
    case SOURCE_PRODUCT_NAME:
572
      return isSetSource_product_name();
573
    case THUMBNAIL:
574
      return isSetThumbnail();
14764 kshitij.so 575
    case CASH_BACK_TYPE:
576
      return isSetCash_back_type();
577
    case CASH_BACK:
578
      return isSetCash_back();
14384 kshitij.so 579
    }
580
    throw new IllegalStateException();
581
  }
582
 
583
  @Override
584
  public boolean equals(Object that) {
585
    if (that == null)
586
      return false;
587
    if (that instanceof LivePricing)
588
      return this.equals((LivePricing)that);
589
    return false;
590
  }
591
 
592
  public boolean equals(LivePricing that) {
593
    if (that == null)
594
      return false;
595
 
596
    boolean this_present__id = true;
597
    boolean that_present__id = true;
598
    if (this_present__id || that_present__id) {
599
      if (!(this_present__id && that_present__id))
600
        return false;
601
      if (this._id != that._id)
602
        return false;
603
    }
604
 
605
    boolean this_present_available_price = true;
606
    boolean that_present_available_price = true;
607
    if (this_present_available_price || that_present_available_price) {
608
      if (!(this_present_available_price && that_present_available_price))
609
        return false;
610
      if (this.available_price != that.available_price)
611
        return false;
612
    }
613
 
614
    boolean this_present_marketPlaceUrl = true && this.isSetMarketPlaceUrl();
615
    boolean that_present_marketPlaceUrl = true && that.isSetMarketPlaceUrl();
616
    if (this_present_marketPlaceUrl || that_present_marketPlaceUrl) {
617
      if (!(this_present_marketPlaceUrl && that_present_marketPlaceUrl))
618
        return false;
619
      if (!this.marketPlaceUrl.equals(that.marketPlaceUrl))
620
        return false;
621
    }
622
 
623
    boolean this_present_in_stock = true;
624
    boolean that_present_in_stock = true;
625
    if (this_present_in_stock || that_present_in_stock) {
626
      if (!(this_present_in_stock && that_present_in_stock))
627
        return false;
628
      if (this.in_stock != that.in_stock)
629
        return false;
630
    }
631
 
632
    boolean this_present_source_id = true;
633
    boolean that_present_source_id = true;
634
    if (this_present_source_id || that_present_source_id) {
635
      if (!(this_present_source_id && that_present_source_id))
636
        return false;
637
      if (this.source_id != that.source_id)
638
        return false;
639
    }
640
 
641
    boolean this_present_source_product_name = true && this.isSetSource_product_name();
642
    boolean that_present_source_product_name = true && that.isSetSource_product_name();
643
    if (this_present_source_product_name || that_present_source_product_name) {
644
      if (!(this_present_source_product_name && that_present_source_product_name))
645
        return false;
646
      if (!this.source_product_name.equals(that.source_product_name))
647
        return false;
648
    }
649
 
650
    boolean this_present_thumbnail = true && this.isSetThumbnail();
651
    boolean that_present_thumbnail = true && that.isSetThumbnail();
652
    if (this_present_thumbnail || that_present_thumbnail) {
653
      if (!(this_present_thumbnail && that_present_thumbnail))
654
        return false;
655
      if (!this.thumbnail.equals(that.thumbnail))
656
        return false;
657
    }
658
 
14764 kshitij.so 659
    boolean this_present_cash_back_type = true;
660
    boolean that_present_cash_back_type = true;
661
    if (this_present_cash_back_type || that_present_cash_back_type) {
662
      if (!(this_present_cash_back_type && that_present_cash_back_type))
663
        return false;
664
      if (this.cash_back_type != that.cash_back_type)
665
        return false;
666
    }
667
 
668
    boolean this_present_cash_back = true;
669
    boolean that_present_cash_back = true;
670
    if (this_present_cash_back || that_present_cash_back) {
671
      if (!(this_present_cash_back && that_present_cash_back))
672
        return false;
673
      if (this.cash_back != that.cash_back)
674
        return false;
675
    }
676
 
14384 kshitij.so 677
    return true;
678
  }
679
 
680
  @Override
681
  public int hashCode() {
682
    return 0;
683
  }
684
 
685
  public int compareTo(LivePricing other) {
686
    if (!getClass().equals(other.getClass())) {
687
      return getClass().getName().compareTo(other.getClass().getName());
688
    }
689
 
690
    int lastComparison = 0;
691
    LivePricing typedOther = (LivePricing)other;
692
 
693
    lastComparison = Boolean.valueOf(isSet_id()).compareTo(typedOther.isSet_id());
694
    if (lastComparison != 0) {
695
      return lastComparison;
696
    }
697
    if (isSet_id()) {
698
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this._id, typedOther._id);
699
      if (lastComparison != 0) {
700
        return lastComparison;
701
      }
702
    }
703
    lastComparison = Boolean.valueOf(isSetAvailable_price()).compareTo(typedOther.isSetAvailable_price());
704
    if (lastComparison != 0) {
705
      return lastComparison;
706
    }
707
    if (isSetAvailable_price()) {
708
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.available_price, typedOther.available_price);
709
      if (lastComparison != 0) {
710
        return lastComparison;
711
      }
712
    }
713
    lastComparison = Boolean.valueOf(isSetMarketPlaceUrl()).compareTo(typedOther.isSetMarketPlaceUrl());
714
    if (lastComparison != 0) {
715
      return lastComparison;
716
    }
717
    if (isSetMarketPlaceUrl()) {
718
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.marketPlaceUrl, typedOther.marketPlaceUrl);
719
      if (lastComparison != 0) {
720
        return lastComparison;
721
      }
722
    }
723
    lastComparison = Boolean.valueOf(isSetIn_stock()).compareTo(typedOther.isSetIn_stock());
724
    if (lastComparison != 0) {
725
      return lastComparison;
726
    }
727
    if (isSetIn_stock()) {
728
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.in_stock, typedOther.in_stock);
729
      if (lastComparison != 0) {
730
        return lastComparison;
731
      }
732
    }
733
    lastComparison = Boolean.valueOf(isSetSource_id()).compareTo(typedOther.isSetSource_id());
734
    if (lastComparison != 0) {
735
      return lastComparison;
736
    }
737
    if (isSetSource_id()) {
738
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.source_id, typedOther.source_id);
739
      if (lastComparison != 0) {
740
        return lastComparison;
741
      }
742
    }
743
    lastComparison = Boolean.valueOf(isSetSource_product_name()).compareTo(typedOther.isSetSource_product_name());
744
    if (lastComparison != 0) {
745
      return lastComparison;
746
    }
747
    if (isSetSource_product_name()) {
748
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.source_product_name, typedOther.source_product_name);
749
      if (lastComparison != 0) {
750
        return lastComparison;
751
      }
752
    }
753
    lastComparison = Boolean.valueOf(isSetThumbnail()).compareTo(typedOther.isSetThumbnail());
754
    if (lastComparison != 0) {
755
      return lastComparison;
756
    }
757
    if (isSetThumbnail()) {
758
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.thumbnail, typedOther.thumbnail);
759
      if (lastComparison != 0) {
760
        return lastComparison;
761
      }
762
    }
14764 kshitij.so 763
    lastComparison = Boolean.valueOf(isSetCash_back_type()).compareTo(typedOther.isSetCash_back_type());
764
    if (lastComparison != 0) {
765
      return lastComparison;
766
    }
767
    if (isSetCash_back_type()) {
768
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cash_back_type, typedOther.cash_back_type);
769
      if (lastComparison != 0) {
770
        return lastComparison;
771
      }
772
    }
773
    lastComparison = Boolean.valueOf(isSetCash_back()).compareTo(typedOther.isSetCash_back());
774
    if (lastComparison != 0) {
775
      return lastComparison;
776
    }
777
    if (isSetCash_back()) {
778
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cash_back, typedOther.cash_back);
779
      if (lastComparison != 0) {
780
        return lastComparison;
781
      }
782
    }
14384 kshitij.so 783
    return 0;
784
  }
785
 
786
  public _Fields fieldForId(int fieldId) {
787
    return _Fields.findByThriftId(fieldId);
788
  }
789
 
790
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
791
    org.apache.thrift.protocol.TField field;
792
    iprot.readStructBegin();
793
    while (true)
794
    {
795
      field = iprot.readFieldBegin();
796
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
797
        break;
798
      }
799
      switch (field.id) {
800
        case 1: // _ID
801
          if (field.type == org.apache.thrift.protocol.TType.I64) {
802
            this._id = iprot.readI64();
803
            set_idIsSet(true);
804
          } else { 
805
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
806
          }
807
          break;
808
        case 2: // AVAILABLE_PRICE
809
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
810
            this.available_price = iprot.readDouble();
811
            setAvailable_priceIsSet(true);
812
          } else { 
813
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
814
          }
815
          break;
816
        case 3: // MARKET_PLACE_URL
817
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
818
            this.marketPlaceUrl = iprot.readString();
819
          } else { 
820
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
821
          }
822
          break;
823
        case 4: // IN_STOCK
824
          if (field.type == org.apache.thrift.protocol.TType.I64) {
825
            this.in_stock = iprot.readI64();
826
            setIn_stockIsSet(true);
827
          } else { 
828
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
829
          }
830
          break;
831
        case 5: // SOURCE_ID
832
          if (field.type == org.apache.thrift.protocol.TType.I64) {
833
            this.source_id = iprot.readI64();
834
            setSource_idIsSet(true);
835
          } else { 
836
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
837
          }
838
          break;
839
        case 6: // SOURCE_PRODUCT_NAME
840
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
841
            this.source_product_name = iprot.readString();
842
          } else { 
843
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
844
          }
845
          break;
846
        case 7: // THUMBNAIL
847
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
848
            this.thumbnail = iprot.readString();
849
          } else { 
850
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
851
          }
852
          break;
14764 kshitij.so 853
        case 8: // CASH_BACK_TYPE
854
          if (field.type == org.apache.thrift.protocol.TType.I64) {
855
            this.cash_back_type = iprot.readI64();
856
            setCash_back_typeIsSet(true);
857
          } else { 
858
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
859
          }
860
          break;
861
        case 9: // CASH_BACK
862
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
863
            this.cash_back = iprot.readDouble();
864
            setCash_backIsSet(true);
865
          } else { 
866
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
867
          }
868
          break;
14384 kshitij.so 869
        default:
870
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
871
      }
872
      iprot.readFieldEnd();
873
    }
874
    iprot.readStructEnd();
875
    validate();
876
  }
877
 
878
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
879
    validate();
880
 
881
    oprot.writeStructBegin(STRUCT_DESC);
882
    oprot.writeFieldBegin(_ID_FIELD_DESC);
883
    oprot.writeI64(this._id);
884
    oprot.writeFieldEnd();
885
    oprot.writeFieldBegin(AVAILABLE_PRICE_FIELD_DESC);
886
    oprot.writeDouble(this.available_price);
887
    oprot.writeFieldEnd();
888
    if (this.marketPlaceUrl != null) {
889
      oprot.writeFieldBegin(MARKET_PLACE_URL_FIELD_DESC);
890
      oprot.writeString(this.marketPlaceUrl);
891
      oprot.writeFieldEnd();
892
    }
893
    oprot.writeFieldBegin(IN_STOCK_FIELD_DESC);
894
    oprot.writeI64(this.in_stock);
895
    oprot.writeFieldEnd();
896
    oprot.writeFieldBegin(SOURCE_ID_FIELD_DESC);
897
    oprot.writeI64(this.source_id);
898
    oprot.writeFieldEnd();
899
    if (this.source_product_name != null) {
900
      oprot.writeFieldBegin(SOURCE_PRODUCT_NAME_FIELD_DESC);
901
      oprot.writeString(this.source_product_name);
902
      oprot.writeFieldEnd();
903
    }
904
    if (this.thumbnail != null) {
905
      oprot.writeFieldBegin(THUMBNAIL_FIELD_DESC);
906
      oprot.writeString(this.thumbnail);
907
      oprot.writeFieldEnd();
908
    }
14764 kshitij.so 909
    oprot.writeFieldBegin(CASH_BACK_TYPE_FIELD_DESC);
910
    oprot.writeI64(this.cash_back_type);
911
    oprot.writeFieldEnd();
912
    oprot.writeFieldBegin(CASH_BACK_FIELD_DESC);
913
    oprot.writeDouble(this.cash_back);
914
    oprot.writeFieldEnd();
14384 kshitij.so 915
    oprot.writeFieldStop();
916
    oprot.writeStructEnd();
917
  }
918
 
919
  @Override
920
  public String toString() {
921
    StringBuilder sb = new StringBuilder("LivePricing(");
922
    boolean first = true;
923
 
924
    sb.append("_id:");
925
    sb.append(this._id);
926
    first = false;
927
    if (!first) sb.append(", ");
928
    sb.append("available_price:");
929
    sb.append(this.available_price);
930
    first = false;
931
    if (!first) sb.append(", ");
932
    sb.append("marketPlaceUrl:");
933
    if (this.marketPlaceUrl == null) {
934
      sb.append("null");
935
    } else {
936
      sb.append(this.marketPlaceUrl);
937
    }
938
    first = false;
939
    if (!first) sb.append(", ");
940
    sb.append("in_stock:");
941
    sb.append(this.in_stock);
942
    first = false;
943
    if (!first) sb.append(", ");
944
    sb.append("source_id:");
945
    sb.append(this.source_id);
946
    first = false;
947
    if (!first) sb.append(", ");
948
    sb.append("source_product_name:");
949
    if (this.source_product_name == null) {
950
      sb.append("null");
951
    } else {
952
      sb.append(this.source_product_name);
953
    }
954
    first = false;
955
    if (!first) sb.append(", ");
956
    sb.append("thumbnail:");
957
    if (this.thumbnail == null) {
958
      sb.append("null");
959
    } else {
960
      sb.append(this.thumbnail);
961
    }
962
    first = false;
14764 kshitij.so 963
    if (!first) sb.append(", ");
964
    sb.append("cash_back_type:");
965
    sb.append(this.cash_back_type);
966
    first = false;
967
    if (!first) sb.append(", ");
968
    sb.append("cash_back:");
969
    sb.append(this.cash_back);
970
    first = false;
14384 kshitij.so 971
    sb.append(")");
972
    return sb.toString();
973
  }
974
 
975
  public void validate() throws org.apache.thrift.TException {
976
    // check for required fields
977
  }
978
 
979
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
980
    try {
981
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
982
    } catch (org.apache.thrift.TException te) {
983
      throw new java.io.IOException(te);
984
    }
985
  }
986
 
987
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
988
    try {
989
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
990
      __isset_bit_vector = new BitSet(1);
991
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
992
    } catch (org.apache.thrift.TException te) {
993
      throw new java.io.IOException(te);
994
    }
995
  }
996
 
997
}
998