Subversion Repositories SmartDukaan

Rev

Rev 3430 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3430 Rev 4793
Line 26... Line 26...
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);
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);
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);
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);
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);
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);
-
 
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);
31
 
32
 
32
  private long id; // required
33
  private long id; // required
33
  private String name; // required
34
  private String name; // required
34
  private String emailId; // required
35
  private String emailId; // required
35
  private long managerId; // required
36
  private long managerId; // required
36
  private String password; // required
37
  private String password; // required
-
 
38
  private boolean is_active; // required
37
 
39
 
38
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
40
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
39
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
41
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
40
    ID((short)1, "id"),
42
    ID((short)1, "id"),
41
    NAME((short)2, "name"),
43
    NAME((short)2, "name"),
42
    EMAIL_ID((short)3, "emailId"),
44
    EMAIL_ID((short)3, "emailId"),
43
    MANAGER_ID((short)4, "managerId"),
45
    MANAGER_ID((short)4, "managerId"),
44
    PASSWORD((short)5, "password");
46
    PASSWORD((short)5, "password"),
-
 
47
    IS_ACTIVE((short)6, "is_active");
45
 
48
 
46
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
49
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
47
 
50
 
48
    static {
51
    static {
49
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
52
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
Line 64... Line 67...
64
          return EMAIL_ID;
67
          return EMAIL_ID;
65
        case 4: // MANAGER_ID
68
        case 4: // MANAGER_ID
66
          return MANAGER_ID;
69
          return MANAGER_ID;
67
        case 5: // PASSWORD
70
        case 5: // PASSWORD
68
          return PASSWORD;
71
          return PASSWORD;
-
 
72
        case 6: // IS_ACTIVE
-
 
73
          return IS_ACTIVE;
69
        default:
74
        default:
70
          return null;
75
          return null;
71
      }
76
      }
72
    }
77
    }
73
 
78
 
Line 106... Line 111...
106
  }
111
  }
107
 
112
 
108
  // isset id assignments
113
  // isset id assignments
109
  private static final int __ID_ISSET_ID = 0;
114
  private static final int __ID_ISSET_ID = 0;
110
  private static final int __MANAGERID_ISSET_ID = 1;
115
  private static final int __MANAGERID_ISSET_ID = 1;
-
 
116
  private static final int __IS_ACTIVE_ISSET_ID = 2;
111
  private BitSet __isset_bit_vector = new BitSet(2);
117
  private BitSet __isset_bit_vector = new BitSet(3);
112
 
118
 
113
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
119
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
114
  static {
120
  static {
115
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
121
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
116
    tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
122
    tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
Line 121... Line 127...
121
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
127
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
122
    tmpMap.put(_Fields.MANAGER_ID, new org.apache.thrift.meta_data.FieldMetaData("managerId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
128
    tmpMap.put(_Fields.MANAGER_ID, new org.apache.thrift.meta_data.FieldMetaData("managerId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
123
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
129
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
124
    tmpMap.put(_Fields.PASSWORD, new org.apache.thrift.meta_data.FieldMetaData("password", org.apache.thrift.TFieldRequirementType.DEFAULT, 
130
    tmpMap.put(_Fields.PASSWORD, new org.apache.thrift.meta_data.FieldMetaData("password", org.apache.thrift.TFieldRequirementType.DEFAULT, 
125
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
131
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-
 
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)));
126
    metaDataMap = Collections.unmodifiableMap(tmpMap);
134
    metaDataMap = Collections.unmodifiableMap(tmpMap);
127
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Agent.class, metaDataMap);
135
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Agent.class, metaDataMap);
128
  }
136
  }
129
 
137
 
130
  public Agent() {
138
  public Agent() {
Line 132... Line 140...
132
 
140
 
133
  public Agent(
141
  public Agent(
134
    long id,
142
    long id,
135
    String name,
143
    String name,
136
    String emailId,
144
    String emailId,
137
    String password)
145
    String password,
-
 
146
    boolean is_active)
138
  {
147
  {
139
    this();
148
    this();
140
    this.id = id;
149
    this.id = id;
141
    setIdIsSet(true);
150
    setIdIsSet(true);
142
    this.name = name;
151
    this.name = name;
143
    this.emailId = emailId;
152
    this.emailId = emailId;
144
    this.password = password;
153
    this.password = password;
-
 
154
    this.is_active = is_active;
-
 
155
    setIs_activeIsSet(true);
145
  }
156
  }
146
 
157
 
147
  /**
158
  /**
148
   * Performs a deep copy on <i>other</i>.
159
   * Performs a deep copy on <i>other</i>.
149
   */
160
   */
Line 159... Line 170...
159
    }
170
    }
160
    this.managerId = other.managerId;
171
    this.managerId = other.managerId;
161
    if (other.isSetPassword()) {
172
    if (other.isSetPassword()) {
162
      this.password = other.password;
173
      this.password = other.password;
163
    }
174
    }
-
 
175
    this.is_active = other.is_active;
164
  }
176
  }
165
 
177
 
166
  public Agent deepCopy() {
178
  public Agent deepCopy() {
167
    return new Agent(this);
179
    return new Agent(this);
168
  }
180
  }
Line 174... Line 186...
174
    this.name = null;
186
    this.name = null;
175
    this.emailId = null;
187
    this.emailId = null;
176
    setManagerIdIsSet(false);
188
    setManagerIdIsSet(false);
177
    this.managerId = 0;
189
    this.managerId = 0;
178
    this.password = null;
190
    this.password = null;
-
 
191
    setIs_activeIsSet(false);
-
 
192
    this.is_active = false;
179
  }
193
  }
180
 
194
 
181
  public long getId() {
195
  public long getId() {
182
    return this.id;
196
    return this.id;
183
  }
197
  }
Line 289... Line 303...
289
    if (!value) {
303
    if (!value) {
290
      this.password = null;
304
      this.password = null;
291
    }
305
    }
292
  }
306
  }
293
 
307
 
-
 
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
 
294
  public void setFieldValue(_Fields field, Object value) {
330
  public void setFieldValue(_Fields field, Object value) {
295
    switch (field) {
331
    switch (field) {
296
    case ID:
332
    case ID:
297
      if (value == null) {
333
      if (value == null) {
298
        unsetId();
334
        unsetId();
Line 331... Line 367...
331
      } else {
367
      } else {
332
        setPassword((String)value);
368
        setPassword((String)value);
333
      }
369
      }
334
      break;
370
      break;
335
 
371
 
-
 
372
    case IS_ACTIVE:
-
 
373
      if (value == null) {
-
 
374
        unsetIs_active();
-
 
375
      } else {
-
 
376
        setIs_active((Boolean)value);
-
 
377
      }
-
 
378
      break;
-
 
379
 
336
    }
380
    }
337
  }
381
  }
338
 
382
 
339
  public Object getFieldValue(_Fields field) {
383
  public Object getFieldValue(_Fields field) {
340
    switch (field) {
384
    switch (field) {
Line 351... Line 395...
351
      return Long.valueOf(getManagerId());
395
      return Long.valueOf(getManagerId());
352
 
396
 
353
    case PASSWORD:
397
    case PASSWORD:
354
      return getPassword();
398
      return getPassword();
355
 
399
 
-
 
400
    case IS_ACTIVE:
-
 
401
      return Boolean.valueOf(isIs_active());
-
 
402
 
356
    }
403
    }
357
    throw new IllegalStateException();
404
    throw new IllegalStateException();
358
  }
405
  }
359
 
406
 
360
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
407
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
Line 372... Line 419...
372
      return isSetEmailId();
419
      return isSetEmailId();
373
    case MANAGER_ID:
420
    case MANAGER_ID:
374
      return isSetManagerId();
421
      return isSetManagerId();
375
    case PASSWORD:
422
    case PASSWORD:
376
      return isSetPassword();
423
      return isSetPassword();
-
 
424
    case IS_ACTIVE:
-
 
425
      return isSetIs_active();
377
    }
426
    }
378
    throw new IllegalStateException();
427
    throw new IllegalStateException();
379
  }
428
  }
380
 
429
 
381
  @Override
430
  @Override
Line 434... Line 483...
434
        return false;
483
        return false;
435
      if (!this.password.equals(that.password))
484
      if (!this.password.equals(that.password))
436
        return false;
485
        return false;
437
    }
486
    }
438
 
487
 
-
 
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
 
439
    return true;
497
    return true;
440
  }
498
  }
441
 
499
 
442
  @Override
500
  @Override
443
  public int hashCode() {
501
  public int hashCode() {
Line 500... Line 558...
500
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.password, typedOther.password);
558
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.password, typedOther.password);
501
      if (lastComparison != 0) {
559
      if (lastComparison != 0) {
502
        return lastComparison;
560
        return lastComparison;
503
      }
561
      }
504
    }
562
    }
-
 
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
    }
505
    return 0;
573
    return 0;
506
  }
574
  }
507
 
575
 
508
  public _Fields fieldForId(int fieldId) {
576
  public _Fields fieldForId(int fieldId) {
509
    return _Fields.findByThriftId(fieldId);
577
    return _Fields.findByThriftId(fieldId);
Line 554... Line 622...
554
            this.password = iprot.readString();
622
            this.password = iprot.readString();
555
          } else { 
623
          } else { 
556
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
624
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
557
          }
625
          }
558
          break;
626
          break;
-
 
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;
559
        default:
635
        default:
560
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
636
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
561
      }
637
      }
562
      iprot.readFieldEnd();
638
      iprot.readFieldEnd();
563
    }
639
    }
Line 590... Line 666...
590
    if (this.password != null) {
666
    if (this.password != null) {
591
      oprot.writeFieldBegin(PASSWORD_FIELD_DESC);
667
      oprot.writeFieldBegin(PASSWORD_FIELD_DESC);
592
      oprot.writeString(this.password);
668
      oprot.writeString(this.password);
593
      oprot.writeFieldEnd();
669
      oprot.writeFieldEnd();
594
    }
670
    }
-
 
671
    oprot.writeFieldBegin(IS_ACTIVE_FIELD_DESC);
-
 
672
    oprot.writeBool(this.is_active);
-
 
673
    oprot.writeFieldEnd();
595
    oprot.writeFieldStop();
674
    oprot.writeFieldStop();
596
    oprot.writeStructEnd();
675
    oprot.writeStructEnd();
597
  }
676
  }
598
 
677
 
599
  @Override
678
  @Override
Line 632... Line 711...
632
      sb.append("null");
711
      sb.append("null");
633
    } else {
712
    } else {
634
      sb.append(this.password);
713
      sb.append(this.password);
635
    }
714
    }
636
    first = false;
715
    first = false;
-
 
716
    if (!first) sb.append(", ");
-
 
717
    sb.append("is_active:");
-
 
718
    sb.append(this.is_active);
-
 
719
    first = false;
637
    sb.append(")");
720
    sb.append(")");
638
    return sb.toString();
721
    return sb.toString();
639
  }
722
  }
640
 
723
 
641
  public void validate() throws org.apache.thrift.TException {
724
  public void validate() throws org.apache.thrift.TException {