Subversion Repositories SmartDukaan

Rev

Rev 3430 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3430 Rev 8303
Line 25... Line 25...
25
 
25
 
26
  private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)1);
26
  private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)1);
27
  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)2);
27
  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)2);
28
  private static final org.apache.thrift.protocol.TField WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("warehouseId", org.apache.thrift.protocol.TType.I64, (short)3);
28
  private static final org.apache.thrift.protocol.TField WAREHOUSE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("warehouseId", org.apache.thrift.protocol.TType.I64, (short)3);
29
  private static final org.apache.thrift.protocol.TField ROLE_FIELD_DESC = new org.apache.thrift.protocol.TField("role", org.apache.thrift.protocol.TType.I32, (short)4);
29
  private static final org.apache.thrift.protocol.TField ROLE_FIELD_DESC = new org.apache.thrift.protocol.TField("role", org.apache.thrift.protocol.TType.I32, (short)4);
-
 
30
  private static final org.apache.thrift.protocol.TField SOURCE_FIELD_DESC = new org.apache.thrift.protocol.TField("source", org.apache.thrift.protocol.TType.I64, (short)5);
30
 
31
 
31
  private String username; // required
32
  private String username; // required
32
  private String password; // required
33
  private String password; // required
33
  private long warehouseId; // required
34
  private long warehouseId; // required
34
  private Role role; // required
35
  private Role role; // required
-
 
36
  private long source; // required
35
 
37
 
36
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
38
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
37
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
39
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
38
    USERNAME((short)1, "username"),
40
    USERNAME((short)1, "username"),
39
    PASSWORD((short)2, "password"),
41
    PASSWORD((short)2, "password"),
40
    WAREHOUSE_ID((short)3, "warehouseId"),
42
    WAREHOUSE_ID((short)3, "warehouseId"),
41
    /**
43
    /**
42
     * 
44
     * 
43
     * @see Role
45
     * @see Role
44
     */
46
     */
45
    ROLE((short)4, "role");
47
    ROLE((short)4, "role"),
-
 
48
    SOURCE((short)5, "source");
46
 
49
 
47
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
50
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
48
 
51
 
49
    static {
52
    static {
50
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
53
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
Line 63... Line 66...
63
          return PASSWORD;
66
          return PASSWORD;
64
        case 3: // WAREHOUSE_ID
67
        case 3: // WAREHOUSE_ID
65
          return WAREHOUSE_ID;
68
          return WAREHOUSE_ID;
66
        case 4: // ROLE
69
        case 4: // ROLE
67
          return ROLE;
70
          return ROLE;
-
 
71
        case 5: // SOURCE
-
 
72
          return SOURCE;
68
        default:
73
        default:
69
          return null;
74
          return null;
70
      }
75
      }
71
    }
76
    }
72
 
77
 
Line 104... Line 109...
104
    }
109
    }
105
  }
110
  }
106
 
111
 
107
  // isset id assignments
112
  // isset id assignments
108
  private static final int __WAREHOUSEID_ISSET_ID = 0;
113
  private static final int __WAREHOUSEID_ISSET_ID = 0;
-
 
114
  private static final int __SOURCE_ISSET_ID = 1;
109
  private BitSet __isset_bit_vector = new BitSet(1);
115
  private BitSet __isset_bit_vector = new BitSet(2);
110
 
116
 
111
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
117
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
112
  static {
118
  static {
113
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
119
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
114
    tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.DEFAULT, 
120
    tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.DEFAULT, 
Line 117... Line 123...
117
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
123
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
118
    tmpMap.put(_Fields.WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("warehouseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
124
    tmpMap.put(_Fields.WAREHOUSE_ID, new org.apache.thrift.meta_data.FieldMetaData("warehouseId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
119
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
125
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
120
    tmpMap.put(_Fields.ROLE, new org.apache.thrift.meta_data.FieldMetaData("role", org.apache.thrift.TFieldRequirementType.DEFAULT, 
126
    tmpMap.put(_Fields.ROLE, new org.apache.thrift.meta_data.FieldMetaData("role", org.apache.thrift.TFieldRequirementType.DEFAULT, 
121
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, Role.class)));
127
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, Role.class)));
-
 
128
    tmpMap.put(_Fields.SOURCE, new org.apache.thrift.meta_data.FieldMetaData("source", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
129
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
122
    metaDataMap = Collections.unmodifiableMap(tmpMap);
130
    metaDataMap = Collections.unmodifiableMap(tmpMap);
123
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DashboardUser.class, metaDataMap);
131
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DashboardUser.class, metaDataMap);
124
  }
132
  }
125
 
133
 
126
  public DashboardUser() {
134
  public DashboardUser() {
Line 128... Line 136...
128
 
136
 
129
  public DashboardUser(
137
  public DashboardUser(
130
    String username,
138
    String username,
131
    String password,
139
    String password,
132
    long warehouseId,
140
    long warehouseId,
133
    Role role)
141
    Role role,
-
 
142
    long source)
134
  {
143
  {
135
    this();
144
    this();
136
    this.username = username;
145
    this.username = username;
137
    this.password = password;
146
    this.password = password;
138
    this.warehouseId = warehouseId;
147
    this.warehouseId = warehouseId;
139
    setWarehouseIdIsSet(true);
148
    setWarehouseIdIsSet(true);
140
    this.role = role;
149
    this.role = role;
-
 
150
    this.source = source;
-
 
151
    setSourceIsSet(true);
141
  }
152
  }
142
 
153
 
143
  /**
154
  /**
144
   * Performs a deep copy on <i>other</i>.
155
   * Performs a deep copy on <i>other</i>.
145
   */
156
   */
Line 154... Line 165...
154
    }
165
    }
155
    this.warehouseId = other.warehouseId;
166
    this.warehouseId = other.warehouseId;
156
    if (other.isSetRole()) {
167
    if (other.isSetRole()) {
157
      this.role = other.role;
168
      this.role = other.role;
158
    }
169
    }
-
 
170
    this.source = other.source;
159
  }
171
  }
160
 
172
 
161
  public DashboardUser deepCopy() {
173
  public DashboardUser deepCopy() {
162
    return new DashboardUser(this);
174
    return new DashboardUser(this);
163
  }
175
  }
Line 167... Line 179...
167
    this.username = null;
179
    this.username = null;
168
    this.password = null;
180
    this.password = null;
169
    setWarehouseIdIsSet(false);
181
    setWarehouseIdIsSet(false);
170
    this.warehouseId = 0;
182
    this.warehouseId = 0;
171
    this.role = null;
183
    this.role = null;
-
 
184
    setSourceIsSet(false);
-
 
185
    this.source = 0;
172
  }
186
  }
173
 
187
 
174
  public String getUsername() {
188
  public String getUsername() {
175
    return this.username;
189
    return this.username;
176
  }
190
  }
Line 268... Line 282...
268
    if (!value) {
282
    if (!value) {
269
      this.role = null;
283
      this.role = null;
270
    }
284
    }
271
  }
285
  }
272
 
286
 
-
 
287
  public long getSource() {
-
 
288
    return this.source;
-
 
289
  }
-
 
290
 
-
 
291
  public void setSource(long source) {
-
 
292
    this.source = source;
-
 
293
    setSourceIsSet(true);
-
 
294
  }
-
 
295
 
-
 
296
  public void unsetSource() {
-
 
297
    __isset_bit_vector.clear(__SOURCE_ISSET_ID);
-
 
298
  }
-
 
299
 
-
 
300
  /** Returns true if field source is set (has been assigned a value) and false otherwise */
-
 
301
  public boolean isSetSource() {
-
 
302
    return __isset_bit_vector.get(__SOURCE_ISSET_ID);
-
 
303
  }
-
 
304
 
-
 
305
  public void setSourceIsSet(boolean value) {
-
 
306
    __isset_bit_vector.set(__SOURCE_ISSET_ID, value);
-
 
307
  }
-
 
308
 
273
  public void setFieldValue(_Fields field, Object value) {
309
  public void setFieldValue(_Fields field, Object value) {
274
    switch (field) {
310
    switch (field) {
275
    case USERNAME:
311
    case USERNAME:
276
      if (value == null) {
312
      if (value == null) {
277
        unsetUsername();
313
        unsetUsername();
Line 302... Line 338...
302
      } else {
338
      } else {
303
        setRole((Role)value);
339
        setRole((Role)value);
304
      }
340
      }
305
      break;
341
      break;
306
 
342
 
-
 
343
    case SOURCE:
-
 
344
      if (value == null) {
-
 
345
        unsetSource();
-
 
346
      } else {
-
 
347
        setSource((Long)value);
-
 
348
      }
-
 
349
      break;
-
 
350
 
307
    }
351
    }
308
  }
352
  }
309
 
353
 
310
  public Object getFieldValue(_Fields field) {
354
  public Object getFieldValue(_Fields field) {
311
    switch (field) {
355
    switch (field) {
Line 319... Line 363...
319
      return Long.valueOf(getWarehouseId());
363
      return Long.valueOf(getWarehouseId());
320
 
364
 
321
    case ROLE:
365
    case ROLE:
322
      return getRole();
366
      return getRole();
323
 
367
 
-
 
368
    case SOURCE:
-
 
369
      return Long.valueOf(getSource());
-
 
370
 
324
    }
371
    }
325
    throw new IllegalStateException();
372
    throw new IllegalStateException();
326
  }
373
  }
327
 
374
 
328
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
375
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
Line 338... Line 385...
338
      return isSetPassword();
385
      return isSetPassword();
339
    case WAREHOUSE_ID:
386
    case WAREHOUSE_ID:
340
      return isSetWarehouseId();
387
      return isSetWarehouseId();
341
    case ROLE:
388
    case ROLE:
342
      return isSetRole();
389
      return isSetRole();
-
 
390
    case SOURCE:
-
 
391
      return isSetSource();
343
    }
392
    }
344
    throw new IllegalStateException();
393
    throw new IllegalStateException();
345
  }
394
  }
346
 
395
 
347
  @Override
396
  @Override
Line 391... Line 440...
391
        return false;
440
        return false;
392
      if (!this.role.equals(that.role))
441
      if (!this.role.equals(that.role))
393
        return false;
442
        return false;
394
    }
443
    }
395
 
444
 
-
 
445
    boolean this_present_source = true;
-
 
446
    boolean that_present_source = true;
-
 
447
    if (this_present_source || that_present_source) {
-
 
448
      if (!(this_present_source && that_present_source))
-
 
449
        return false;
-
 
450
      if (this.source != that.source)
-
 
451
        return false;
-
 
452
    }
-
 
453
 
396
    return true;
454
    return true;
397
  }
455
  }
398
 
456
 
399
  @Override
457
  @Override
400
  public int hashCode() {
458
  public int hashCode() {
Line 447... Line 505...
447
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.role, typedOther.role);
505
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.role, typedOther.role);
448
      if (lastComparison != 0) {
506
      if (lastComparison != 0) {
449
        return lastComparison;
507
        return lastComparison;
450
      }
508
      }
451
    }
509
    }
-
 
510
    lastComparison = Boolean.valueOf(isSetSource()).compareTo(typedOther.isSetSource());
-
 
511
    if (lastComparison != 0) {
-
 
512
      return lastComparison;
-
 
513
    }
-
 
514
    if (isSetSource()) {
-
 
515
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.source, typedOther.source);
-
 
516
      if (lastComparison != 0) {
-
 
517
        return lastComparison;
-
 
518
      }
-
 
519
    }
452
    return 0;
520
    return 0;
453
  }
521
  }
454
 
522
 
455
  public _Fields fieldForId(int fieldId) {
523
  public _Fields fieldForId(int fieldId) {
456
    return _Fields.findByThriftId(fieldId);
524
    return _Fields.findByThriftId(fieldId);
Line 493... Line 561...
493
            this.role = Role.findByValue(iprot.readI32());
561
            this.role = Role.findByValue(iprot.readI32());
494
          } else { 
562
          } else { 
495
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
563
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
496
          }
564
          }
497
          break;
565
          break;
-
 
566
        case 5: // SOURCE
-
 
567
          if (field.type == org.apache.thrift.protocol.TType.I64) {
-
 
568
            this.source = iprot.readI64();
-
 
569
            setSourceIsSet(true);
-
 
570
          } else { 
-
 
571
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
572
          }
-
 
573
          break;
498
        default:
574
        default:
499
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
575
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
500
      }
576
      }
501
      iprot.readFieldEnd();
577
      iprot.readFieldEnd();
502
    }
578
    }
Line 524... Line 600...
524
    if (this.role != null) {
600
    if (this.role != null) {
525
      oprot.writeFieldBegin(ROLE_FIELD_DESC);
601
      oprot.writeFieldBegin(ROLE_FIELD_DESC);
526
      oprot.writeI32(this.role.getValue());
602
      oprot.writeI32(this.role.getValue());
527
      oprot.writeFieldEnd();
603
      oprot.writeFieldEnd();
528
    }
604
    }
-
 
605
    oprot.writeFieldBegin(SOURCE_FIELD_DESC);
-
 
606
    oprot.writeI64(this.source);
-
 
607
    oprot.writeFieldEnd();
529
    oprot.writeFieldStop();
608
    oprot.writeFieldStop();
530
    oprot.writeStructEnd();
609
    oprot.writeStructEnd();
531
  }
610
  }
532
 
611
 
533
  @Override
612
  @Override
Line 560... Line 639...
560
      sb.append("null");
639
      sb.append("null");
561
    } else {
640
    } else {
562
      sb.append(this.role);
641
      sb.append(this.role);
563
    }
642
    }
564
    first = false;
643
    first = false;
-
 
644
    if (!first) sb.append(", ");
-
 
645
    sb.append("source:");
-
 
646
    sb.append(this.source);
-
 
647
    first = false;
565
    sb.append(")");
648
    sb.append(")");
566
    return sb.toString();
649
    return sb.toString();
567
  }
650
  }
568
 
651
 
569
  public void validate() throws org.apache.thrift.TException {
652
  public void validate() throws org.apache.thrift.TException {