Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
7977 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 CartEvents implements org.apache.thrift.TBase<CartEvents, CartEvents._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CartEvents");
25
 
26
  private static final org.apache.thrift.protocol.TField CATALOG_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("catalogId", org.apache.thrift.protocol.TType.I64, (short)1);
27
  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)2);
28
  private static final org.apache.thrift.protocol.TField SELLING_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("sellingPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)3);
29
  private static final org.apache.thrift.protocol.TField IP_FIELD_DESC = new org.apache.thrift.protocol.TField("ip", org.apache.thrift.protocol.TType.STRING, (short)4);
30
  private static final org.apache.thrift.protocol.TField SESSION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionId", org.apache.thrift.protocol.TType.STRING, (short)5);
31
  private static final org.apache.thrift.protocol.TField IN_STOCK_FIELD_DESC = new org.apache.thrift.protocol.TField("inStock", org.apache.thrift.protocol.TType.BOOL, (short)6);
32
  private static final org.apache.thrift.protocol.TField COMING_SOON_FIELD_DESC = new org.apache.thrift.protocol.TField("comingSoon", org.apache.thrift.protocol.TType.BOOL, (short)7);
33
  private static final org.apache.thrift.protocol.TField EVENT_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("eventDate", org.apache.thrift.protocol.TType.I64, (short)8);
34
 
35
  private long catalogId; // required
36
  private long itemId; // required
37
  private double sellingPrice; // required
38
  private String ip; // required
39
  private String sessionId; // required
40
  private boolean inStock; // required
41
  private boolean comingSoon; // required
42
  private long eventDate; // required
43
 
44
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
45
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
46
    CATALOG_ID((short)1, "catalogId"),
47
    ITEM_ID((short)2, "itemId"),
48
    SELLING_PRICE((short)3, "sellingPrice"),
49
    IP((short)4, "ip"),
50
    SESSION_ID((short)5, "sessionId"),
51
    IN_STOCK((short)6, "inStock"),
52
    COMING_SOON((short)7, "comingSoon"),
53
    EVENT_DATE((short)8, "eventDate");
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: // CATALOG_ID
69
          return CATALOG_ID;
70
        case 2: // ITEM_ID
71
          return ITEM_ID;
72
        case 3: // SELLING_PRICE
73
          return SELLING_PRICE;
74
        case 4: // IP
75
          return IP;
76
        case 5: // SESSION_ID
77
          return SESSION_ID;
78
        case 6: // IN_STOCK
79
          return IN_STOCK;
80
        case 7: // COMING_SOON
81
          return COMING_SOON;
82
        case 8: // EVENT_DATE
83
          return EVENT_DATE;
84
        default:
85
          return null;
86
      }
87
    }
88
 
89
    /**
90
     * Find the _Fields constant that matches fieldId, throwing an exception
91
     * if it is not found.
92
     */
93
    public static _Fields findByThriftIdOrThrow(int fieldId) {
94
      _Fields fields = findByThriftId(fieldId);
95
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
96
      return fields;
97
    }
98
 
99
    /**
100
     * Find the _Fields constant that matches name, or null if its not found.
101
     */
102
    public static _Fields findByName(String name) {
103
      return byName.get(name);
104
    }
105
 
106
    private final short _thriftId;
107
    private final String _fieldName;
108
 
109
    _Fields(short thriftId, String fieldName) {
110
      _thriftId = thriftId;
111
      _fieldName = fieldName;
112
    }
113
 
114
    public short getThriftFieldId() {
115
      return _thriftId;
116
    }
117
 
118
    public String getFieldName() {
119
      return _fieldName;
120
    }
121
  }
122
 
123
  // isset id assignments
124
  private static final int __CATALOGID_ISSET_ID = 0;
125
  private static final int __ITEMID_ISSET_ID = 1;
126
  private static final int __SELLINGPRICE_ISSET_ID = 2;
127
  private static final int __INSTOCK_ISSET_ID = 3;
128
  private static final int __COMINGSOON_ISSET_ID = 4;
129
  private static final int __EVENTDATE_ISSET_ID = 5;
130
  private BitSet __isset_bit_vector = new BitSet(6);
131
 
132
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
133
  static {
134
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
135
    tmpMap.put(_Fields.CATALOG_ID, new org.apache.thrift.meta_data.FieldMetaData("catalogId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
136
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
137
    tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("itemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
138
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
139
    tmpMap.put(_Fields.SELLING_PRICE, new org.apache.thrift.meta_data.FieldMetaData("sellingPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
140
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
141
    tmpMap.put(_Fields.IP, new org.apache.thrift.meta_data.FieldMetaData("ip", org.apache.thrift.TFieldRequirementType.DEFAULT, 
142
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
143
    tmpMap.put(_Fields.SESSION_ID, new org.apache.thrift.meta_data.FieldMetaData("sessionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
144
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
145
    tmpMap.put(_Fields.IN_STOCK, new org.apache.thrift.meta_data.FieldMetaData("inStock", org.apache.thrift.TFieldRequirementType.DEFAULT, 
146
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
147
    tmpMap.put(_Fields.COMING_SOON, new org.apache.thrift.meta_data.FieldMetaData("comingSoon", org.apache.thrift.TFieldRequirementType.DEFAULT, 
148
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
149
    tmpMap.put(_Fields.EVENT_DATE, new org.apache.thrift.meta_data.FieldMetaData("eventDate", org.apache.thrift.TFieldRequirementType.DEFAULT, 
150
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
151
    metaDataMap = Collections.unmodifiableMap(tmpMap);
152
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CartEvents.class, metaDataMap);
153
  }
154
 
155
  public CartEvents() {
156
  }
157
 
158
  public CartEvents(
159
    long catalogId,
160
    long itemId,
161
    double sellingPrice,
162
    String ip,
163
    String sessionId,
164
    boolean inStock,
165
    boolean comingSoon,
166
    long eventDate)
167
  {
168
    this();
169
    this.catalogId = catalogId;
170
    setCatalogIdIsSet(true);
171
    this.itemId = itemId;
172
    setItemIdIsSet(true);
173
    this.sellingPrice = sellingPrice;
174
    setSellingPriceIsSet(true);
175
    this.ip = ip;
176
    this.sessionId = sessionId;
177
    this.inStock = inStock;
178
    setInStockIsSet(true);
179
    this.comingSoon = comingSoon;
180
    setComingSoonIsSet(true);
181
    this.eventDate = eventDate;
182
    setEventDateIsSet(true);
183
  }
184
 
185
  /**
186
   * Performs a deep copy on <i>other</i>.
187
   */
188
  public CartEvents(CartEvents other) {
189
    __isset_bit_vector.clear();
190
    __isset_bit_vector.or(other.__isset_bit_vector);
191
    this.catalogId = other.catalogId;
192
    this.itemId = other.itemId;
193
    this.sellingPrice = other.sellingPrice;
194
    if (other.isSetIp()) {
195
      this.ip = other.ip;
196
    }
197
    if (other.isSetSessionId()) {
198
      this.sessionId = other.sessionId;
199
    }
200
    this.inStock = other.inStock;
201
    this.comingSoon = other.comingSoon;
202
    this.eventDate = other.eventDate;
203
  }
204
 
205
  public CartEvents deepCopy() {
206
    return new CartEvents(this);
207
  }
208
 
209
  @Override
210
  public void clear() {
211
    setCatalogIdIsSet(false);
212
    this.catalogId = 0;
213
    setItemIdIsSet(false);
214
    this.itemId = 0;
215
    setSellingPriceIsSet(false);
216
    this.sellingPrice = 0.0;
217
    this.ip = null;
218
    this.sessionId = null;
219
    setInStockIsSet(false);
220
    this.inStock = false;
221
    setComingSoonIsSet(false);
222
    this.comingSoon = false;
223
    setEventDateIsSet(false);
224
    this.eventDate = 0;
225
  }
226
 
227
  public long getCatalogId() {
228
    return this.catalogId;
229
  }
230
 
231
  public void setCatalogId(long catalogId) {
232
    this.catalogId = catalogId;
233
    setCatalogIdIsSet(true);
234
  }
235
 
236
  public void unsetCatalogId() {
237
    __isset_bit_vector.clear(__CATALOGID_ISSET_ID);
238
  }
239
 
240
  /** Returns true if field catalogId is set (has been assigned a value) and false otherwise */
241
  public boolean isSetCatalogId() {
242
    return __isset_bit_vector.get(__CATALOGID_ISSET_ID);
243
  }
244
 
245
  public void setCatalogIdIsSet(boolean value) {
246
    __isset_bit_vector.set(__CATALOGID_ISSET_ID, value);
247
  }
248
 
249
  public long getItemId() {
250
    return this.itemId;
251
  }
252
 
253
  public void setItemId(long itemId) {
254
    this.itemId = itemId;
255
    setItemIdIsSet(true);
256
  }
257
 
258
  public void unsetItemId() {
259
    __isset_bit_vector.clear(__ITEMID_ISSET_ID);
260
  }
261
 
262
  /** Returns true if field itemId is set (has been assigned a value) and false otherwise */
263
  public boolean isSetItemId() {
264
    return __isset_bit_vector.get(__ITEMID_ISSET_ID);
265
  }
266
 
267
  public void setItemIdIsSet(boolean value) {
268
    __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
269
  }
270
 
271
  public double getSellingPrice() {
272
    return this.sellingPrice;
273
  }
274
 
275
  public void setSellingPrice(double sellingPrice) {
276
    this.sellingPrice = sellingPrice;
277
    setSellingPriceIsSet(true);
278
  }
279
 
280
  public void unsetSellingPrice() {
281
    __isset_bit_vector.clear(__SELLINGPRICE_ISSET_ID);
282
  }
283
 
284
  /** Returns true if field sellingPrice is set (has been assigned a value) and false otherwise */
285
  public boolean isSetSellingPrice() {
286
    return __isset_bit_vector.get(__SELLINGPRICE_ISSET_ID);
287
  }
288
 
289
  public void setSellingPriceIsSet(boolean value) {
290
    __isset_bit_vector.set(__SELLINGPRICE_ISSET_ID, value);
291
  }
292
 
293
  public String getIp() {
294
    return this.ip;
295
  }
296
 
297
  public void setIp(String ip) {
298
    this.ip = ip;
299
  }
300
 
301
  public void unsetIp() {
302
    this.ip = null;
303
  }
304
 
305
  /** Returns true if field ip is set (has been assigned a value) and false otherwise */
306
  public boolean isSetIp() {
307
    return this.ip != null;
308
  }
309
 
310
  public void setIpIsSet(boolean value) {
311
    if (!value) {
312
      this.ip = null;
313
    }
314
  }
315
 
316
  public String getSessionId() {
317
    return this.sessionId;
318
  }
319
 
320
  public void setSessionId(String sessionId) {
321
    this.sessionId = sessionId;
322
  }
323
 
324
  public void unsetSessionId() {
325
    this.sessionId = null;
326
  }
327
 
328
  /** Returns true if field sessionId is set (has been assigned a value) and false otherwise */
329
  public boolean isSetSessionId() {
330
    return this.sessionId != null;
331
  }
332
 
333
  public void setSessionIdIsSet(boolean value) {
334
    if (!value) {
335
      this.sessionId = null;
336
    }
337
  }
338
 
339
  public boolean isInStock() {
340
    return this.inStock;
341
  }
342
 
343
  public void setInStock(boolean inStock) {
344
    this.inStock = inStock;
345
    setInStockIsSet(true);
346
  }
347
 
348
  public void unsetInStock() {
349
    __isset_bit_vector.clear(__INSTOCK_ISSET_ID);
350
  }
351
 
352
  /** Returns true if field inStock is set (has been assigned a value) and false otherwise */
353
  public boolean isSetInStock() {
354
    return __isset_bit_vector.get(__INSTOCK_ISSET_ID);
355
  }
356
 
357
  public void setInStockIsSet(boolean value) {
358
    __isset_bit_vector.set(__INSTOCK_ISSET_ID, value);
359
  }
360
 
361
  public boolean isComingSoon() {
362
    return this.comingSoon;
363
  }
364
 
365
  public void setComingSoon(boolean comingSoon) {
366
    this.comingSoon = comingSoon;
367
    setComingSoonIsSet(true);
368
  }
369
 
370
  public void unsetComingSoon() {
371
    __isset_bit_vector.clear(__COMINGSOON_ISSET_ID);
372
  }
373
 
374
  /** Returns true if field comingSoon is set (has been assigned a value) and false otherwise */
375
  public boolean isSetComingSoon() {
376
    return __isset_bit_vector.get(__COMINGSOON_ISSET_ID);
377
  }
378
 
379
  public void setComingSoonIsSet(boolean value) {
380
    __isset_bit_vector.set(__COMINGSOON_ISSET_ID, value);
381
  }
382
 
383
  public long getEventDate() {
384
    return this.eventDate;
385
  }
386
 
387
  public void setEventDate(long eventDate) {
388
    this.eventDate = eventDate;
389
    setEventDateIsSet(true);
390
  }
391
 
392
  public void unsetEventDate() {
393
    __isset_bit_vector.clear(__EVENTDATE_ISSET_ID);
394
  }
395
 
396
  /** Returns true if field eventDate is set (has been assigned a value) and false otherwise */
397
  public boolean isSetEventDate() {
398
    return __isset_bit_vector.get(__EVENTDATE_ISSET_ID);
399
  }
400
 
401
  public void setEventDateIsSet(boolean value) {
402
    __isset_bit_vector.set(__EVENTDATE_ISSET_ID, value);
403
  }
404
 
405
  public void setFieldValue(_Fields field, Object value) {
406
    switch (field) {
407
    case CATALOG_ID:
408
      if (value == null) {
409
        unsetCatalogId();
410
      } else {
411
        setCatalogId((Long)value);
412
      }
413
      break;
414
 
415
    case ITEM_ID:
416
      if (value == null) {
417
        unsetItemId();
418
      } else {
419
        setItemId((Long)value);
420
      }
421
      break;
422
 
423
    case SELLING_PRICE:
424
      if (value == null) {
425
        unsetSellingPrice();
426
      } else {
427
        setSellingPrice((Double)value);
428
      }
429
      break;
430
 
431
    case IP:
432
      if (value == null) {
433
        unsetIp();
434
      } else {
435
        setIp((String)value);
436
      }
437
      break;
438
 
439
    case SESSION_ID:
440
      if (value == null) {
441
        unsetSessionId();
442
      } else {
443
        setSessionId((String)value);
444
      }
445
      break;
446
 
447
    case IN_STOCK:
448
      if (value == null) {
449
        unsetInStock();
450
      } else {
451
        setInStock((Boolean)value);
452
      }
453
      break;
454
 
455
    case COMING_SOON:
456
      if (value == null) {
457
        unsetComingSoon();
458
      } else {
459
        setComingSoon((Boolean)value);
460
      }
461
      break;
462
 
463
    case EVENT_DATE:
464
      if (value == null) {
465
        unsetEventDate();
466
      } else {
467
        setEventDate((Long)value);
468
      }
469
      break;
470
 
471
    }
472
  }
473
 
474
  public Object getFieldValue(_Fields field) {
475
    switch (field) {
476
    case CATALOG_ID:
477
      return Long.valueOf(getCatalogId());
478
 
479
    case ITEM_ID:
480
      return Long.valueOf(getItemId());
481
 
482
    case SELLING_PRICE:
483
      return Double.valueOf(getSellingPrice());
484
 
485
    case IP:
486
      return getIp();
487
 
488
    case SESSION_ID:
489
      return getSessionId();
490
 
491
    case IN_STOCK:
492
      return Boolean.valueOf(isInStock());
493
 
494
    case COMING_SOON:
495
      return Boolean.valueOf(isComingSoon());
496
 
497
    case EVENT_DATE:
498
      return Long.valueOf(getEventDate());
499
 
500
    }
501
    throw new IllegalStateException();
502
  }
503
 
504
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
505
  public boolean isSet(_Fields field) {
506
    if (field == null) {
507
      throw new IllegalArgumentException();
508
    }
509
 
510
    switch (field) {
511
    case CATALOG_ID:
512
      return isSetCatalogId();
513
    case ITEM_ID:
514
      return isSetItemId();
515
    case SELLING_PRICE:
516
      return isSetSellingPrice();
517
    case IP:
518
      return isSetIp();
519
    case SESSION_ID:
520
      return isSetSessionId();
521
    case IN_STOCK:
522
      return isSetInStock();
523
    case COMING_SOON:
524
      return isSetComingSoon();
525
    case EVENT_DATE:
526
      return isSetEventDate();
527
    }
528
    throw new IllegalStateException();
529
  }
530
 
531
  @Override
532
  public boolean equals(Object that) {
533
    if (that == null)
534
      return false;
535
    if (that instanceof CartEvents)
536
      return this.equals((CartEvents)that);
537
    return false;
538
  }
539
 
540
  public boolean equals(CartEvents that) {
541
    if (that == null)
542
      return false;
543
 
544
    boolean this_present_catalogId = true;
545
    boolean that_present_catalogId = true;
546
    if (this_present_catalogId || that_present_catalogId) {
547
      if (!(this_present_catalogId && that_present_catalogId))
548
        return false;
549
      if (this.catalogId != that.catalogId)
550
        return false;
551
    }
552
 
553
    boolean this_present_itemId = true;
554
    boolean that_present_itemId = true;
555
    if (this_present_itemId || that_present_itemId) {
556
      if (!(this_present_itemId && that_present_itemId))
557
        return false;
558
      if (this.itemId != that.itemId)
559
        return false;
560
    }
561
 
562
    boolean this_present_sellingPrice = true;
563
    boolean that_present_sellingPrice = true;
564
    if (this_present_sellingPrice || that_present_sellingPrice) {
565
      if (!(this_present_sellingPrice && that_present_sellingPrice))
566
        return false;
567
      if (this.sellingPrice != that.sellingPrice)
568
        return false;
569
    }
570
 
571
    boolean this_present_ip = true && this.isSetIp();
572
    boolean that_present_ip = true && that.isSetIp();
573
    if (this_present_ip || that_present_ip) {
574
      if (!(this_present_ip && that_present_ip))
575
        return false;
576
      if (!this.ip.equals(that.ip))
577
        return false;
578
    }
579
 
580
    boolean this_present_sessionId = true && this.isSetSessionId();
581
    boolean that_present_sessionId = true && that.isSetSessionId();
582
    if (this_present_sessionId || that_present_sessionId) {
583
      if (!(this_present_sessionId && that_present_sessionId))
584
        return false;
585
      if (!this.sessionId.equals(that.sessionId))
586
        return false;
587
    }
588
 
589
    boolean this_present_inStock = true;
590
    boolean that_present_inStock = true;
591
    if (this_present_inStock || that_present_inStock) {
592
      if (!(this_present_inStock && that_present_inStock))
593
        return false;
594
      if (this.inStock != that.inStock)
595
        return false;
596
    }
597
 
598
    boolean this_present_comingSoon = true;
599
    boolean that_present_comingSoon = true;
600
    if (this_present_comingSoon || that_present_comingSoon) {
601
      if (!(this_present_comingSoon && that_present_comingSoon))
602
        return false;
603
      if (this.comingSoon != that.comingSoon)
604
        return false;
605
    }
606
 
607
    boolean this_present_eventDate = true;
608
    boolean that_present_eventDate = true;
609
    if (this_present_eventDate || that_present_eventDate) {
610
      if (!(this_present_eventDate && that_present_eventDate))
611
        return false;
612
      if (this.eventDate != that.eventDate)
613
        return false;
614
    }
615
 
616
    return true;
617
  }
618
 
619
  @Override
620
  public int hashCode() {
621
    return 0;
622
  }
623
 
624
  public int compareTo(CartEvents other) {
625
    if (!getClass().equals(other.getClass())) {
626
      return getClass().getName().compareTo(other.getClass().getName());
627
    }
628
 
629
    int lastComparison = 0;
630
    CartEvents typedOther = (CartEvents)other;
631
 
632
    lastComparison = Boolean.valueOf(isSetCatalogId()).compareTo(typedOther.isSetCatalogId());
633
    if (lastComparison != 0) {
634
      return lastComparison;
635
    }
636
    if (isSetCatalogId()) {
637
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catalogId, typedOther.catalogId);
638
      if (lastComparison != 0) {
639
        return lastComparison;
640
      }
641
    }
642
    lastComparison = Boolean.valueOf(isSetItemId()).compareTo(typedOther.isSetItemId());
643
    if (lastComparison != 0) {
644
      return lastComparison;
645
    }
646
    if (isSetItemId()) {
647
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemId, typedOther.itemId);
648
      if (lastComparison != 0) {
649
        return lastComparison;
650
      }
651
    }
652
    lastComparison = Boolean.valueOf(isSetSellingPrice()).compareTo(typedOther.isSetSellingPrice());
653
    if (lastComparison != 0) {
654
      return lastComparison;
655
    }
656
    if (isSetSellingPrice()) {
657
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sellingPrice, typedOther.sellingPrice);
658
      if (lastComparison != 0) {
659
        return lastComparison;
660
      }
661
    }
662
    lastComparison = Boolean.valueOf(isSetIp()).compareTo(typedOther.isSetIp());
663
    if (lastComparison != 0) {
664
      return lastComparison;
665
    }
666
    if (isSetIp()) {
667
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ip, typedOther.ip);
668
      if (lastComparison != 0) {
669
        return lastComparison;
670
      }
671
    }
672
    lastComparison = Boolean.valueOf(isSetSessionId()).compareTo(typedOther.isSetSessionId());
673
    if (lastComparison != 0) {
674
      return lastComparison;
675
    }
676
    if (isSetSessionId()) {
677
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionId, typedOther.sessionId);
678
      if (lastComparison != 0) {
679
        return lastComparison;
680
      }
681
    }
682
    lastComparison = Boolean.valueOf(isSetInStock()).compareTo(typedOther.isSetInStock());
683
    if (lastComparison != 0) {
684
      return lastComparison;
685
    }
686
    if (isSetInStock()) {
687
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.inStock, typedOther.inStock);
688
      if (lastComparison != 0) {
689
        return lastComparison;
690
      }
691
    }
692
    lastComparison = Boolean.valueOf(isSetComingSoon()).compareTo(typedOther.isSetComingSoon());
693
    if (lastComparison != 0) {
694
      return lastComparison;
695
    }
696
    if (isSetComingSoon()) {
697
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.comingSoon, typedOther.comingSoon);
698
      if (lastComparison != 0) {
699
        return lastComparison;
700
      }
701
    }
702
    lastComparison = Boolean.valueOf(isSetEventDate()).compareTo(typedOther.isSetEventDate());
703
    if (lastComparison != 0) {
704
      return lastComparison;
705
    }
706
    if (isSetEventDate()) {
707
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eventDate, typedOther.eventDate);
708
      if (lastComparison != 0) {
709
        return lastComparison;
710
      }
711
    }
712
    return 0;
713
  }
714
 
715
  public _Fields fieldForId(int fieldId) {
716
    return _Fields.findByThriftId(fieldId);
717
  }
718
 
719
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
720
    org.apache.thrift.protocol.TField field;
721
    iprot.readStructBegin();
722
    while (true)
723
    {
724
      field = iprot.readFieldBegin();
725
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
726
        break;
727
      }
728
      switch (field.id) {
729
        case 1: // CATALOG_ID
730
          if (field.type == org.apache.thrift.protocol.TType.I64) {
731
            this.catalogId = iprot.readI64();
732
            setCatalogIdIsSet(true);
733
          } else { 
734
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
735
          }
736
          break;
737
        case 2: // ITEM_ID
738
          if (field.type == org.apache.thrift.protocol.TType.I64) {
739
            this.itemId = iprot.readI64();
740
            setItemIdIsSet(true);
741
          } else { 
742
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
743
          }
744
          break;
745
        case 3: // SELLING_PRICE
746
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
747
            this.sellingPrice = iprot.readDouble();
748
            setSellingPriceIsSet(true);
749
          } else { 
750
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
751
          }
752
          break;
753
        case 4: // IP
754
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
755
            this.ip = iprot.readString();
756
          } else { 
757
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
758
          }
759
          break;
760
        case 5: // SESSION_ID
761
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
762
            this.sessionId = iprot.readString();
763
          } else { 
764
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
765
          }
766
          break;
767
        case 6: // IN_STOCK
768
          if (field.type == org.apache.thrift.protocol.TType.BOOL) {
769
            this.inStock = iprot.readBool();
770
            setInStockIsSet(true);
771
          } else { 
772
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
773
          }
774
          break;
775
        case 7: // COMING_SOON
776
          if (field.type == org.apache.thrift.protocol.TType.BOOL) {
777
            this.comingSoon = iprot.readBool();
778
            setComingSoonIsSet(true);
779
          } else { 
780
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
781
          }
782
          break;
783
        case 8: // EVENT_DATE
784
          if (field.type == org.apache.thrift.protocol.TType.I64) {
785
            this.eventDate = iprot.readI64();
786
            setEventDateIsSet(true);
787
          } else { 
788
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
789
          }
790
          break;
791
        default:
792
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
793
      }
794
      iprot.readFieldEnd();
795
    }
796
    iprot.readStructEnd();
797
    validate();
798
  }
799
 
800
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
801
    validate();
802
 
803
    oprot.writeStructBegin(STRUCT_DESC);
804
    oprot.writeFieldBegin(CATALOG_ID_FIELD_DESC);
805
    oprot.writeI64(this.catalogId);
806
    oprot.writeFieldEnd();
807
    oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
808
    oprot.writeI64(this.itemId);
809
    oprot.writeFieldEnd();
810
    oprot.writeFieldBegin(SELLING_PRICE_FIELD_DESC);
811
    oprot.writeDouble(this.sellingPrice);
812
    oprot.writeFieldEnd();
813
    if (this.ip != null) {
814
      oprot.writeFieldBegin(IP_FIELD_DESC);
815
      oprot.writeString(this.ip);
816
      oprot.writeFieldEnd();
817
    }
818
    if (this.sessionId != null) {
819
      oprot.writeFieldBegin(SESSION_ID_FIELD_DESC);
820
      oprot.writeString(this.sessionId);
821
      oprot.writeFieldEnd();
822
    }
823
    oprot.writeFieldBegin(IN_STOCK_FIELD_DESC);
824
    oprot.writeBool(this.inStock);
825
    oprot.writeFieldEnd();
826
    oprot.writeFieldBegin(COMING_SOON_FIELD_DESC);
827
    oprot.writeBool(this.comingSoon);
828
    oprot.writeFieldEnd();
829
    oprot.writeFieldBegin(EVENT_DATE_FIELD_DESC);
830
    oprot.writeI64(this.eventDate);
831
    oprot.writeFieldEnd();
832
    oprot.writeFieldStop();
833
    oprot.writeStructEnd();
834
  }
835
 
836
  @Override
837
  public String toString() {
838
    StringBuilder sb = new StringBuilder("CartEvents(");
839
    boolean first = true;
840
 
841
    sb.append("catalogId:");
842
    sb.append(this.catalogId);
843
    first = false;
844
    if (!first) sb.append(", ");
845
    sb.append("itemId:");
846
    sb.append(this.itemId);
847
    first = false;
848
    if (!first) sb.append(", ");
849
    sb.append("sellingPrice:");
850
    sb.append(this.sellingPrice);
851
    first = false;
852
    if (!first) sb.append(", ");
853
    sb.append("ip:");
854
    if (this.ip == null) {
855
      sb.append("null");
856
    } else {
857
      sb.append(this.ip);
858
    }
859
    first = false;
860
    if (!first) sb.append(", ");
861
    sb.append("sessionId:");
862
    if (this.sessionId == null) {
863
      sb.append("null");
864
    } else {
865
      sb.append(this.sessionId);
866
    }
867
    first = false;
868
    if (!first) sb.append(", ");
869
    sb.append("inStock:");
870
    sb.append(this.inStock);
871
    first = false;
872
    if (!first) sb.append(", ");
873
    sb.append("comingSoon:");
874
    sb.append(this.comingSoon);
875
    first = false;
876
    if (!first) sb.append(", ");
877
    sb.append("eventDate:");
878
    sb.append(this.eventDate);
879
    first = false;
880
    sb.append(")");
881
    return sb.toString();
882
  }
883
 
884
  public void validate() throws org.apache.thrift.TException {
885
    // check for required fields
886
  }
887
 
888
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
889
    try {
890
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
891
    } catch (org.apache.thrift.TException te) {
892
      throw new java.io.IOException(te);
893
    }
894
  }
895
 
896
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
897
    try {
898
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
899
      __isset_bit_vector = new BitSet(1);
900
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
901
    } catch (org.apache.thrift.TException te) {
902
      throw new java.io.IOException(te);
903
    }
904
  }
905
 
906
}
907