Subversion Repositories SmartDukaan

Rev

Rev 18590 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
11890 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.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;
18
import java.nio.ByteBuffer;
19
import java.util.Arrays;
20
import org.slf4j.Logger;
21
import org.slf4j.LoggerFactory;
22
 
23
public class PrivateDealUser implements org.apache.thrift.TBase<PrivateDealUser, PrivateDealUser._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("PrivateDealUser");
25
 
26
  private static final org.apache.thrift.protocol.TField USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("userId", org.apache.thrift.protocol.TType.I64, (short)1);
27
  private static final org.apache.thrift.protocol.TField ADDED_ON_FIELD_DESC = new org.apache.thrift.protocol.TField("addedOn", org.apache.thrift.protocol.TType.I64, (short)2);
28
  private static final org.apache.thrift.protocol.TField IS_ACTIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("isActive", org.apache.thrift.protocol.TType.BOOL, (short)3);
12696 amit.gupta 29
  private static final org.apache.thrift.protocol.TField COUNTER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("counterId", org.apache.thrift.protocol.TType.I64, (short)4);
30
  private static final org.apache.thrift.protocol.TField TIN_FIELD_DESC = new org.apache.thrift.protocol.TField("tin", org.apache.thrift.protocol.TType.STRING, (short)5);
13146 manish.sha 31
  private static final org.apache.thrift.protocol.TField BULK_SHIPMENT_AMOUNT_LIMIT_FIELD_DESC = new org.apache.thrift.protocol.TField("bulkShipmentAmountLimit", org.apache.thrift.protocol.TType.DOUBLE, (short)6);
18590 manish.sha 32
  private static final org.apache.thrift.protocol.TField CREDITOR_ASSIGNED_FIELD_DESC = new org.apache.thrift.protocol.TField("creditorAssigned", org.apache.thrift.protocol.TType.BOOL, (short)7);
18735 manish.sha 33
  private static final org.apache.thrift.protocol.TField TIN_VERIFIED_FIELD_DESC = new org.apache.thrift.protocol.TField("tinVerified", org.apache.thrift.protocol.TType.BOOL, (short)8);
11890 kshitij.so 34
 
35
  private long userId; // required
36
  private long addedOn; // required
37
  private boolean isActive; // required
12696 amit.gupta 38
  private long counterId; // required
39
  private String tin; // required
13146 manish.sha 40
  private double bulkShipmentAmountLimit; // required
18590 manish.sha 41
  private boolean creditorAssigned; // required
18735 manish.sha 42
  private boolean tinVerified; // required
11890 kshitij.so 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
    USER_ID((short)1, "userId"),
47
    ADDED_ON((short)2, "addedOn"),
12696 amit.gupta 48
    IS_ACTIVE((short)3, "isActive"),
49
    COUNTER_ID((short)4, "counterId"),
13146 manish.sha 50
    TIN((short)5, "tin"),
18590 manish.sha 51
    BULK_SHIPMENT_AMOUNT_LIMIT((short)6, "bulkShipmentAmountLimit"),
18735 manish.sha 52
    CREDITOR_ASSIGNED((short)7, "creditorAssigned"),
53
    TIN_VERIFIED((short)8, "tinVerified");
11890 kshitij.so 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: // USER_ID
69
          return USER_ID;
70
        case 2: // ADDED_ON
71
          return ADDED_ON;
72
        case 3: // IS_ACTIVE
73
          return IS_ACTIVE;
12696 amit.gupta 74
        case 4: // COUNTER_ID
75
          return COUNTER_ID;
76
        case 5: // TIN
77
          return TIN;
13146 manish.sha 78
        case 6: // BULK_SHIPMENT_AMOUNT_LIMIT
79
          return BULK_SHIPMENT_AMOUNT_LIMIT;
18590 manish.sha 80
        case 7: // CREDITOR_ASSIGNED
81
          return CREDITOR_ASSIGNED;
18735 manish.sha 82
        case 8: // TIN_VERIFIED
83
          return TIN_VERIFIED;
11890 kshitij.so 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 __USERID_ISSET_ID = 0;
125
  private static final int __ADDEDON_ISSET_ID = 1;
126
  private static final int __ISACTIVE_ISSET_ID = 2;
12696 amit.gupta 127
  private static final int __COUNTERID_ISSET_ID = 3;
13146 manish.sha 128
  private static final int __BULKSHIPMENTAMOUNTLIMIT_ISSET_ID = 4;
18590 manish.sha 129
  private static final int __CREDITORASSIGNED_ISSET_ID = 5;
18735 manish.sha 130
  private static final int __TINVERIFIED_ISSET_ID = 6;
131
  private BitSet __isset_bit_vector = new BitSet(7);
11890 kshitij.so 132
 
133
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
134
  static {
135
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
136
    tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
137
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
138
    tmpMap.put(_Fields.ADDED_ON, new org.apache.thrift.meta_data.FieldMetaData("addedOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
139
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
140
    tmpMap.put(_Fields.IS_ACTIVE, new org.apache.thrift.meta_data.FieldMetaData("isActive", org.apache.thrift.TFieldRequirementType.DEFAULT, 
141
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
12696 amit.gupta 142
    tmpMap.put(_Fields.COUNTER_ID, new org.apache.thrift.meta_data.FieldMetaData("counterId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
143
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
144
    tmpMap.put(_Fields.TIN, new org.apache.thrift.meta_data.FieldMetaData("tin", org.apache.thrift.TFieldRequirementType.DEFAULT, 
145
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
13146 manish.sha 146
    tmpMap.put(_Fields.BULK_SHIPMENT_AMOUNT_LIMIT, new org.apache.thrift.meta_data.FieldMetaData("bulkShipmentAmountLimit", org.apache.thrift.TFieldRequirementType.DEFAULT, 
147
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
18590 manish.sha 148
    tmpMap.put(_Fields.CREDITOR_ASSIGNED, new org.apache.thrift.meta_data.FieldMetaData("creditorAssigned", org.apache.thrift.TFieldRequirementType.DEFAULT, 
149
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
18735 manish.sha 150
    tmpMap.put(_Fields.TIN_VERIFIED, new org.apache.thrift.meta_data.FieldMetaData("tinVerified", org.apache.thrift.TFieldRequirementType.DEFAULT, 
151
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
11890 kshitij.so 152
    metaDataMap = Collections.unmodifiableMap(tmpMap);
153
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PrivateDealUser.class, metaDataMap);
154
  }
155
 
156
  public PrivateDealUser() {
157
  }
158
 
159
  public PrivateDealUser(
160
    long userId,
161
    long addedOn,
12696 amit.gupta 162
    boolean isActive,
163
    long counterId,
13146 manish.sha 164
    String tin,
18590 manish.sha 165
    double bulkShipmentAmountLimit,
18735 manish.sha 166
    boolean creditorAssigned,
167
    boolean tinVerified)
11890 kshitij.so 168
  {
169
    this();
170
    this.userId = userId;
171
    setUserIdIsSet(true);
172
    this.addedOn = addedOn;
173
    setAddedOnIsSet(true);
174
    this.isActive = isActive;
175
    setIsActiveIsSet(true);
12696 amit.gupta 176
    this.counterId = counterId;
177
    setCounterIdIsSet(true);
178
    this.tin = tin;
13146 manish.sha 179
    this.bulkShipmentAmountLimit = bulkShipmentAmountLimit;
180
    setBulkShipmentAmountLimitIsSet(true);
18590 manish.sha 181
    this.creditorAssigned = creditorAssigned;
182
    setCreditorAssignedIsSet(true);
18735 manish.sha 183
    this.tinVerified = tinVerified;
184
    setTinVerifiedIsSet(true);
11890 kshitij.so 185
  }
186
 
187
  /**
188
   * Performs a deep copy on <i>other</i>.
189
   */
190
  public PrivateDealUser(PrivateDealUser other) {
191
    __isset_bit_vector.clear();
192
    __isset_bit_vector.or(other.__isset_bit_vector);
193
    this.userId = other.userId;
194
    this.addedOn = other.addedOn;
195
    this.isActive = other.isActive;
12696 amit.gupta 196
    this.counterId = other.counterId;
197
    if (other.isSetTin()) {
198
      this.tin = other.tin;
199
    }
13146 manish.sha 200
    this.bulkShipmentAmountLimit = other.bulkShipmentAmountLimit;
18590 manish.sha 201
    this.creditorAssigned = other.creditorAssigned;
18735 manish.sha 202
    this.tinVerified = other.tinVerified;
11890 kshitij.so 203
  }
204
 
205
  public PrivateDealUser deepCopy() {
206
    return new PrivateDealUser(this);
207
  }
208
 
209
  @Override
210
  public void clear() {
211
    setUserIdIsSet(false);
212
    this.userId = 0;
213
    setAddedOnIsSet(false);
214
    this.addedOn = 0;
215
    setIsActiveIsSet(false);
216
    this.isActive = false;
12696 amit.gupta 217
    setCounterIdIsSet(false);
218
    this.counterId = 0;
219
    this.tin = null;
13146 manish.sha 220
    setBulkShipmentAmountLimitIsSet(false);
221
    this.bulkShipmentAmountLimit = 0.0;
18590 manish.sha 222
    setCreditorAssignedIsSet(false);
223
    this.creditorAssigned = false;
18735 manish.sha 224
    setTinVerifiedIsSet(false);
225
    this.tinVerified = false;
11890 kshitij.so 226
  }
227
 
228
  public long getUserId() {
229
    return this.userId;
230
  }
231
 
232
  public void setUserId(long userId) {
233
    this.userId = userId;
234
    setUserIdIsSet(true);
235
  }
236
 
237
  public void unsetUserId() {
238
    __isset_bit_vector.clear(__USERID_ISSET_ID);
239
  }
240
 
241
  /** Returns true if field userId is set (has been assigned a value) and false otherwise */
242
  public boolean isSetUserId() {
243
    return __isset_bit_vector.get(__USERID_ISSET_ID);
244
  }
245
 
246
  public void setUserIdIsSet(boolean value) {
247
    __isset_bit_vector.set(__USERID_ISSET_ID, value);
248
  }
249
 
250
  public long getAddedOn() {
251
    return this.addedOn;
252
  }
253
 
254
  public void setAddedOn(long addedOn) {
255
    this.addedOn = addedOn;
256
    setAddedOnIsSet(true);
257
  }
258
 
259
  public void unsetAddedOn() {
260
    __isset_bit_vector.clear(__ADDEDON_ISSET_ID);
261
  }
262
 
263
  /** Returns true if field addedOn is set (has been assigned a value) and false otherwise */
264
  public boolean isSetAddedOn() {
265
    return __isset_bit_vector.get(__ADDEDON_ISSET_ID);
266
  }
267
 
268
  public void setAddedOnIsSet(boolean value) {
269
    __isset_bit_vector.set(__ADDEDON_ISSET_ID, value);
270
  }
271
 
272
  public boolean isIsActive() {
273
    return this.isActive;
274
  }
275
 
276
  public void setIsActive(boolean isActive) {
277
    this.isActive = isActive;
278
    setIsActiveIsSet(true);
279
  }
280
 
281
  public void unsetIsActive() {
282
    __isset_bit_vector.clear(__ISACTIVE_ISSET_ID);
283
  }
284
 
285
  /** Returns true if field isActive is set (has been assigned a value) and false otherwise */
286
  public boolean isSetIsActive() {
287
    return __isset_bit_vector.get(__ISACTIVE_ISSET_ID);
288
  }
289
 
290
  public void setIsActiveIsSet(boolean value) {
291
    __isset_bit_vector.set(__ISACTIVE_ISSET_ID, value);
292
  }
293
 
12696 amit.gupta 294
  public long getCounterId() {
295
    return this.counterId;
296
  }
297
 
298
  public void setCounterId(long counterId) {
299
    this.counterId = counterId;
300
    setCounterIdIsSet(true);
301
  }
302
 
303
  public void unsetCounterId() {
304
    __isset_bit_vector.clear(__COUNTERID_ISSET_ID);
305
  }
306
 
307
  /** Returns true if field counterId is set (has been assigned a value) and false otherwise */
308
  public boolean isSetCounterId() {
309
    return __isset_bit_vector.get(__COUNTERID_ISSET_ID);
310
  }
311
 
312
  public void setCounterIdIsSet(boolean value) {
313
    __isset_bit_vector.set(__COUNTERID_ISSET_ID, value);
314
  }
315
 
316
  public String getTin() {
317
    return this.tin;
318
  }
319
 
320
  public void setTin(String tin) {
321
    this.tin = tin;
322
  }
323
 
324
  public void unsetTin() {
325
    this.tin = null;
326
  }
327
 
328
  /** Returns true if field tin is set (has been assigned a value) and false otherwise */
329
  public boolean isSetTin() {
330
    return this.tin != null;
331
  }
332
 
333
  public void setTinIsSet(boolean value) {
334
    if (!value) {
335
      this.tin = null;
336
    }
337
  }
338
 
13146 manish.sha 339
  public double getBulkShipmentAmountLimit() {
340
    return this.bulkShipmentAmountLimit;
341
  }
342
 
343
  public void setBulkShipmentAmountLimit(double bulkShipmentAmountLimit) {
344
    this.bulkShipmentAmountLimit = bulkShipmentAmountLimit;
345
    setBulkShipmentAmountLimitIsSet(true);
346
  }
347
 
348
  public void unsetBulkShipmentAmountLimit() {
349
    __isset_bit_vector.clear(__BULKSHIPMENTAMOUNTLIMIT_ISSET_ID);
350
  }
351
 
352
  /** Returns true if field bulkShipmentAmountLimit is set (has been assigned a value) and false otherwise */
353
  public boolean isSetBulkShipmentAmountLimit() {
354
    return __isset_bit_vector.get(__BULKSHIPMENTAMOUNTLIMIT_ISSET_ID);
355
  }
356
 
357
  public void setBulkShipmentAmountLimitIsSet(boolean value) {
358
    __isset_bit_vector.set(__BULKSHIPMENTAMOUNTLIMIT_ISSET_ID, value);
359
  }
360
 
18590 manish.sha 361
  public boolean isCreditorAssigned() {
362
    return this.creditorAssigned;
363
  }
364
 
365
  public void setCreditorAssigned(boolean creditorAssigned) {
366
    this.creditorAssigned = creditorAssigned;
367
    setCreditorAssignedIsSet(true);
368
  }
369
 
370
  public void unsetCreditorAssigned() {
371
    __isset_bit_vector.clear(__CREDITORASSIGNED_ISSET_ID);
372
  }
373
 
374
  /** Returns true if field creditorAssigned is set (has been assigned a value) and false otherwise */
375
  public boolean isSetCreditorAssigned() {
376
    return __isset_bit_vector.get(__CREDITORASSIGNED_ISSET_ID);
377
  }
378
 
379
  public void setCreditorAssignedIsSet(boolean value) {
380
    __isset_bit_vector.set(__CREDITORASSIGNED_ISSET_ID, value);
381
  }
382
 
18735 manish.sha 383
  public boolean isTinVerified() {
384
    return this.tinVerified;
385
  }
386
 
387
  public void setTinVerified(boolean tinVerified) {
388
    this.tinVerified = tinVerified;
389
    setTinVerifiedIsSet(true);
390
  }
391
 
392
  public void unsetTinVerified() {
393
    __isset_bit_vector.clear(__TINVERIFIED_ISSET_ID);
394
  }
395
 
396
  /** Returns true if field tinVerified is set (has been assigned a value) and false otherwise */
397
  public boolean isSetTinVerified() {
398
    return __isset_bit_vector.get(__TINVERIFIED_ISSET_ID);
399
  }
400
 
401
  public void setTinVerifiedIsSet(boolean value) {
402
    __isset_bit_vector.set(__TINVERIFIED_ISSET_ID, value);
403
  }
404
 
11890 kshitij.so 405
  public void setFieldValue(_Fields field, Object value) {
406
    switch (field) {
407
    case USER_ID:
408
      if (value == null) {
409
        unsetUserId();
410
      } else {
411
        setUserId((Long)value);
412
      }
413
      break;
414
 
415
    case ADDED_ON:
416
      if (value == null) {
417
        unsetAddedOn();
418
      } else {
419
        setAddedOn((Long)value);
420
      }
421
      break;
422
 
423
    case IS_ACTIVE:
424
      if (value == null) {
425
        unsetIsActive();
426
      } else {
427
        setIsActive((Boolean)value);
428
      }
429
      break;
430
 
12696 amit.gupta 431
    case COUNTER_ID:
432
      if (value == null) {
433
        unsetCounterId();
434
      } else {
435
        setCounterId((Long)value);
436
      }
437
      break;
438
 
439
    case TIN:
440
      if (value == null) {
441
        unsetTin();
442
      } else {
443
        setTin((String)value);
444
      }
445
      break;
446
 
13146 manish.sha 447
    case BULK_SHIPMENT_AMOUNT_LIMIT:
448
      if (value == null) {
449
        unsetBulkShipmentAmountLimit();
450
      } else {
451
        setBulkShipmentAmountLimit((Double)value);
452
      }
453
      break;
454
 
18590 manish.sha 455
    case CREDITOR_ASSIGNED:
456
      if (value == null) {
457
        unsetCreditorAssigned();
458
      } else {
459
        setCreditorAssigned((Boolean)value);
460
      }
461
      break;
462
 
18735 manish.sha 463
    case TIN_VERIFIED:
464
      if (value == null) {
465
        unsetTinVerified();
466
      } else {
467
        setTinVerified((Boolean)value);
468
      }
469
      break;
470
 
11890 kshitij.so 471
    }
472
  }
473
 
474
  public Object getFieldValue(_Fields field) {
475
    switch (field) {
476
    case USER_ID:
477
      return Long.valueOf(getUserId());
478
 
479
    case ADDED_ON:
480
      return Long.valueOf(getAddedOn());
481
 
482
    case IS_ACTIVE:
483
      return Boolean.valueOf(isIsActive());
484
 
12696 amit.gupta 485
    case COUNTER_ID:
486
      return Long.valueOf(getCounterId());
487
 
488
    case TIN:
489
      return getTin();
490
 
13146 manish.sha 491
    case BULK_SHIPMENT_AMOUNT_LIMIT:
492
      return Double.valueOf(getBulkShipmentAmountLimit());
493
 
18590 manish.sha 494
    case CREDITOR_ASSIGNED:
495
      return Boolean.valueOf(isCreditorAssigned());
496
 
18735 manish.sha 497
    case TIN_VERIFIED:
498
      return Boolean.valueOf(isTinVerified());
499
 
11890 kshitij.so 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 USER_ID:
512
      return isSetUserId();
513
    case ADDED_ON:
514
      return isSetAddedOn();
515
    case IS_ACTIVE:
516
      return isSetIsActive();
12696 amit.gupta 517
    case COUNTER_ID:
518
      return isSetCounterId();
519
    case TIN:
520
      return isSetTin();
13146 manish.sha 521
    case BULK_SHIPMENT_AMOUNT_LIMIT:
522
      return isSetBulkShipmentAmountLimit();
18590 manish.sha 523
    case CREDITOR_ASSIGNED:
524
      return isSetCreditorAssigned();
18735 manish.sha 525
    case TIN_VERIFIED:
526
      return isSetTinVerified();
11890 kshitij.so 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 PrivateDealUser)
536
      return this.equals((PrivateDealUser)that);
537
    return false;
538
  }
539
 
540
  public boolean equals(PrivateDealUser that) {
541
    if (that == null)
542
      return false;
543
 
544
    boolean this_present_userId = true;
545
    boolean that_present_userId = true;
546
    if (this_present_userId || that_present_userId) {
547
      if (!(this_present_userId && that_present_userId))
548
        return false;
549
      if (this.userId != that.userId)
550
        return false;
551
    }
552
 
553
    boolean this_present_addedOn = true;
554
    boolean that_present_addedOn = true;
555
    if (this_present_addedOn || that_present_addedOn) {
556
      if (!(this_present_addedOn && that_present_addedOn))
557
        return false;
558
      if (this.addedOn != that.addedOn)
559
        return false;
560
    }
561
 
562
    boolean this_present_isActive = true;
563
    boolean that_present_isActive = true;
564
    if (this_present_isActive || that_present_isActive) {
565
      if (!(this_present_isActive && that_present_isActive))
566
        return false;
567
      if (this.isActive != that.isActive)
568
        return false;
569
    }
570
 
12696 amit.gupta 571
    boolean this_present_counterId = true;
572
    boolean that_present_counterId = true;
573
    if (this_present_counterId || that_present_counterId) {
574
      if (!(this_present_counterId && that_present_counterId))
575
        return false;
576
      if (this.counterId != that.counterId)
577
        return false;
578
    }
579
 
580
    boolean this_present_tin = true && this.isSetTin();
581
    boolean that_present_tin = true && that.isSetTin();
582
    if (this_present_tin || that_present_tin) {
583
      if (!(this_present_tin && that_present_tin))
584
        return false;
585
      if (!this.tin.equals(that.tin))
586
        return false;
587
    }
588
 
13146 manish.sha 589
    boolean this_present_bulkShipmentAmountLimit = true;
590
    boolean that_present_bulkShipmentAmountLimit = true;
591
    if (this_present_bulkShipmentAmountLimit || that_present_bulkShipmentAmountLimit) {
592
      if (!(this_present_bulkShipmentAmountLimit && that_present_bulkShipmentAmountLimit))
593
        return false;
594
      if (this.bulkShipmentAmountLimit != that.bulkShipmentAmountLimit)
595
        return false;
596
    }
597
 
18590 manish.sha 598
    boolean this_present_creditorAssigned = true;
599
    boolean that_present_creditorAssigned = true;
600
    if (this_present_creditorAssigned || that_present_creditorAssigned) {
601
      if (!(this_present_creditorAssigned && that_present_creditorAssigned))
602
        return false;
603
      if (this.creditorAssigned != that.creditorAssigned)
604
        return false;
605
    }
606
 
18735 manish.sha 607
    boolean this_present_tinVerified = true;
608
    boolean that_present_tinVerified = true;
609
    if (this_present_tinVerified || that_present_tinVerified) {
610
      if (!(this_present_tinVerified && that_present_tinVerified))
611
        return false;
612
      if (this.tinVerified != that.tinVerified)
613
        return false;
614
    }
615
 
11890 kshitij.so 616
    return true;
617
  }
618
 
619
  @Override
620
  public int hashCode() {
621
    return 0;
622
  }
623
 
624
  public int compareTo(PrivateDealUser other) {
625
    if (!getClass().equals(other.getClass())) {
626
      return getClass().getName().compareTo(other.getClass().getName());
627
    }
628
 
629
    int lastComparison = 0;
630
    PrivateDealUser typedOther = (PrivateDealUser)other;
631
 
632
    lastComparison = Boolean.valueOf(isSetUserId()).compareTo(typedOther.isSetUserId());
633
    if (lastComparison != 0) {
634
      return lastComparison;
635
    }
636
    if (isSetUserId()) {
637
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, typedOther.userId);
638
      if (lastComparison != 0) {
639
        return lastComparison;
640
      }
641
    }
642
    lastComparison = Boolean.valueOf(isSetAddedOn()).compareTo(typedOther.isSetAddedOn());
643
    if (lastComparison != 0) {
644
      return lastComparison;
645
    }
646
    if (isSetAddedOn()) {
647
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.addedOn, typedOther.addedOn);
648
      if (lastComparison != 0) {
649
        return lastComparison;
650
      }
651
    }
652
    lastComparison = Boolean.valueOf(isSetIsActive()).compareTo(typedOther.isSetIsActive());
653
    if (lastComparison != 0) {
654
      return lastComparison;
655
    }
656
    if (isSetIsActive()) {
657
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isActive, typedOther.isActive);
658
      if (lastComparison != 0) {
659
        return lastComparison;
660
      }
661
    }
12696 amit.gupta 662
    lastComparison = Boolean.valueOf(isSetCounterId()).compareTo(typedOther.isSetCounterId());
663
    if (lastComparison != 0) {
664
      return lastComparison;
665
    }
666
    if (isSetCounterId()) {
667
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.counterId, typedOther.counterId);
668
      if (lastComparison != 0) {
669
        return lastComparison;
670
      }
671
    }
672
    lastComparison = Boolean.valueOf(isSetTin()).compareTo(typedOther.isSetTin());
673
    if (lastComparison != 0) {
674
      return lastComparison;
675
    }
676
    if (isSetTin()) {
677
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tin, typedOther.tin);
678
      if (lastComparison != 0) {
679
        return lastComparison;
680
      }
681
    }
13146 manish.sha 682
    lastComparison = Boolean.valueOf(isSetBulkShipmentAmountLimit()).compareTo(typedOther.isSetBulkShipmentAmountLimit());
683
    if (lastComparison != 0) {
684
      return lastComparison;
685
    }
686
    if (isSetBulkShipmentAmountLimit()) {
687
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bulkShipmentAmountLimit, typedOther.bulkShipmentAmountLimit);
688
      if (lastComparison != 0) {
689
        return lastComparison;
690
      }
691
    }
18590 manish.sha 692
    lastComparison = Boolean.valueOf(isSetCreditorAssigned()).compareTo(typedOther.isSetCreditorAssigned());
693
    if (lastComparison != 0) {
694
      return lastComparison;
695
    }
696
    if (isSetCreditorAssigned()) {
697
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.creditorAssigned, typedOther.creditorAssigned);
698
      if (lastComparison != 0) {
699
        return lastComparison;
700
      }
701
    }
18735 manish.sha 702
    lastComparison = Boolean.valueOf(isSetTinVerified()).compareTo(typedOther.isSetTinVerified());
703
    if (lastComparison != 0) {
704
      return lastComparison;
705
    }
706
    if (isSetTinVerified()) {
707
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tinVerified, typedOther.tinVerified);
708
      if (lastComparison != 0) {
709
        return lastComparison;
710
      }
711
    }
11890 kshitij.so 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: // USER_ID
730
          if (field.type == org.apache.thrift.protocol.TType.I64) {
731
            this.userId = iprot.readI64();
732
            setUserIdIsSet(true);
733
          } else { 
734
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
735
          }
736
          break;
737
        case 2: // ADDED_ON
738
          if (field.type == org.apache.thrift.protocol.TType.I64) {
739
            this.addedOn = iprot.readI64();
740
            setAddedOnIsSet(true);
741
          } else { 
742
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
743
          }
744
          break;
745
        case 3: // IS_ACTIVE
746
          if (field.type == org.apache.thrift.protocol.TType.BOOL) {
747
            this.isActive = iprot.readBool();
748
            setIsActiveIsSet(true);
749
          } else { 
750
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
751
          }
752
          break;
12696 amit.gupta 753
        case 4: // COUNTER_ID
754
          if (field.type == org.apache.thrift.protocol.TType.I64) {
755
            this.counterId = iprot.readI64();
756
            setCounterIdIsSet(true);
757
          } else { 
758
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
759
          }
760
          break;
761
        case 5: // TIN
762
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
763
            this.tin = iprot.readString();
764
          } else { 
765
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
766
          }
767
          break;
13146 manish.sha 768
        case 6: // BULK_SHIPMENT_AMOUNT_LIMIT
769
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
770
            this.bulkShipmentAmountLimit = iprot.readDouble();
771
            setBulkShipmentAmountLimitIsSet(true);
772
          } else { 
773
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
774
          }
775
          break;
18590 manish.sha 776
        case 7: // CREDITOR_ASSIGNED
777
          if (field.type == org.apache.thrift.protocol.TType.BOOL) {
778
            this.creditorAssigned = iprot.readBool();
779
            setCreditorAssignedIsSet(true);
780
          } else { 
781
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
782
          }
783
          break;
18735 manish.sha 784
        case 8: // TIN_VERIFIED
785
          if (field.type == org.apache.thrift.protocol.TType.BOOL) {
786
            this.tinVerified = iprot.readBool();
787
            setTinVerifiedIsSet(true);
788
          } else { 
789
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
790
          }
791
          break;
11890 kshitij.so 792
        default:
793
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
794
      }
795
      iprot.readFieldEnd();
796
    }
797
    iprot.readStructEnd();
798
    validate();
799
  }
800
 
801
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
802
    validate();
803
 
804
    oprot.writeStructBegin(STRUCT_DESC);
805
    oprot.writeFieldBegin(USER_ID_FIELD_DESC);
806
    oprot.writeI64(this.userId);
807
    oprot.writeFieldEnd();
808
    oprot.writeFieldBegin(ADDED_ON_FIELD_DESC);
809
    oprot.writeI64(this.addedOn);
810
    oprot.writeFieldEnd();
811
    oprot.writeFieldBegin(IS_ACTIVE_FIELD_DESC);
812
    oprot.writeBool(this.isActive);
813
    oprot.writeFieldEnd();
12696 amit.gupta 814
    oprot.writeFieldBegin(COUNTER_ID_FIELD_DESC);
815
    oprot.writeI64(this.counterId);
816
    oprot.writeFieldEnd();
817
    if (this.tin != null) {
818
      oprot.writeFieldBegin(TIN_FIELD_DESC);
819
      oprot.writeString(this.tin);
820
      oprot.writeFieldEnd();
821
    }
13146 manish.sha 822
    oprot.writeFieldBegin(BULK_SHIPMENT_AMOUNT_LIMIT_FIELD_DESC);
823
    oprot.writeDouble(this.bulkShipmentAmountLimit);
824
    oprot.writeFieldEnd();
18590 manish.sha 825
    oprot.writeFieldBegin(CREDITOR_ASSIGNED_FIELD_DESC);
826
    oprot.writeBool(this.creditorAssigned);
827
    oprot.writeFieldEnd();
18735 manish.sha 828
    oprot.writeFieldBegin(TIN_VERIFIED_FIELD_DESC);
829
    oprot.writeBool(this.tinVerified);
830
    oprot.writeFieldEnd();
11890 kshitij.so 831
    oprot.writeFieldStop();
832
    oprot.writeStructEnd();
833
  }
834
 
835
  @Override
836
  public String toString() {
837
    StringBuilder sb = new StringBuilder("PrivateDealUser(");
838
    boolean first = true;
839
 
840
    sb.append("userId:");
841
    sb.append(this.userId);
842
    first = false;
843
    if (!first) sb.append(", ");
844
    sb.append("addedOn:");
845
    sb.append(this.addedOn);
846
    first = false;
847
    if (!first) sb.append(", ");
848
    sb.append("isActive:");
849
    sb.append(this.isActive);
850
    first = false;
12696 amit.gupta 851
    if (!first) sb.append(", ");
852
    sb.append("counterId:");
853
    sb.append(this.counterId);
854
    first = false;
855
    if (!first) sb.append(", ");
856
    sb.append("tin:");
857
    if (this.tin == null) {
858
      sb.append("null");
859
    } else {
860
      sb.append(this.tin);
861
    }
862
    first = false;
13146 manish.sha 863
    if (!first) sb.append(", ");
864
    sb.append("bulkShipmentAmountLimit:");
865
    sb.append(this.bulkShipmentAmountLimit);
866
    first = false;
18590 manish.sha 867
    if (!first) sb.append(", ");
868
    sb.append("creditorAssigned:");
869
    sb.append(this.creditorAssigned);
870
    first = false;
18735 manish.sha 871
    if (!first) sb.append(", ");
872
    sb.append("tinVerified:");
873
    sb.append(this.tinVerified);
874
    first = false;
11890 kshitij.so 875
    sb.append(")");
876
    return sb.toString();
877
  }
878
 
879
  public void validate() throws org.apache.thrift.TException {
880
    // check for required fields
881
  }
882
 
883
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
884
    try {
885
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
886
    } catch (org.apache.thrift.TException te) {
887
      throw new java.io.IOException(te);
888
    }
889
  }
890
 
891
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
892
    try {
893
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
894
      __isset_bit_vector = new BitSet(1);
895
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
896
    } catch (org.apache.thrift.TException te) {
897
      throw new java.io.IOException(te);
898
    }
899
  }
900
 
901
}
902