Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

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