Subversion Repositories SmartDukaan

Rev

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

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