Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
12244 kshitij.so 1
/**
2
 * Autogenerated by Thrift Compiler (0.7.0)
3
 *
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
 */
6
package in.shop2020.model.v1.catalog;
7
 
8
import java.util.List;
9
import java.util.ArrayList;
10
import java.util.Map;
11
import java.util.HashMap;
12
import java.util.EnumMap;
13
import java.util.Set;
14
import java.util.HashSet;
15
import java.util.EnumSet;
16
import java.util.Collections;
17
import java.util.BitSet;
18
import java.nio.ByteBuffer;
19
import java.util.Arrays;
20
import org.slf4j.Logger;
21
import org.slf4j.LoggerFactory;
22
 
23
public class CompetitorPricing implements org.apache.thrift.TBase<CompetitorPricing, CompetitorPricing._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CompetitorPricing");
25
 
26
  private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("item_id", org.apache.thrift.protocol.TType.I64, (short)1);
27
  private static final org.apache.thrift.protocol.TField IS_SNAPDEAL_FIELD_DESC = new org.apache.thrift.protocol.TField("isSnapdeal", org.apache.thrift.protocol.TType.BOOL, (short)2);
28
  private static final org.apache.thrift.protocol.TField IS_FLIPKART_FIELD_DESC = new org.apache.thrift.protocol.TField("isFlipkart", org.apache.thrift.protocol.TType.BOOL, (short)3);
29
  private static final org.apache.thrift.protocol.TField IS_AMAZON_FIELD_DESC = new org.apache.thrift.protocol.TField("isAmazon", org.apache.thrift.protocol.TType.BOOL, (short)4);
30
  private static final org.apache.thrift.protocol.TField LOWEST_SNAPDEAL_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("lowestSnapdealPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)5);
31
  private static final org.apache.thrift.protocol.TField LOWEST_FLIPKART_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("lowestFlipkartPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)6);
32
  private static final org.apache.thrift.protocol.TField LOWEST_MFN_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("lowestMfnPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)7);
33
  private static final org.apache.thrift.protocol.TField LOWEST_FBA_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("lowestFbaPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)8);
34
  private static final org.apache.thrift.protocol.TField PROCESSED_FIELD_DESC = new org.apache.thrift.protocol.TField("processed", org.apache.thrift.protocol.TType.BOOL, (short)9);
35
  private static final org.apache.thrift.protocol.TField UPLOAD_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("uploadId", org.apache.thrift.protocol.TType.I64, (short)10);
36
 
37
  private long item_id; // required
38
  private boolean isSnapdeal; // required
39
  private boolean isFlipkart; // required
40
  private boolean isAmazon; // required
41
  private double lowestSnapdealPrice; // required
42
  private double lowestFlipkartPrice; // required
43
  private double lowestMfnPrice; // required
44
  private double lowestFbaPrice; // required
45
  private boolean processed; // required
46
  private long uploadId; // required
47
 
48
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
49
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
50
    ITEM_ID((short)1, "item_id"),
51
    IS_SNAPDEAL((short)2, "isSnapdeal"),
52
    IS_FLIPKART((short)3, "isFlipkart"),
53
    IS_AMAZON((short)4, "isAmazon"),
54
    LOWEST_SNAPDEAL_PRICE((short)5, "lowestSnapdealPrice"),
55
    LOWEST_FLIPKART_PRICE((short)6, "lowestFlipkartPrice"),
56
    LOWEST_MFN_PRICE((short)7, "lowestMfnPrice"),
57
    LOWEST_FBA_PRICE((short)8, "lowestFbaPrice"),
58
    PROCESSED((short)9, "processed"),
59
    UPLOAD_ID((short)10, "uploadId");
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: // ITEM_ID
75
          return ITEM_ID;
76
        case 2: // IS_SNAPDEAL
77
          return IS_SNAPDEAL;
78
        case 3: // IS_FLIPKART
79
          return IS_FLIPKART;
80
        case 4: // IS_AMAZON
81
          return IS_AMAZON;
82
        case 5: // LOWEST_SNAPDEAL_PRICE
83
          return LOWEST_SNAPDEAL_PRICE;
84
        case 6: // LOWEST_FLIPKART_PRICE
85
          return LOWEST_FLIPKART_PRICE;
86
        case 7: // LOWEST_MFN_PRICE
87
          return LOWEST_MFN_PRICE;
88
        case 8: // LOWEST_FBA_PRICE
89
          return LOWEST_FBA_PRICE;
90
        case 9: // PROCESSED
91
          return PROCESSED;
92
        case 10: // UPLOAD_ID
93
          return UPLOAD_ID;
94
        default:
95
          return null;
96
      }
97
    }
98
 
99
    /**
100
     * Find the _Fields constant that matches fieldId, throwing an exception
101
     * if it is not found.
102
     */
103
    public static _Fields findByThriftIdOrThrow(int fieldId) {
104
      _Fields fields = findByThriftId(fieldId);
105
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
106
      return fields;
107
    }
108
 
109
    /**
110
     * Find the _Fields constant that matches name, or null if its not found.
111
     */
112
    public static _Fields findByName(String name) {
113
      return byName.get(name);
114
    }
115
 
116
    private final short _thriftId;
117
    private final String _fieldName;
118
 
119
    _Fields(short thriftId, String fieldName) {
120
      _thriftId = thriftId;
121
      _fieldName = fieldName;
122
    }
123
 
124
    public short getThriftFieldId() {
125
      return _thriftId;
126
    }
127
 
128
    public String getFieldName() {
129
      return _fieldName;
130
    }
131
  }
132
 
133
  // isset id assignments
134
  private static final int __ITEM_ID_ISSET_ID = 0;
135
  private static final int __ISSNAPDEAL_ISSET_ID = 1;
136
  private static final int __ISFLIPKART_ISSET_ID = 2;
137
  private static final int __ISAMAZON_ISSET_ID = 3;
138
  private static final int __LOWESTSNAPDEALPRICE_ISSET_ID = 4;
139
  private static final int __LOWESTFLIPKARTPRICE_ISSET_ID = 5;
140
  private static final int __LOWESTMFNPRICE_ISSET_ID = 6;
141
  private static final int __LOWESTFBAPRICE_ISSET_ID = 7;
142
  private static final int __PROCESSED_ISSET_ID = 8;
143
  private static final int __UPLOADID_ISSET_ID = 9;
144
  private BitSet __isset_bit_vector = new BitSet(10);
145
 
146
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
147
  static {
148
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
149
    tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("item_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
150
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
151
    tmpMap.put(_Fields.IS_SNAPDEAL, new org.apache.thrift.meta_data.FieldMetaData("isSnapdeal", org.apache.thrift.TFieldRequirementType.DEFAULT, 
152
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
153
    tmpMap.put(_Fields.IS_FLIPKART, new org.apache.thrift.meta_data.FieldMetaData("isFlipkart", org.apache.thrift.TFieldRequirementType.DEFAULT, 
154
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
155
    tmpMap.put(_Fields.IS_AMAZON, new org.apache.thrift.meta_data.FieldMetaData("isAmazon", org.apache.thrift.TFieldRequirementType.DEFAULT, 
156
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
157
    tmpMap.put(_Fields.LOWEST_SNAPDEAL_PRICE, new org.apache.thrift.meta_data.FieldMetaData("lowestSnapdealPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
158
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
159
    tmpMap.put(_Fields.LOWEST_FLIPKART_PRICE, new org.apache.thrift.meta_data.FieldMetaData("lowestFlipkartPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
160
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
161
    tmpMap.put(_Fields.LOWEST_MFN_PRICE, new org.apache.thrift.meta_data.FieldMetaData("lowestMfnPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
162
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
163
    tmpMap.put(_Fields.LOWEST_FBA_PRICE, new org.apache.thrift.meta_data.FieldMetaData("lowestFbaPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
164
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
165
    tmpMap.put(_Fields.PROCESSED, new org.apache.thrift.meta_data.FieldMetaData("processed", org.apache.thrift.TFieldRequirementType.DEFAULT, 
166
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
167
    tmpMap.put(_Fields.UPLOAD_ID, new org.apache.thrift.meta_data.FieldMetaData("uploadId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
168
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
169
    metaDataMap = Collections.unmodifiableMap(tmpMap);
170
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CompetitorPricing.class, metaDataMap);
171
  }
172
 
173
  public CompetitorPricing() {
174
  }
175
 
176
  public CompetitorPricing(
177
    long item_id,
178
    boolean isSnapdeal,
179
    boolean isFlipkart,
180
    boolean isAmazon,
181
    double lowestSnapdealPrice,
182
    double lowestFlipkartPrice,
183
    double lowestMfnPrice,
184
    double lowestFbaPrice,
185
    boolean processed,
186
    long uploadId)
187
  {
188
    this();
189
    this.item_id = item_id;
190
    setItem_idIsSet(true);
191
    this.isSnapdeal = isSnapdeal;
192
    setIsSnapdealIsSet(true);
193
    this.isFlipkart = isFlipkart;
194
    setIsFlipkartIsSet(true);
195
    this.isAmazon = isAmazon;
196
    setIsAmazonIsSet(true);
197
    this.lowestSnapdealPrice = lowestSnapdealPrice;
198
    setLowestSnapdealPriceIsSet(true);
199
    this.lowestFlipkartPrice = lowestFlipkartPrice;
200
    setLowestFlipkartPriceIsSet(true);
201
    this.lowestMfnPrice = lowestMfnPrice;
202
    setLowestMfnPriceIsSet(true);
203
    this.lowestFbaPrice = lowestFbaPrice;
204
    setLowestFbaPriceIsSet(true);
205
    this.processed = processed;
206
    setProcessedIsSet(true);
207
    this.uploadId = uploadId;
208
    setUploadIdIsSet(true);
209
  }
210
 
211
  /**
212
   * Performs a deep copy on <i>other</i>.
213
   */
214
  public CompetitorPricing(CompetitorPricing other) {
215
    __isset_bit_vector.clear();
216
    __isset_bit_vector.or(other.__isset_bit_vector);
217
    this.item_id = other.item_id;
218
    this.isSnapdeal = other.isSnapdeal;
219
    this.isFlipkart = other.isFlipkart;
220
    this.isAmazon = other.isAmazon;
221
    this.lowestSnapdealPrice = other.lowestSnapdealPrice;
222
    this.lowestFlipkartPrice = other.lowestFlipkartPrice;
223
    this.lowestMfnPrice = other.lowestMfnPrice;
224
    this.lowestFbaPrice = other.lowestFbaPrice;
225
    this.processed = other.processed;
226
    this.uploadId = other.uploadId;
227
  }
228
 
229
  public CompetitorPricing deepCopy() {
230
    return new CompetitorPricing(this);
231
  }
232
 
233
  @Override
234
  public void clear() {
235
    setItem_idIsSet(false);
236
    this.item_id = 0;
237
    setIsSnapdealIsSet(false);
238
    this.isSnapdeal = false;
239
    setIsFlipkartIsSet(false);
240
    this.isFlipkart = false;
241
    setIsAmazonIsSet(false);
242
    this.isAmazon = false;
243
    setLowestSnapdealPriceIsSet(false);
244
    this.lowestSnapdealPrice = 0.0;
245
    setLowestFlipkartPriceIsSet(false);
246
    this.lowestFlipkartPrice = 0.0;
247
    setLowestMfnPriceIsSet(false);
248
    this.lowestMfnPrice = 0.0;
249
    setLowestFbaPriceIsSet(false);
250
    this.lowestFbaPrice = 0.0;
251
    setProcessedIsSet(false);
252
    this.processed = false;
253
    setUploadIdIsSet(false);
254
    this.uploadId = 0;
255
  }
256
 
257
  public long getItem_id() {
258
    return this.item_id;
259
  }
260
 
261
  public void setItem_id(long item_id) {
262
    this.item_id = item_id;
263
    setItem_idIsSet(true);
264
  }
265
 
266
  public void unsetItem_id() {
267
    __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
268
  }
269
 
270
  /** Returns true if field item_id is set (has been assigned a value) and false otherwise */
271
  public boolean isSetItem_id() {
272
    return __isset_bit_vector.get(__ITEM_ID_ISSET_ID);
273
  }
274
 
275
  public void setItem_idIsSet(boolean value) {
276
    __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
277
  }
278
 
279
  public boolean isIsSnapdeal() {
280
    return this.isSnapdeal;
281
  }
282
 
283
  public void setIsSnapdeal(boolean isSnapdeal) {
284
    this.isSnapdeal = isSnapdeal;
285
    setIsSnapdealIsSet(true);
286
  }
287
 
288
  public void unsetIsSnapdeal() {
289
    __isset_bit_vector.clear(__ISSNAPDEAL_ISSET_ID);
290
  }
291
 
292
  /** Returns true if field isSnapdeal is set (has been assigned a value) and false otherwise */
293
  public boolean isSetIsSnapdeal() {
294
    return __isset_bit_vector.get(__ISSNAPDEAL_ISSET_ID);
295
  }
296
 
297
  public void setIsSnapdealIsSet(boolean value) {
298
    __isset_bit_vector.set(__ISSNAPDEAL_ISSET_ID, value);
299
  }
300
 
301
  public boolean isIsFlipkart() {
302
    return this.isFlipkart;
303
  }
304
 
305
  public void setIsFlipkart(boolean isFlipkart) {
306
    this.isFlipkart = isFlipkart;
307
    setIsFlipkartIsSet(true);
308
  }
309
 
310
  public void unsetIsFlipkart() {
311
    __isset_bit_vector.clear(__ISFLIPKART_ISSET_ID);
312
  }
313
 
314
  /** Returns true if field isFlipkart is set (has been assigned a value) and false otherwise */
315
  public boolean isSetIsFlipkart() {
316
    return __isset_bit_vector.get(__ISFLIPKART_ISSET_ID);
317
  }
318
 
319
  public void setIsFlipkartIsSet(boolean value) {
320
    __isset_bit_vector.set(__ISFLIPKART_ISSET_ID, value);
321
  }
322
 
323
  public boolean isIsAmazon() {
324
    return this.isAmazon;
325
  }
326
 
327
  public void setIsAmazon(boolean isAmazon) {
328
    this.isAmazon = isAmazon;
329
    setIsAmazonIsSet(true);
330
  }
331
 
332
  public void unsetIsAmazon() {
333
    __isset_bit_vector.clear(__ISAMAZON_ISSET_ID);
334
  }
335
 
336
  /** Returns true if field isAmazon is set (has been assigned a value) and false otherwise */
337
  public boolean isSetIsAmazon() {
338
    return __isset_bit_vector.get(__ISAMAZON_ISSET_ID);
339
  }
340
 
341
  public void setIsAmazonIsSet(boolean value) {
342
    __isset_bit_vector.set(__ISAMAZON_ISSET_ID, value);
343
  }
344
 
345
  public double getLowestSnapdealPrice() {
346
    return this.lowestSnapdealPrice;
347
  }
348
 
349
  public void setLowestSnapdealPrice(double lowestSnapdealPrice) {
350
    this.lowestSnapdealPrice = lowestSnapdealPrice;
351
    setLowestSnapdealPriceIsSet(true);
352
  }
353
 
354
  public void unsetLowestSnapdealPrice() {
355
    __isset_bit_vector.clear(__LOWESTSNAPDEALPRICE_ISSET_ID);
356
  }
357
 
358
  /** Returns true if field lowestSnapdealPrice is set (has been assigned a value) and false otherwise */
359
  public boolean isSetLowestSnapdealPrice() {
360
    return __isset_bit_vector.get(__LOWESTSNAPDEALPRICE_ISSET_ID);
361
  }
362
 
363
  public void setLowestSnapdealPriceIsSet(boolean value) {
364
    __isset_bit_vector.set(__LOWESTSNAPDEALPRICE_ISSET_ID, value);
365
  }
366
 
367
  public double getLowestFlipkartPrice() {
368
    return this.lowestFlipkartPrice;
369
  }
370
 
371
  public void setLowestFlipkartPrice(double lowestFlipkartPrice) {
372
    this.lowestFlipkartPrice = lowestFlipkartPrice;
373
    setLowestFlipkartPriceIsSet(true);
374
  }
375
 
376
  public void unsetLowestFlipkartPrice() {
377
    __isset_bit_vector.clear(__LOWESTFLIPKARTPRICE_ISSET_ID);
378
  }
379
 
380
  /** Returns true if field lowestFlipkartPrice is set (has been assigned a value) and false otherwise */
381
  public boolean isSetLowestFlipkartPrice() {
382
    return __isset_bit_vector.get(__LOWESTFLIPKARTPRICE_ISSET_ID);
383
  }
384
 
385
  public void setLowestFlipkartPriceIsSet(boolean value) {
386
    __isset_bit_vector.set(__LOWESTFLIPKARTPRICE_ISSET_ID, value);
387
  }
388
 
389
  public double getLowestMfnPrice() {
390
    return this.lowestMfnPrice;
391
  }
392
 
393
  public void setLowestMfnPrice(double lowestMfnPrice) {
394
    this.lowestMfnPrice = lowestMfnPrice;
395
    setLowestMfnPriceIsSet(true);
396
  }
397
 
398
  public void unsetLowestMfnPrice() {
399
    __isset_bit_vector.clear(__LOWESTMFNPRICE_ISSET_ID);
400
  }
401
 
402
  /** Returns true if field lowestMfnPrice is set (has been assigned a value) and false otherwise */
403
  public boolean isSetLowestMfnPrice() {
404
    return __isset_bit_vector.get(__LOWESTMFNPRICE_ISSET_ID);
405
  }
406
 
407
  public void setLowestMfnPriceIsSet(boolean value) {
408
    __isset_bit_vector.set(__LOWESTMFNPRICE_ISSET_ID, value);
409
  }
410
 
411
  public double getLowestFbaPrice() {
412
    return this.lowestFbaPrice;
413
  }
414
 
415
  public void setLowestFbaPrice(double lowestFbaPrice) {
416
    this.lowestFbaPrice = lowestFbaPrice;
417
    setLowestFbaPriceIsSet(true);
418
  }
419
 
420
  public void unsetLowestFbaPrice() {
421
    __isset_bit_vector.clear(__LOWESTFBAPRICE_ISSET_ID);
422
  }
423
 
424
  /** Returns true if field lowestFbaPrice is set (has been assigned a value) and false otherwise */
425
  public boolean isSetLowestFbaPrice() {
426
    return __isset_bit_vector.get(__LOWESTFBAPRICE_ISSET_ID);
427
  }
428
 
429
  public void setLowestFbaPriceIsSet(boolean value) {
430
    __isset_bit_vector.set(__LOWESTFBAPRICE_ISSET_ID, value);
431
  }
432
 
433
  public boolean isProcessed() {
434
    return this.processed;
435
  }
436
 
437
  public void setProcessed(boolean processed) {
438
    this.processed = processed;
439
    setProcessedIsSet(true);
440
  }
441
 
442
  public void unsetProcessed() {
443
    __isset_bit_vector.clear(__PROCESSED_ISSET_ID);
444
  }
445
 
446
  /** Returns true if field processed is set (has been assigned a value) and false otherwise */
447
  public boolean isSetProcessed() {
448
    return __isset_bit_vector.get(__PROCESSED_ISSET_ID);
449
  }
450
 
451
  public void setProcessedIsSet(boolean value) {
452
    __isset_bit_vector.set(__PROCESSED_ISSET_ID, value);
453
  }
454
 
455
  public long getUploadId() {
456
    return this.uploadId;
457
  }
458
 
459
  public void setUploadId(long uploadId) {
460
    this.uploadId = uploadId;
461
    setUploadIdIsSet(true);
462
  }
463
 
464
  public void unsetUploadId() {
465
    __isset_bit_vector.clear(__UPLOADID_ISSET_ID);
466
  }
467
 
468
  /** Returns true if field uploadId is set (has been assigned a value) and false otherwise */
469
  public boolean isSetUploadId() {
470
    return __isset_bit_vector.get(__UPLOADID_ISSET_ID);
471
  }
472
 
473
  public void setUploadIdIsSet(boolean value) {
474
    __isset_bit_vector.set(__UPLOADID_ISSET_ID, value);
475
  }
476
 
477
  public void setFieldValue(_Fields field, Object value) {
478
    switch (field) {
479
    case ITEM_ID:
480
      if (value == null) {
481
        unsetItem_id();
482
      } else {
483
        setItem_id((Long)value);
484
      }
485
      break;
486
 
487
    case IS_SNAPDEAL:
488
      if (value == null) {
489
        unsetIsSnapdeal();
490
      } else {
491
        setIsSnapdeal((Boolean)value);
492
      }
493
      break;
494
 
495
    case IS_FLIPKART:
496
      if (value == null) {
497
        unsetIsFlipkart();
498
      } else {
499
        setIsFlipkart((Boolean)value);
500
      }
501
      break;
502
 
503
    case IS_AMAZON:
504
      if (value == null) {
505
        unsetIsAmazon();
506
      } else {
507
        setIsAmazon((Boolean)value);
508
      }
509
      break;
510
 
511
    case LOWEST_SNAPDEAL_PRICE:
512
      if (value == null) {
513
        unsetLowestSnapdealPrice();
514
      } else {
515
        setLowestSnapdealPrice((Double)value);
516
      }
517
      break;
518
 
519
    case LOWEST_FLIPKART_PRICE:
520
      if (value == null) {
521
        unsetLowestFlipkartPrice();
522
      } else {
523
        setLowestFlipkartPrice((Double)value);
524
      }
525
      break;
526
 
527
    case LOWEST_MFN_PRICE:
528
      if (value == null) {
529
        unsetLowestMfnPrice();
530
      } else {
531
        setLowestMfnPrice((Double)value);
532
      }
533
      break;
534
 
535
    case LOWEST_FBA_PRICE:
536
      if (value == null) {
537
        unsetLowestFbaPrice();
538
      } else {
539
        setLowestFbaPrice((Double)value);
540
      }
541
      break;
542
 
543
    case PROCESSED:
544
      if (value == null) {
545
        unsetProcessed();
546
      } else {
547
        setProcessed((Boolean)value);
548
      }
549
      break;
550
 
551
    case UPLOAD_ID:
552
      if (value == null) {
553
        unsetUploadId();
554
      } else {
555
        setUploadId((Long)value);
556
      }
557
      break;
558
 
559
    }
560
  }
561
 
562
  public Object getFieldValue(_Fields field) {
563
    switch (field) {
564
    case ITEM_ID:
565
      return Long.valueOf(getItem_id());
566
 
567
    case IS_SNAPDEAL:
568
      return Boolean.valueOf(isIsSnapdeal());
569
 
570
    case IS_FLIPKART:
571
      return Boolean.valueOf(isIsFlipkart());
572
 
573
    case IS_AMAZON:
574
      return Boolean.valueOf(isIsAmazon());
575
 
576
    case LOWEST_SNAPDEAL_PRICE:
577
      return Double.valueOf(getLowestSnapdealPrice());
578
 
579
    case LOWEST_FLIPKART_PRICE:
580
      return Double.valueOf(getLowestFlipkartPrice());
581
 
582
    case LOWEST_MFN_PRICE:
583
      return Double.valueOf(getLowestMfnPrice());
584
 
585
    case LOWEST_FBA_PRICE:
586
      return Double.valueOf(getLowestFbaPrice());
587
 
588
    case PROCESSED:
589
      return Boolean.valueOf(isProcessed());
590
 
591
    case UPLOAD_ID:
592
      return Long.valueOf(getUploadId());
593
 
594
    }
595
    throw new IllegalStateException();
596
  }
597
 
598
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
599
  public boolean isSet(_Fields field) {
600
    if (field == null) {
601
      throw new IllegalArgumentException();
602
    }
603
 
604
    switch (field) {
605
    case ITEM_ID:
606
      return isSetItem_id();
607
    case IS_SNAPDEAL:
608
      return isSetIsSnapdeal();
609
    case IS_FLIPKART:
610
      return isSetIsFlipkart();
611
    case IS_AMAZON:
612
      return isSetIsAmazon();
613
    case LOWEST_SNAPDEAL_PRICE:
614
      return isSetLowestSnapdealPrice();
615
    case LOWEST_FLIPKART_PRICE:
616
      return isSetLowestFlipkartPrice();
617
    case LOWEST_MFN_PRICE:
618
      return isSetLowestMfnPrice();
619
    case LOWEST_FBA_PRICE:
620
      return isSetLowestFbaPrice();
621
    case PROCESSED:
622
      return isSetProcessed();
623
    case UPLOAD_ID:
624
      return isSetUploadId();
625
    }
626
    throw new IllegalStateException();
627
  }
628
 
629
  @Override
630
  public boolean equals(Object that) {
631
    if (that == null)
632
      return false;
633
    if (that instanceof CompetitorPricing)
634
      return this.equals((CompetitorPricing)that);
635
    return false;
636
  }
637
 
638
  public boolean equals(CompetitorPricing that) {
639
    if (that == null)
640
      return false;
641
 
642
    boolean this_present_item_id = true;
643
    boolean that_present_item_id = true;
644
    if (this_present_item_id || that_present_item_id) {
645
      if (!(this_present_item_id && that_present_item_id))
646
        return false;
647
      if (this.item_id != that.item_id)
648
        return false;
649
    }
650
 
651
    boolean this_present_isSnapdeal = true;
652
    boolean that_present_isSnapdeal = true;
653
    if (this_present_isSnapdeal || that_present_isSnapdeal) {
654
      if (!(this_present_isSnapdeal && that_present_isSnapdeal))
655
        return false;
656
      if (this.isSnapdeal != that.isSnapdeal)
657
        return false;
658
    }
659
 
660
    boolean this_present_isFlipkart = true;
661
    boolean that_present_isFlipkart = true;
662
    if (this_present_isFlipkart || that_present_isFlipkart) {
663
      if (!(this_present_isFlipkart && that_present_isFlipkart))
664
        return false;
665
      if (this.isFlipkart != that.isFlipkart)
666
        return false;
667
    }
668
 
669
    boolean this_present_isAmazon = true;
670
    boolean that_present_isAmazon = true;
671
    if (this_present_isAmazon || that_present_isAmazon) {
672
      if (!(this_present_isAmazon && that_present_isAmazon))
673
        return false;
674
      if (this.isAmazon != that.isAmazon)
675
        return false;
676
    }
677
 
678
    boolean this_present_lowestSnapdealPrice = true;
679
    boolean that_present_lowestSnapdealPrice = true;
680
    if (this_present_lowestSnapdealPrice || that_present_lowestSnapdealPrice) {
681
      if (!(this_present_lowestSnapdealPrice && that_present_lowestSnapdealPrice))
682
        return false;
683
      if (this.lowestSnapdealPrice != that.lowestSnapdealPrice)
684
        return false;
685
    }
686
 
687
    boolean this_present_lowestFlipkartPrice = true;
688
    boolean that_present_lowestFlipkartPrice = true;
689
    if (this_present_lowestFlipkartPrice || that_present_lowestFlipkartPrice) {
690
      if (!(this_present_lowestFlipkartPrice && that_present_lowestFlipkartPrice))
691
        return false;
692
      if (this.lowestFlipkartPrice != that.lowestFlipkartPrice)
693
        return false;
694
    }
695
 
696
    boolean this_present_lowestMfnPrice = true;
697
    boolean that_present_lowestMfnPrice = true;
698
    if (this_present_lowestMfnPrice || that_present_lowestMfnPrice) {
699
      if (!(this_present_lowestMfnPrice && that_present_lowestMfnPrice))
700
        return false;
701
      if (this.lowestMfnPrice != that.lowestMfnPrice)
702
        return false;
703
    }
704
 
705
    boolean this_present_lowestFbaPrice = true;
706
    boolean that_present_lowestFbaPrice = true;
707
    if (this_present_lowestFbaPrice || that_present_lowestFbaPrice) {
708
      if (!(this_present_lowestFbaPrice && that_present_lowestFbaPrice))
709
        return false;
710
      if (this.lowestFbaPrice != that.lowestFbaPrice)
711
        return false;
712
    }
713
 
714
    boolean this_present_processed = true;
715
    boolean that_present_processed = true;
716
    if (this_present_processed || that_present_processed) {
717
      if (!(this_present_processed && that_present_processed))
718
        return false;
719
      if (this.processed != that.processed)
720
        return false;
721
    }
722
 
723
    boolean this_present_uploadId = true;
724
    boolean that_present_uploadId = true;
725
    if (this_present_uploadId || that_present_uploadId) {
726
      if (!(this_present_uploadId && that_present_uploadId))
727
        return false;
728
      if (this.uploadId != that.uploadId)
729
        return false;
730
    }
731
 
732
    return true;
733
  }
734
 
735
  @Override
736
  public int hashCode() {
737
    return 0;
738
  }
739
 
740
  public int compareTo(CompetitorPricing other) {
741
    if (!getClass().equals(other.getClass())) {
742
      return getClass().getName().compareTo(other.getClass().getName());
743
    }
744
 
745
    int lastComparison = 0;
746
    CompetitorPricing typedOther = (CompetitorPricing)other;
747
 
748
    lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(typedOther.isSetItem_id());
749
    if (lastComparison != 0) {
750
      return lastComparison;
751
    }
752
    if (isSetItem_id()) {
753
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.item_id, typedOther.item_id);
754
      if (lastComparison != 0) {
755
        return lastComparison;
756
      }
757
    }
758
    lastComparison = Boolean.valueOf(isSetIsSnapdeal()).compareTo(typedOther.isSetIsSnapdeal());
759
    if (lastComparison != 0) {
760
      return lastComparison;
761
    }
762
    if (isSetIsSnapdeal()) {
763
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isSnapdeal, typedOther.isSnapdeal);
764
      if (lastComparison != 0) {
765
        return lastComparison;
766
      }
767
    }
768
    lastComparison = Boolean.valueOf(isSetIsFlipkart()).compareTo(typedOther.isSetIsFlipkart());
769
    if (lastComparison != 0) {
770
      return lastComparison;
771
    }
772
    if (isSetIsFlipkart()) {
773
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isFlipkart, typedOther.isFlipkart);
774
      if (lastComparison != 0) {
775
        return lastComparison;
776
      }
777
    }
778
    lastComparison = Boolean.valueOf(isSetIsAmazon()).compareTo(typedOther.isSetIsAmazon());
779
    if (lastComparison != 0) {
780
      return lastComparison;
781
    }
782
    if (isSetIsAmazon()) {
783
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isAmazon, typedOther.isAmazon);
784
      if (lastComparison != 0) {
785
        return lastComparison;
786
      }
787
    }
788
    lastComparison = Boolean.valueOf(isSetLowestSnapdealPrice()).compareTo(typedOther.isSetLowestSnapdealPrice());
789
    if (lastComparison != 0) {
790
      return lastComparison;
791
    }
792
    if (isSetLowestSnapdealPrice()) {
793
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lowestSnapdealPrice, typedOther.lowestSnapdealPrice);
794
      if (lastComparison != 0) {
795
        return lastComparison;
796
      }
797
    }
798
    lastComparison = Boolean.valueOf(isSetLowestFlipkartPrice()).compareTo(typedOther.isSetLowestFlipkartPrice());
799
    if (lastComparison != 0) {
800
      return lastComparison;
801
    }
802
    if (isSetLowestFlipkartPrice()) {
803
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lowestFlipkartPrice, typedOther.lowestFlipkartPrice);
804
      if (lastComparison != 0) {
805
        return lastComparison;
806
      }
807
    }
808
    lastComparison = Boolean.valueOf(isSetLowestMfnPrice()).compareTo(typedOther.isSetLowestMfnPrice());
809
    if (lastComparison != 0) {
810
      return lastComparison;
811
    }
812
    if (isSetLowestMfnPrice()) {
813
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lowestMfnPrice, typedOther.lowestMfnPrice);
814
      if (lastComparison != 0) {
815
        return lastComparison;
816
      }
817
    }
818
    lastComparison = Boolean.valueOf(isSetLowestFbaPrice()).compareTo(typedOther.isSetLowestFbaPrice());
819
    if (lastComparison != 0) {
820
      return lastComparison;
821
    }
822
    if (isSetLowestFbaPrice()) {
823
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lowestFbaPrice, typedOther.lowestFbaPrice);
824
      if (lastComparison != 0) {
825
        return lastComparison;
826
      }
827
    }
828
    lastComparison = Boolean.valueOf(isSetProcessed()).compareTo(typedOther.isSetProcessed());
829
    if (lastComparison != 0) {
830
      return lastComparison;
831
    }
832
    if (isSetProcessed()) {
833
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.processed, typedOther.processed);
834
      if (lastComparison != 0) {
835
        return lastComparison;
836
      }
837
    }
838
    lastComparison = Boolean.valueOf(isSetUploadId()).compareTo(typedOther.isSetUploadId());
839
    if (lastComparison != 0) {
840
      return lastComparison;
841
    }
842
    if (isSetUploadId()) {
843
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uploadId, typedOther.uploadId);
844
      if (lastComparison != 0) {
845
        return lastComparison;
846
      }
847
    }
848
    return 0;
849
  }
850
 
851
  public _Fields fieldForId(int fieldId) {
852
    return _Fields.findByThriftId(fieldId);
853
  }
854
 
855
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
856
    org.apache.thrift.protocol.TField field;
857
    iprot.readStructBegin();
858
    while (true)
859
    {
860
      field = iprot.readFieldBegin();
861
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
862
        break;
863
      }
864
      switch (field.id) {
865
        case 1: // ITEM_ID
866
          if (field.type == org.apache.thrift.protocol.TType.I64) {
867
            this.item_id = iprot.readI64();
868
            setItem_idIsSet(true);
869
          } else { 
870
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
871
          }
872
          break;
873
        case 2: // IS_SNAPDEAL
874
          if (field.type == org.apache.thrift.protocol.TType.BOOL) {
875
            this.isSnapdeal = iprot.readBool();
876
            setIsSnapdealIsSet(true);
877
          } else { 
878
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
879
          }
880
          break;
881
        case 3: // IS_FLIPKART
882
          if (field.type == org.apache.thrift.protocol.TType.BOOL) {
883
            this.isFlipkart = iprot.readBool();
884
            setIsFlipkartIsSet(true);
885
          } else { 
886
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
887
          }
888
          break;
889
        case 4: // IS_AMAZON
890
          if (field.type == org.apache.thrift.protocol.TType.BOOL) {
891
            this.isAmazon = iprot.readBool();
892
            setIsAmazonIsSet(true);
893
          } else { 
894
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
895
          }
896
          break;
897
        case 5: // LOWEST_SNAPDEAL_PRICE
898
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
899
            this.lowestSnapdealPrice = iprot.readDouble();
900
            setLowestSnapdealPriceIsSet(true);
901
          } else { 
902
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
903
          }
904
          break;
905
        case 6: // LOWEST_FLIPKART_PRICE
906
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
907
            this.lowestFlipkartPrice = iprot.readDouble();
908
            setLowestFlipkartPriceIsSet(true);
909
          } else { 
910
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
911
          }
912
          break;
913
        case 7: // LOWEST_MFN_PRICE
914
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
915
            this.lowestMfnPrice = iprot.readDouble();
916
            setLowestMfnPriceIsSet(true);
917
          } else { 
918
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
919
          }
920
          break;
921
        case 8: // LOWEST_FBA_PRICE
922
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
923
            this.lowestFbaPrice = iprot.readDouble();
924
            setLowestFbaPriceIsSet(true);
925
          } else { 
926
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
927
          }
928
          break;
929
        case 9: // PROCESSED
930
          if (field.type == org.apache.thrift.protocol.TType.BOOL) {
931
            this.processed = iprot.readBool();
932
            setProcessedIsSet(true);
933
          } else { 
934
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
935
          }
936
          break;
937
        case 10: // UPLOAD_ID
938
          if (field.type == org.apache.thrift.protocol.TType.I64) {
939
            this.uploadId = iprot.readI64();
940
            setUploadIdIsSet(true);
941
          } else { 
942
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
943
          }
944
          break;
945
        default:
946
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
947
      }
948
      iprot.readFieldEnd();
949
    }
950
    iprot.readStructEnd();
951
    validate();
952
  }
953
 
954
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
955
    validate();
956
 
957
    oprot.writeStructBegin(STRUCT_DESC);
958
    oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
959
    oprot.writeI64(this.item_id);
960
    oprot.writeFieldEnd();
961
    oprot.writeFieldBegin(IS_SNAPDEAL_FIELD_DESC);
962
    oprot.writeBool(this.isSnapdeal);
963
    oprot.writeFieldEnd();
964
    oprot.writeFieldBegin(IS_FLIPKART_FIELD_DESC);
965
    oprot.writeBool(this.isFlipkart);
966
    oprot.writeFieldEnd();
967
    oprot.writeFieldBegin(IS_AMAZON_FIELD_DESC);
968
    oprot.writeBool(this.isAmazon);
969
    oprot.writeFieldEnd();
970
    oprot.writeFieldBegin(LOWEST_SNAPDEAL_PRICE_FIELD_DESC);
971
    oprot.writeDouble(this.lowestSnapdealPrice);
972
    oprot.writeFieldEnd();
973
    oprot.writeFieldBegin(LOWEST_FLIPKART_PRICE_FIELD_DESC);
974
    oprot.writeDouble(this.lowestFlipkartPrice);
975
    oprot.writeFieldEnd();
976
    oprot.writeFieldBegin(LOWEST_MFN_PRICE_FIELD_DESC);
977
    oprot.writeDouble(this.lowestMfnPrice);
978
    oprot.writeFieldEnd();
979
    oprot.writeFieldBegin(LOWEST_FBA_PRICE_FIELD_DESC);
980
    oprot.writeDouble(this.lowestFbaPrice);
981
    oprot.writeFieldEnd();
982
    oprot.writeFieldBegin(PROCESSED_FIELD_DESC);
983
    oprot.writeBool(this.processed);
984
    oprot.writeFieldEnd();
985
    oprot.writeFieldBegin(UPLOAD_ID_FIELD_DESC);
986
    oprot.writeI64(this.uploadId);
987
    oprot.writeFieldEnd();
988
    oprot.writeFieldStop();
989
    oprot.writeStructEnd();
990
  }
991
 
992
  @Override
993
  public String toString() {
994
    StringBuilder sb = new StringBuilder("CompetitorPricing(");
995
    boolean first = true;
996
 
997
    sb.append("item_id:");
998
    sb.append(this.item_id);
999
    first = false;
1000
    if (!first) sb.append(", ");
1001
    sb.append("isSnapdeal:");
1002
    sb.append(this.isSnapdeal);
1003
    first = false;
1004
    if (!first) sb.append(", ");
1005
    sb.append("isFlipkart:");
1006
    sb.append(this.isFlipkart);
1007
    first = false;
1008
    if (!first) sb.append(", ");
1009
    sb.append("isAmazon:");
1010
    sb.append(this.isAmazon);
1011
    first = false;
1012
    if (!first) sb.append(", ");
1013
    sb.append("lowestSnapdealPrice:");
1014
    sb.append(this.lowestSnapdealPrice);
1015
    first = false;
1016
    if (!first) sb.append(", ");
1017
    sb.append("lowestFlipkartPrice:");
1018
    sb.append(this.lowestFlipkartPrice);
1019
    first = false;
1020
    if (!first) sb.append(", ");
1021
    sb.append("lowestMfnPrice:");
1022
    sb.append(this.lowestMfnPrice);
1023
    first = false;
1024
    if (!first) sb.append(", ");
1025
    sb.append("lowestFbaPrice:");
1026
    sb.append(this.lowestFbaPrice);
1027
    first = false;
1028
    if (!first) sb.append(", ");
1029
    sb.append("processed:");
1030
    sb.append(this.processed);
1031
    first = false;
1032
    if (!first) sb.append(", ");
1033
    sb.append("uploadId:");
1034
    sb.append(this.uploadId);
1035
    first = false;
1036
    sb.append(")");
1037
    return sb.toString();
1038
  }
1039
 
1040
  public void validate() throws org.apache.thrift.TException {
1041
    // check for required fields
1042
  }
1043
 
1044
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
1045
    try {
1046
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
1047
    } catch (org.apache.thrift.TException te) {
1048
      throw new java.io.IOException(te);
1049
    }
1050
  }
1051
 
1052
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
1053
    try {
1054
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
1055
      __isset_bit_vector = new BitSet(1);
1056
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
1057
    } catch (org.apache.thrift.TException te) {
1058
      throw new java.io.IOException(te);
1059
    }
1060
  }
1061
 
1062
}
1063