Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
11531 vikram.rag 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 PrivateDeal implements org.apache.thrift.TBase<PrivateDeal, PrivateDeal._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("PrivateDeal");
25
 
26
  private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("item_id", org.apache.thrift.protocol.TType.I64, (short)1);
27
  private static final org.apache.thrift.protocol.TField DEAL_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("dealPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)2);
28
  private static final org.apache.thrift.protocol.TField DEAL_FREEBIE_ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("dealFreebieItemId", org.apache.thrift.protocol.TType.I64, (short)3);
29
  private static final org.apache.thrift.protocol.TField START_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("startDate", org.apache.thrift.protocol.TType.I64, (short)4);
30
  private static final org.apache.thrift.protocol.TField END_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("endDate", org.apache.thrift.protocol.TType.I64, (short)5);
31
  private static final org.apache.thrift.protocol.TField IS_DEAL_TEXT_IDENTICAL_FIELD_DESC = new org.apache.thrift.protocol.TField("isDealTextIdentical", org.apache.thrift.protocol.TType.BOOL, (short)6);
32
  private static final org.apache.thrift.protocol.TField DEAL_TEXT_FIELD_DESC = new org.apache.thrift.protocol.TField("dealText", org.apache.thrift.protocol.TType.STRING, (short)7);
33
  private static final org.apache.thrift.protocol.TField IS_COD_FIELD_DESC = new org.apache.thrift.protocol.TField("isCod", org.apache.thrift.protocol.TType.BOOL, (short)8);
34
  private static final org.apache.thrift.protocol.TField RANK_FIELD_DESC = new org.apache.thrift.protocol.TField("rank", org.apache.thrift.protocol.TType.I64, (short)9);
35
 
36
  private long item_id; // required
37
  private double dealPrice; // required
38
  private long dealFreebieItemId; // required
39
  private long startDate; // required
40
  private long endDate; // required
41
  private boolean isDealTextIdentical; // required
42
  private String dealText; // required
43
  private boolean isCod; // required
44
  private long rank; // required
45
 
46
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
47
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
48
    ITEM_ID((short)1, "item_id"),
49
    DEAL_PRICE((short)2, "dealPrice"),
50
    DEAL_FREEBIE_ITEM_ID((short)3, "dealFreebieItemId"),
51
    START_DATE((short)4, "startDate"),
52
    END_DATE((short)5, "endDate"),
53
    IS_DEAL_TEXT_IDENTICAL((short)6, "isDealTextIdentical"),
54
    DEAL_TEXT((short)7, "dealText"),
55
    IS_COD((short)8, "isCod"),
56
    RANK((short)9, "rank");
57
 
58
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
59
 
60
    static {
61
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
62
        byName.put(field.getFieldName(), field);
63
      }
64
    }
65
 
66
    /**
67
     * Find the _Fields constant that matches fieldId, or null if its not found.
68
     */
69
    public static _Fields findByThriftId(int fieldId) {
70
      switch(fieldId) {
71
        case 1: // ITEM_ID
72
          return ITEM_ID;
73
        case 2: // DEAL_PRICE
74
          return DEAL_PRICE;
75
        case 3: // DEAL_FREEBIE_ITEM_ID
76
          return DEAL_FREEBIE_ITEM_ID;
77
        case 4: // START_DATE
78
          return START_DATE;
79
        case 5: // END_DATE
80
          return END_DATE;
81
        case 6: // IS_DEAL_TEXT_IDENTICAL
82
          return IS_DEAL_TEXT_IDENTICAL;
83
        case 7: // DEAL_TEXT
84
          return DEAL_TEXT;
85
        case 8: // IS_COD
86
          return IS_COD;
87
        case 9: // RANK
88
          return RANK;
89
        default:
90
          return null;
91
      }
92
    }
93
 
94
    /**
95
     * Find the _Fields constant that matches fieldId, throwing an exception
96
     * if it is not found.
97
     */
98
    public static _Fields findByThriftIdOrThrow(int fieldId) {
99
      _Fields fields = findByThriftId(fieldId);
100
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
101
      return fields;
102
    }
103
 
104
    /**
105
     * Find the _Fields constant that matches name, or null if its not found.
106
     */
107
    public static _Fields findByName(String name) {
108
      return byName.get(name);
109
    }
110
 
111
    private final short _thriftId;
112
    private final String _fieldName;
113
 
114
    _Fields(short thriftId, String fieldName) {
115
      _thriftId = thriftId;
116
      _fieldName = fieldName;
117
    }
118
 
119
    public short getThriftFieldId() {
120
      return _thriftId;
121
    }
122
 
123
    public String getFieldName() {
124
      return _fieldName;
125
    }
126
  }
127
 
128
  // isset id assignments
129
  private static final int __ITEM_ID_ISSET_ID = 0;
130
  private static final int __DEALPRICE_ISSET_ID = 1;
131
  private static final int __DEALFREEBIEITEMID_ISSET_ID = 2;
132
  private static final int __STARTDATE_ISSET_ID = 3;
133
  private static final int __ENDDATE_ISSET_ID = 4;
134
  private static final int __ISDEALTEXTIDENTICAL_ISSET_ID = 5;
135
  private static final int __ISCOD_ISSET_ID = 6;
136
  private static final int __RANK_ISSET_ID = 7;
137
  private BitSet __isset_bit_vector = new BitSet(8);
138
 
139
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
140
  static {
141
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
142
    tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("item_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
143
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
144
    tmpMap.put(_Fields.DEAL_PRICE, new org.apache.thrift.meta_data.FieldMetaData("dealPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
145
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
146
    tmpMap.put(_Fields.DEAL_FREEBIE_ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("dealFreebieItemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
147
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
148
    tmpMap.put(_Fields.START_DATE, new org.apache.thrift.meta_data.FieldMetaData("startDate", org.apache.thrift.TFieldRequirementType.DEFAULT, 
149
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
150
    tmpMap.put(_Fields.END_DATE, new org.apache.thrift.meta_data.FieldMetaData("endDate", org.apache.thrift.TFieldRequirementType.DEFAULT, 
151
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
152
    tmpMap.put(_Fields.IS_DEAL_TEXT_IDENTICAL, new org.apache.thrift.meta_data.FieldMetaData("isDealTextIdentical", org.apache.thrift.TFieldRequirementType.DEFAULT, 
153
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
154
    tmpMap.put(_Fields.DEAL_TEXT, new org.apache.thrift.meta_data.FieldMetaData("dealText", org.apache.thrift.TFieldRequirementType.DEFAULT, 
155
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
156
    tmpMap.put(_Fields.IS_COD, new org.apache.thrift.meta_data.FieldMetaData("isCod", org.apache.thrift.TFieldRequirementType.DEFAULT, 
157
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
158
    tmpMap.put(_Fields.RANK, new org.apache.thrift.meta_data.FieldMetaData("rank", org.apache.thrift.TFieldRequirementType.DEFAULT, 
159
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
160
    metaDataMap = Collections.unmodifiableMap(tmpMap);
161
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PrivateDeal.class, metaDataMap);
162
  }
163
 
164
  public PrivateDeal() {
165
  }
166
 
167
  public PrivateDeal(
168
    long item_id,
169
    double dealPrice,
170
    long dealFreebieItemId,
171
    long startDate,
172
    long endDate,
173
    boolean isDealTextIdentical,
174
    String dealText,
175
    boolean isCod,
176
    long rank)
177
  {
178
    this();
179
    this.item_id = item_id;
180
    setItem_idIsSet(true);
181
    this.dealPrice = dealPrice;
182
    setDealPriceIsSet(true);
183
    this.dealFreebieItemId = dealFreebieItemId;
184
    setDealFreebieItemIdIsSet(true);
185
    this.startDate = startDate;
186
    setStartDateIsSet(true);
187
    this.endDate = endDate;
188
    setEndDateIsSet(true);
189
    this.isDealTextIdentical = isDealTextIdentical;
190
    setIsDealTextIdenticalIsSet(true);
191
    this.dealText = dealText;
192
    this.isCod = isCod;
193
    setIsCodIsSet(true);
194
    this.rank = rank;
195
    setRankIsSet(true);
196
  }
197
 
198
  /**
199
   * Performs a deep copy on <i>other</i>.
200
   */
201
  public PrivateDeal(PrivateDeal other) {
202
    __isset_bit_vector.clear();
203
    __isset_bit_vector.or(other.__isset_bit_vector);
204
    this.item_id = other.item_id;
205
    this.dealPrice = other.dealPrice;
206
    this.dealFreebieItemId = other.dealFreebieItemId;
207
    this.startDate = other.startDate;
208
    this.endDate = other.endDate;
209
    this.isDealTextIdentical = other.isDealTextIdentical;
210
    if (other.isSetDealText()) {
211
      this.dealText = other.dealText;
212
    }
213
    this.isCod = other.isCod;
214
    this.rank = other.rank;
215
  }
216
 
217
  public PrivateDeal deepCopy() {
218
    return new PrivateDeal(this);
219
  }
220
 
221
  @Override
222
  public void clear() {
223
    setItem_idIsSet(false);
224
    this.item_id = 0;
225
    setDealPriceIsSet(false);
226
    this.dealPrice = 0.0;
227
    setDealFreebieItemIdIsSet(false);
228
    this.dealFreebieItemId = 0;
229
    setStartDateIsSet(false);
230
    this.startDate = 0;
231
    setEndDateIsSet(false);
232
    this.endDate = 0;
233
    setIsDealTextIdenticalIsSet(false);
234
    this.isDealTextIdentical = false;
235
    this.dealText = null;
236
    setIsCodIsSet(false);
237
    this.isCod = false;
238
    setRankIsSet(false);
239
    this.rank = 0;
240
  }
241
 
242
  public long getItem_id() {
243
    return this.item_id;
244
  }
245
 
246
  public void setItem_id(long item_id) {
247
    this.item_id = item_id;
248
    setItem_idIsSet(true);
249
  }
250
 
251
  public void unsetItem_id() {
252
    __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
253
  }
254
 
255
  /** Returns true if field item_id is set (has been assigned a value) and false otherwise */
256
  public boolean isSetItem_id() {
257
    return __isset_bit_vector.get(__ITEM_ID_ISSET_ID);
258
  }
259
 
260
  public void setItem_idIsSet(boolean value) {
261
    __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
262
  }
263
 
264
  public double getDealPrice() {
265
    return this.dealPrice;
266
  }
267
 
268
  public void setDealPrice(double dealPrice) {
269
    this.dealPrice = dealPrice;
270
    setDealPriceIsSet(true);
271
  }
272
 
273
  public void unsetDealPrice() {
274
    __isset_bit_vector.clear(__DEALPRICE_ISSET_ID);
275
  }
276
 
277
  /** Returns true if field dealPrice is set (has been assigned a value) and false otherwise */
278
  public boolean isSetDealPrice() {
279
    return __isset_bit_vector.get(__DEALPRICE_ISSET_ID);
280
  }
281
 
282
  public void setDealPriceIsSet(boolean value) {
283
    __isset_bit_vector.set(__DEALPRICE_ISSET_ID, value);
284
  }
285
 
286
  public long getDealFreebieItemId() {
287
    return this.dealFreebieItemId;
288
  }
289
 
290
  public void setDealFreebieItemId(long dealFreebieItemId) {
291
    this.dealFreebieItemId = dealFreebieItemId;
292
    setDealFreebieItemIdIsSet(true);
293
  }
294
 
295
  public void unsetDealFreebieItemId() {
296
    __isset_bit_vector.clear(__DEALFREEBIEITEMID_ISSET_ID);
297
  }
298
 
299
  /** Returns true if field dealFreebieItemId is set (has been assigned a value) and false otherwise */
300
  public boolean isSetDealFreebieItemId() {
301
    return __isset_bit_vector.get(__DEALFREEBIEITEMID_ISSET_ID);
302
  }
303
 
304
  public void setDealFreebieItemIdIsSet(boolean value) {
305
    __isset_bit_vector.set(__DEALFREEBIEITEMID_ISSET_ID, value);
306
  }
307
 
308
  public long getStartDate() {
309
    return this.startDate;
310
  }
311
 
312
  public void setStartDate(long startDate) {
313
    this.startDate = startDate;
314
    setStartDateIsSet(true);
315
  }
316
 
317
  public void unsetStartDate() {
318
    __isset_bit_vector.clear(__STARTDATE_ISSET_ID);
319
  }
320
 
321
  /** Returns true if field startDate is set (has been assigned a value) and false otherwise */
322
  public boolean isSetStartDate() {
323
    return __isset_bit_vector.get(__STARTDATE_ISSET_ID);
324
  }
325
 
326
  public void setStartDateIsSet(boolean value) {
327
    __isset_bit_vector.set(__STARTDATE_ISSET_ID, value);
328
  }
329
 
330
  public long getEndDate() {
331
    return this.endDate;
332
  }
333
 
334
  public void setEndDate(long endDate) {
335
    this.endDate = endDate;
336
    setEndDateIsSet(true);
337
  }
338
 
339
  public void unsetEndDate() {
340
    __isset_bit_vector.clear(__ENDDATE_ISSET_ID);
341
  }
342
 
343
  /** Returns true if field endDate is set (has been assigned a value) and false otherwise */
344
  public boolean isSetEndDate() {
345
    return __isset_bit_vector.get(__ENDDATE_ISSET_ID);
346
  }
347
 
348
  public void setEndDateIsSet(boolean value) {
349
    __isset_bit_vector.set(__ENDDATE_ISSET_ID, value);
350
  }
351
 
352
  public boolean isIsDealTextIdentical() {
353
    return this.isDealTextIdentical;
354
  }
355
 
356
  public void setIsDealTextIdentical(boolean isDealTextIdentical) {
357
    this.isDealTextIdentical = isDealTextIdentical;
358
    setIsDealTextIdenticalIsSet(true);
359
  }
360
 
361
  public void unsetIsDealTextIdentical() {
362
    __isset_bit_vector.clear(__ISDEALTEXTIDENTICAL_ISSET_ID);
363
  }
364
 
365
  /** Returns true if field isDealTextIdentical is set (has been assigned a value) and false otherwise */
366
  public boolean isSetIsDealTextIdentical() {
367
    return __isset_bit_vector.get(__ISDEALTEXTIDENTICAL_ISSET_ID);
368
  }
369
 
370
  public void setIsDealTextIdenticalIsSet(boolean value) {
371
    __isset_bit_vector.set(__ISDEALTEXTIDENTICAL_ISSET_ID, value);
372
  }
373
 
374
  public String getDealText() {
375
    return this.dealText;
376
  }
377
 
378
  public void setDealText(String dealText) {
379
    this.dealText = dealText;
380
  }
381
 
382
  public void unsetDealText() {
383
    this.dealText = null;
384
  }
385
 
386
  /** Returns true if field dealText is set (has been assigned a value) and false otherwise */
387
  public boolean isSetDealText() {
388
    return this.dealText != null;
389
  }
390
 
391
  public void setDealTextIsSet(boolean value) {
392
    if (!value) {
393
      this.dealText = null;
394
    }
395
  }
396
 
397
  public boolean isIsCod() {
398
    return this.isCod;
399
  }
400
 
401
  public void setIsCod(boolean isCod) {
402
    this.isCod = isCod;
403
    setIsCodIsSet(true);
404
  }
405
 
406
  public void unsetIsCod() {
407
    __isset_bit_vector.clear(__ISCOD_ISSET_ID);
408
  }
409
 
410
  /** Returns true if field isCod is set (has been assigned a value) and false otherwise */
411
  public boolean isSetIsCod() {
412
    return __isset_bit_vector.get(__ISCOD_ISSET_ID);
413
  }
414
 
415
  public void setIsCodIsSet(boolean value) {
416
    __isset_bit_vector.set(__ISCOD_ISSET_ID, value);
417
  }
418
 
419
  public long getRank() {
420
    return this.rank;
421
  }
422
 
423
  public void setRank(long rank) {
424
    this.rank = rank;
425
    setRankIsSet(true);
426
  }
427
 
428
  public void unsetRank() {
429
    __isset_bit_vector.clear(__RANK_ISSET_ID);
430
  }
431
 
432
  /** Returns true if field rank is set (has been assigned a value) and false otherwise */
433
  public boolean isSetRank() {
434
    return __isset_bit_vector.get(__RANK_ISSET_ID);
435
  }
436
 
437
  public void setRankIsSet(boolean value) {
438
    __isset_bit_vector.set(__RANK_ISSET_ID, value);
439
  }
440
 
441
  public void setFieldValue(_Fields field, Object value) {
442
    switch (field) {
443
    case ITEM_ID:
444
      if (value == null) {
445
        unsetItem_id();
446
      } else {
447
        setItem_id((Long)value);
448
      }
449
      break;
450
 
451
    case DEAL_PRICE:
452
      if (value == null) {
453
        unsetDealPrice();
454
      } else {
455
        setDealPrice((Double)value);
456
      }
457
      break;
458
 
459
    case DEAL_FREEBIE_ITEM_ID:
460
      if (value == null) {
461
        unsetDealFreebieItemId();
462
      } else {
463
        setDealFreebieItemId((Long)value);
464
      }
465
      break;
466
 
467
    case START_DATE:
468
      if (value == null) {
469
        unsetStartDate();
470
      } else {
471
        setStartDate((Long)value);
472
      }
473
      break;
474
 
475
    case END_DATE:
476
      if (value == null) {
477
        unsetEndDate();
478
      } else {
479
        setEndDate((Long)value);
480
      }
481
      break;
482
 
483
    case IS_DEAL_TEXT_IDENTICAL:
484
      if (value == null) {
485
        unsetIsDealTextIdentical();
486
      } else {
487
        setIsDealTextIdentical((Boolean)value);
488
      }
489
      break;
490
 
491
    case DEAL_TEXT:
492
      if (value == null) {
493
        unsetDealText();
494
      } else {
495
        setDealText((String)value);
496
      }
497
      break;
498
 
499
    case IS_COD:
500
      if (value == null) {
501
        unsetIsCod();
502
      } else {
503
        setIsCod((Boolean)value);
504
      }
505
      break;
506
 
507
    case RANK:
508
      if (value == null) {
509
        unsetRank();
510
      } else {
511
        setRank((Long)value);
512
      }
513
      break;
514
 
515
    }
516
  }
517
 
518
  public Object getFieldValue(_Fields field) {
519
    switch (field) {
520
    case ITEM_ID:
521
      return Long.valueOf(getItem_id());
522
 
523
    case DEAL_PRICE:
524
      return Double.valueOf(getDealPrice());
525
 
526
    case DEAL_FREEBIE_ITEM_ID:
527
      return Long.valueOf(getDealFreebieItemId());
528
 
529
    case START_DATE:
530
      return Long.valueOf(getStartDate());
531
 
532
    case END_DATE:
533
      return Long.valueOf(getEndDate());
534
 
535
    case IS_DEAL_TEXT_IDENTICAL:
536
      return Boolean.valueOf(isIsDealTextIdentical());
537
 
538
    case DEAL_TEXT:
539
      return getDealText();
540
 
541
    case IS_COD:
542
      return Boolean.valueOf(isIsCod());
543
 
544
    case RANK:
545
      return Long.valueOf(getRank());
546
 
547
    }
548
    throw new IllegalStateException();
549
  }
550
 
551
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
552
  public boolean isSet(_Fields field) {
553
    if (field == null) {
554
      throw new IllegalArgumentException();
555
    }
556
 
557
    switch (field) {
558
    case ITEM_ID:
559
      return isSetItem_id();
560
    case DEAL_PRICE:
561
      return isSetDealPrice();
562
    case DEAL_FREEBIE_ITEM_ID:
563
      return isSetDealFreebieItemId();
564
    case START_DATE:
565
      return isSetStartDate();
566
    case END_DATE:
567
      return isSetEndDate();
568
    case IS_DEAL_TEXT_IDENTICAL:
569
      return isSetIsDealTextIdentical();
570
    case DEAL_TEXT:
571
      return isSetDealText();
572
    case IS_COD:
573
      return isSetIsCod();
574
    case RANK:
575
      return isSetRank();
576
    }
577
    throw new IllegalStateException();
578
  }
579
 
580
  @Override
581
  public boolean equals(Object that) {
582
    if (that == null)
583
      return false;
584
    if (that instanceof PrivateDeal)
585
      return this.equals((PrivateDeal)that);
586
    return false;
587
  }
588
 
589
  public boolean equals(PrivateDeal that) {
590
    if (that == null)
591
      return false;
592
 
593
    boolean this_present_item_id = true;
594
    boolean that_present_item_id = true;
595
    if (this_present_item_id || that_present_item_id) {
596
      if (!(this_present_item_id && that_present_item_id))
597
        return false;
598
      if (this.item_id != that.item_id)
599
        return false;
600
    }
601
 
602
    boolean this_present_dealPrice = true;
603
    boolean that_present_dealPrice = true;
604
    if (this_present_dealPrice || that_present_dealPrice) {
605
      if (!(this_present_dealPrice && that_present_dealPrice))
606
        return false;
607
      if (this.dealPrice != that.dealPrice)
608
        return false;
609
    }
610
 
611
    boolean this_present_dealFreebieItemId = true;
612
    boolean that_present_dealFreebieItemId = true;
613
    if (this_present_dealFreebieItemId || that_present_dealFreebieItemId) {
614
      if (!(this_present_dealFreebieItemId && that_present_dealFreebieItemId))
615
        return false;
616
      if (this.dealFreebieItemId != that.dealFreebieItemId)
617
        return false;
618
    }
619
 
620
    boolean this_present_startDate = true;
621
    boolean that_present_startDate = true;
622
    if (this_present_startDate || that_present_startDate) {
623
      if (!(this_present_startDate && that_present_startDate))
624
        return false;
625
      if (this.startDate != that.startDate)
626
        return false;
627
    }
628
 
629
    boolean this_present_endDate = true;
630
    boolean that_present_endDate = true;
631
    if (this_present_endDate || that_present_endDate) {
632
      if (!(this_present_endDate && that_present_endDate))
633
        return false;
634
      if (this.endDate != that.endDate)
635
        return false;
636
    }
637
 
638
    boolean this_present_isDealTextIdentical = true;
639
    boolean that_present_isDealTextIdentical = true;
640
    if (this_present_isDealTextIdentical || that_present_isDealTextIdentical) {
641
      if (!(this_present_isDealTextIdentical && that_present_isDealTextIdentical))
642
        return false;
643
      if (this.isDealTextIdentical != that.isDealTextIdentical)
644
        return false;
645
    }
646
 
647
    boolean this_present_dealText = true && this.isSetDealText();
648
    boolean that_present_dealText = true && that.isSetDealText();
649
    if (this_present_dealText || that_present_dealText) {
650
      if (!(this_present_dealText && that_present_dealText))
651
        return false;
652
      if (!this.dealText.equals(that.dealText))
653
        return false;
654
    }
655
 
656
    boolean this_present_isCod = true;
657
    boolean that_present_isCod = true;
658
    if (this_present_isCod || that_present_isCod) {
659
      if (!(this_present_isCod && that_present_isCod))
660
        return false;
661
      if (this.isCod != that.isCod)
662
        return false;
663
    }
664
 
665
    boolean this_present_rank = true;
666
    boolean that_present_rank = true;
667
    if (this_present_rank || that_present_rank) {
668
      if (!(this_present_rank && that_present_rank))
669
        return false;
670
      if (this.rank != that.rank)
671
        return false;
672
    }
673
 
674
    return true;
675
  }
676
 
677
  @Override
678
  public int hashCode() {
679
    return 0;
680
  }
681
 
682
  public int compareTo(PrivateDeal other) {
683
    if (!getClass().equals(other.getClass())) {
684
      return getClass().getName().compareTo(other.getClass().getName());
685
    }
686
 
687
    int lastComparison = 0;
688
    PrivateDeal typedOther = (PrivateDeal)other;
689
 
690
    lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(typedOther.isSetItem_id());
691
    if (lastComparison != 0) {
692
      return lastComparison;
693
    }
694
    if (isSetItem_id()) {
695
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.item_id, typedOther.item_id);
696
      if (lastComparison != 0) {
697
        return lastComparison;
698
      }
699
    }
700
    lastComparison = Boolean.valueOf(isSetDealPrice()).compareTo(typedOther.isSetDealPrice());
701
    if (lastComparison != 0) {
702
      return lastComparison;
703
    }
704
    if (isSetDealPrice()) {
705
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dealPrice, typedOther.dealPrice);
706
      if (lastComparison != 0) {
707
        return lastComparison;
708
      }
709
    }
710
    lastComparison = Boolean.valueOf(isSetDealFreebieItemId()).compareTo(typedOther.isSetDealFreebieItemId());
711
    if (lastComparison != 0) {
712
      return lastComparison;
713
    }
714
    if (isSetDealFreebieItemId()) {
715
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dealFreebieItemId, typedOther.dealFreebieItemId);
716
      if (lastComparison != 0) {
717
        return lastComparison;
718
      }
719
    }
720
    lastComparison = Boolean.valueOf(isSetStartDate()).compareTo(typedOther.isSetStartDate());
721
    if (lastComparison != 0) {
722
      return lastComparison;
723
    }
724
    if (isSetStartDate()) {
725
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startDate, typedOther.startDate);
726
      if (lastComparison != 0) {
727
        return lastComparison;
728
      }
729
    }
730
    lastComparison = Boolean.valueOf(isSetEndDate()).compareTo(typedOther.isSetEndDate());
731
    if (lastComparison != 0) {
732
      return lastComparison;
733
    }
734
    if (isSetEndDate()) {
735
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endDate, typedOther.endDate);
736
      if (lastComparison != 0) {
737
        return lastComparison;
738
      }
739
    }
740
    lastComparison = Boolean.valueOf(isSetIsDealTextIdentical()).compareTo(typedOther.isSetIsDealTextIdentical());
741
    if (lastComparison != 0) {
742
      return lastComparison;
743
    }
744
    if (isSetIsDealTextIdentical()) {
745
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isDealTextIdentical, typedOther.isDealTextIdentical);
746
      if (lastComparison != 0) {
747
        return lastComparison;
748
      }
749
    }
750
    lastComparison = Boolean.valueOf(isSetDealText()).compareTo(typedOther.isSetDealText());
751
    if (lastComparison != 0) {
752
      return lastComparison;
753
    }
754
    if (isSetDealText()) {
755
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dealText, typedOther.dealText);
756
      if (lastComparison != 0) {
757
        return lastComparison;
758
      }
759
    }
760
    lastComparison = Boolean.valueOf(isSetIsCod()).compareTo(typedOther.isSetIsCod());
761
    if (lastComparison != 0) {
762
      return lastComparison;
763
    }
764
    if (isSetIsCod()) {
765
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isCod, typedOther.isCod);
766
      if (lastComparison != 0) {
767
        return lastComparison;
768
      }
769
    }
770
    lastComparison = Boolean.valueOf(isSetRank()).compareTo(typedOther.isSetRank());
771
    if (lastComparison != 0) {
772
      return lastComparison;
773
    }
774
    if (isSetRank()) {
775
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rank, typedOther.rank);
776
      if (lastComparison != 0) {
777
        return lastComparison;
778
      }
779
    }
780
    return 0;
781
  }
782
 
783
  public _Fields fieldForId(int fieldId) {
784
    return _Fields.findByThriftId(fieldId);
785
  }
786
 
787
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
788
    org.apache.thrift.protocol.TField field;
789
    iprot.readStructBegin();
790
    while (true)
791
    {
792
      field = iprot.readFieldBegin();
793
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
794
        break;
795
      }
796
      switch (field.id) {
797
        case 1: // ITEM_ID
798
          if (field.type == org.apache.thrift.protocol.TType.I64) {
799
            this.item_id = iprot.readI64();
800
            setItem_idIsSet(true);
801
          } else { 
802
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
803
          }
804
          break;
805
        case 2: // DEAL_PRICE
806
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
807
            this.dealPrice = iprot.readDouble();
808
            setDealPriceIsSet(true);
809
          } else { 
810
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
811
          }
812
          break;
813
        case 3: // DEAL_FREEBIE_ITEM_ID
814
          if (field.type == org.apache.thrift.protocol.TType.I64) {
815
            this.dealFreebieItemId = iprot.readI64();
816
            setDealFreebieItemIdIsSet(true);
817
          } else { 
818
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
819
          }
820
          break;
821
        case 4: // START_DATE
822
          if (field.type == org.apache.thrift.protocol.TType.I64) {
823
            this.startDate = iprot.readI64();
824
            setStartDateIsSet(true);
825
          } else { 
826
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
827
          }
828
          break;
829
        case 5: // END_DATE
830
          if (field.type == org.apache.thrift.protocol.TType.I64) {
831
            this.endDate = iprot.readI64();
832
            setEndDateIsSet(true);
833
          } else { 
834
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
835
          }
836
          break;
837
        case 6: // IS_DEAL_TEXT_IDENTICAL
838
          if (field.type == org.apache.thrift.protocol.TType.BOOL) {
839
            this.isDealTextIdentical = iprot.readBool();
840
            setIsDealTextIdenticalIsSet(true);
841
          } else { 
842
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
843
          }
844
          break;
845
        case 7: // DEAL_TEXT
846
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
847
            this.dealText = iprot.readString();
848
          } else { 
849
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
850
          }
851
          break;
852
        case 8: // IS_COD
853
          if (field.type == org.apache.thrift.protocol.TType.BOOL) {
854
            this.isCod = iprot.readBool();
855
            setIsCodIsSet(true);
856
          } else { 
857
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
858
          }
859
          break;
860
        case 9: // RANK
861
          if (field.type == org.apache.thrift.protocol.TType.I64) {
862
            this.rank = iprot.readI64();
863
            setRankIsSet(true);
864
          } else { 
865
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
866
          }
867
          break;
868
        default:
869
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
870
      }
871
      iprot.readFieldEnd();
872
    }
873
    iprot.readStructEnd();
874
    validate();
875
  }
876
 
877
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
878
    validate();
879
 
880
    oprot.writeStructBegin(STRUCT_DESC);
881
    oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
882
    oprot.writeI64(this.item_id);
883
    oprot.writeFieldEnd();
884
    oprot.writeFieldBegin(DEAL_PRICE_FIELD_DESC);
885
    oprot.writeDouble(this.dealPrice);
886
    oprot.writeFieldEnd();
887
    oprot.writeFieldBegin(DEAL_FREEBIE_ITEM_ID_FIELD_DESC);
888
    oprot.writeI64(this.dealFreebieItemId);
889
    oprot.writeFieldEnd();
890
    oprot.writeFieldBegin(START_DATE_FIELD_DESC);
891
    oprot.writeI64(this.startDate);
892
    oprot.writeFieldEnd();
893
    oprot.writeFieldBegin(END_DATE_FIELD_DESC);
894
    oprot.writeI64(this.endDate);
895
    oprot.writeFieldEnd();
896
    oprot.writeFieldBegin(IS_DEAL_TEXT_IDENTICAL_FIELD_DESC);
897
    oprot.writeBool(this.isDealTextIdentical);
898
    oprot.writeFieldEnd();
899
    if (this.dealText != null) {
900
      oprot.writeFieldBegin(DEAL_TEXT_FIELD_DESC);
901
      oprot.writeString(this.dealText);
902
      oprot.writeFieldEnd();
903
    }
904
    oprot.writeFieldBegin(IS_COD_FIELD_DESC);
905
    oprot.writeBool(this.isCod);
906
    oprot.writeFieldEnd();
907
    oprot.writeFieldBegin(RANK_FIELD_DESC);
908
    oprot.writeI64(this.rank);
909
    oprot.writeFieldEnd();
910
    oprot.writeFieldStop();
911
    oprot.writeStructEnd();
912
  }
913
 
914
  @Override
915
  public String toString() {
916
    StringBuilder sb = new StringBuilder("PrivateDeal(");
917
    boolean first = true;
918
 
919
    sb.append("item_id:");
920
    sb.append(this.item_id);
921
    first = false;
922
    if (!first) sb.append(", ");
923
    sb.append("dealPrice:");
924
    sb.append(this.dealPrice);
925
    first = false;
926
    if (!first) sb.append(", ");
927
    sb.append("dealFreebieItemId:");
928
    sb.append(this.dealFreebieItemId);
929
    first = false;
930
    if (!first) sb.append(", ");
931
    sb.append("startDate:");
932
    sb.append(this.startDate);
933
    first = false;
934
    if (!first) sb.append(", ");
935
    sb.append("endDate:");
936
    sb.append(this.endDate);
937
    first = false;
938
    if (!first) sb.append(", ");
939
    sb.append("isDealTextIdentical:");
940
    sb.append(this.isDealTextIdentical);
941
    first = false;
942
    if (!first) sb.append(", ");
943
    sb.append("dealText:");
944
    if (this.dealText == null) {
945
      sb.append("null");
946
    } else {
947
      sb.append(this.dealText);
948
    }
949
    first = false;
950
    if (!first) sb.append(", ");
951
    sb.append("isCod:");
952
    sb.append(this.isCod);
953
    first = false;
954
    if (!first) sb.append(", ");
955
    sb.append("rank:");
956
    sb.append(this.rank);
957
    first = false;
958
    sb.append(")");
959
    return sb.toString();
960
  }
961
 
962
  public void validate() throws org.apache.thrift.TException {
963
    // check for required fields
964
  }
965
 
966
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
967
    try {
968
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
969
    } catch (org.apache.thrift.TException te) {
970
      throw new java.io.IOException(te);
971
    }
972
  }
973
 
974
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
975
    try {
976
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
977
      __isset_bit_vector = new BitSet(1);
978
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
979
    } catch (org.apache.thrift.TException te) {
980
      throw new java.io.IOException(te);
981
    }
982
  }
983
 
984
}
985