Subversion Repositories SmartDukaan

Rev

Rev 1982 | Details | Compare with Previous | Last modification | View Log | RSS feed

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