Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

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