Subversion Repositories SmartDukaan

Rev

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