Subversion Repositories SmartDukaan

Rev

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