Subversion Repositories SmartDukaan

Rev

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

Rev 2024 Rev 2357
Line 26... Line 26...
26
public class CatalogDashboardUser implements TBase<CatalogDashboardUser._Fields>, java.io.Serializable, Cloneable, Comparable<CatalogDashboardUser> {
26
public class CatalogDashboardUser implements TBase<CatalogDashboardUser._Fields>, java.io.Serializable, Cloneable, Comparable<CatalogDashboardUser> {
27
  private static final TStruct STRUCT_DESC = new TStruct("CatalogDashboardUser");
27
  private static final TStruct STRUCT_DESC = new TStruct("CatalogDashboardUser");
28
 
28
 
29
  private static final TField USERNAME_FIELD_DESC = new TField("username", TType.STRING, (short)1);
29
  private static final TField USERNAME_FIELD_DESC = new TField("username", TType.STRING, (short)1);
30
  private static final TField PASSWORD_FIELD_DESC = new TField("password", TType.STRING, (short)2);
30
  private static final TField PASSWORD_FIELD_DESC = new TField("password", TType.STRING, (short)2);
-
 
31
  private static final TField ROLE_FIELD_DESC = new TField("role", TType.I64, (short)3);
31
 
32
 
32
  private String username;
33
  private String username;
33
  private String password;
34
  private String password;
-
 
35
  private long role;
34
 
36
 
35
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
37
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
36
  public enum _Fields implements TFieldIdEnum {
38
  public enum _Fields implements TFieldIdEnum {
37
    USERNAME((short)1, "username"),
39
    USERNAME((short)1, "username"),
38
    PASSWORD((short)2, "password");
40
    PASSWORD((short)2, "password"),
-
 
41
    ROLE((short)3, "role");
39
 
42
 
40
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
43
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
41
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
44
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
42
 
45
 
43
    static {
46
    static {
Line 87... Line 90...
87
      return _fieldName;
90
      return _fieldName;
88
    }
91
    }
89
  }
92
  }
90
 
93
 
91
  // isset id assignments
94
  // isset id assignments
-
 
95
  private static final int __ROLE_ISSET_ID = 0;
-
 
96
  private BitSet __isset_bit_vector = new BitSet(1);
92
 
97
 
93
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
98
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
94
    put(_Fields.USERNAME, new FieldMetaData("username", TFieldRequirementType.DEFAULT, 
99
    put(_Fields.USERNAME, new FieldMetaData("username", TFieldRequirementType.DEFAULT, 
95
        new FieldValueMetaData(TType.STRING)));
100
        new FieldValueMetaData(TType.STRING)));
96
    put(_Fields.PASSWORD, new FieldMetaData("password", TFieldRequirementType.DEFAULT, 
101
    put(_Fields.PASSWORD, new FieldMetaData("password", TFieldRequirementType.DEFAULT, 
97
        new FieldValueMetaData(TType.STRING)));
102
        new FieldValueMetaData(TType.STRING)));
-
 
103
    put(_Fields.ROLE, new FieldMetaData("role", TFieldRequirementType.DEFAULT, 
-
 
104
        new FieldValueMetaData(TType.I64)));
98
  }});
105
  }});
99
 
106
 
100
  static {
107
  static {
101
    FieldMetaData.addStructMetaDataMap(CatalogDashboardUser.class, metaDataMap);
108
    FieldMetaData.addStructMetaDataMap(CatalogDashboardUser.class, metaDataMap);
102
  }
109
  }
Line 104... Line 111...
104
  public CatalogDashboardUser() {
111
  public CatalogDashboardUser() {
105
  }
112
  }
106
 
113
 
107
  public CatalogDashboardUser(
114
  public CatalogDashboardUser(
108
    String username,
115
    String username,
109
    String password)
116
    String password,
-
 
117
    long role)
110
  {
118
  {
111
    this();
119
    this();
112
    this.username = username;
120
    this.username = username;
113
    this.password = password;
121
    this.password = password;
-
 
122
    this.role = role;
-
 
123
    setRoleIsSet(true);
114
  }
124
  }
115
 
125
 
116
  /**
126
  /**
117
   * Performs a deep copy on <i>other</i>.
127
   * Performs a deep copy on <i>other</i>.
118
   */
128
   */
119
  public CatalogDashboardUser(CatalogDashboardUser other) {
129
  public CatalogDashboardUser(CatalogDashboardUser other) {
-
 
130
    __isset_bit_vector.clear();
-
 
131
    __isset_bit_vector.or(other.__isset_bit_vector);
120
    if (other.isSetUsername()) {
132
    if (other.isSetUsername()) {
121
      this.username = other.username;
133
      this.username = other.username;
122
    }
134
    }
123
    if (other.isSetPassword()) {
135
    if (other.isSetPassword()) {
124
      this.password = other.password;
136
      this.password = other.password;
125
    }
137
    }
-
 
138
    this.role = other.role;
126
  }
139
  }
127
 
140
 
128
  public CatalogDashboardUser deepCopy() {
141
  public CatalogDashboardUser deepCopy() {
129
    return new CatalogDashboardUser(this);
142
    return new CatalogDashboardUser(this);
130
  }
143
  }
Line 180... Line 193...
180
    if (!value) {
193
    if (!value) {
181
      this.password = null;
194
      this.password = null;
182
    }
195
    }
183
  }
196
  }
184
 
197
 
-
 
198
  public long getRole() {
-
 
199
    return this.role;
-
 
200
  }
-
 
201
 
-
 
202
  public CatalogDashboardUser setRole(long role) {
-
 
203
    this.role = role;
-
 
204
    setRoleIsSet(true);
-
 
205
    return this;
-
 
206
  }
-
 
207
 
-
 
208
  public void unsetRole() {
-
 
209
    __isset_bit_vector.clear(__ROLE_ISSET_ID);
-
 
210
  }
-
 
211
 
-
 
212
  /** Returns true if field role is set (has been asigned a value) and false otherwise */
-
 
213
  public boolean isSetRole() {
-
 
214
    return __isset_bit_vector.get(__ROLE_ISSET_ID);
-
 
215
  }
-
 
216
 
-
 
217
  public void setRoleIsSet(boolean value) {
-
 
218
    __isset_bit_vector.set(__ROLE_ISSET_ID, value);
-
 
219
  }
-
 
220
 
185
  public void setFieldValue(_Fields field, Object value) {
221
  public void setFieldValue(_Fields field, Object value) {
186
    switch (field) {
222
    switch (field) {
187
    case USERNAME:
223
    case USERNAME:
188
      if (value == null) {
224
      if (value == null) {
189
        unsetUsername();
225
        unsetUsername();
Line 198... Line 234...
198
      } else {
234
      } else {
199
        setPassword((String)value);
235
        setPassword((String)value);
200
      }
236
      }
201
      break;
237
      break;
202
 
238
 
-
 
239
    case ROLE:
-
 
240
      if (value == null) {
-
 
241
        unsetRole();
-
 
242
      } else {
-
 
243
        setRole((Long)value);
-
 
244
      }
-
 
245
      break;
-
 
246
 
203
    }
247
    }
204
  }
248
  }
205
 
249
 
206
  public void setFieldValue(int fieldID, Object value) {
250
  public void setFieldValue(int fieldID, Object value) {
207
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
251
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
Line 213... Line 257...
213
      return getUsername();
257
      return getUsername();
214
 
258
 
215
    case PASSWORD:
259
    case PASSWORD:
216
      return getPassword();
260
      return getPassword();
217
 
261
 
-
 
262
    case ROLE:
-
 
263
      return new Long(getRole());
-
 
264
 
218
    }
265
    }
219
    throw new IllegalStateException();
266
    throw new IllegalStateException();
220
  }
267
  }
221
 
268
 
222
  public Object getFieldValue(int fieldId) {
269
  public Object getFieldValue(int fieldId) {
Line 228... Line 275...
228
    switch (field) {
275
    switch (field) {
229
    case USERNAME:
276
    case USERNAME:
230
      return isSetUsername();
277
      return isSetUsername();
231
    case PASSWORD:
278
    case PASSWORD:
232
      return isSetPassword();
279
      return isSetPassword();
-
 
280
    case ROLE:
-
 
281
      return isSetRole();
233
    }
282
    }
234
    throw new IllegalStateException();
283
    throw new IllegalStateException();
235
  }
284
  }
236
 
285
 
237
  public boolean isSet(int fieldID) {
286
  public boolean isSet(int fieldID) {
Line 267... Line 316...
267
        return false;
316
        return false;
268
      if (!this.password.equals(that.password))
317
      if (!this.password.equals(that.password))
269
        return false;
318
        return false;
270
    }
319
    }
271
 
320
 
-
 
321
    boolean this_present_role = true;
-
 
322
    boolean that_present_role = true;
-
 
323
    if (this_present_role || that_present_role) {
-
 
324
      if (!(this_present_role && that_present_role))
-
 
325
        return false;
-
 
326
      if (this.role != that.role)
-
 
327
        return false;
-
 
328
    }
-
 
329
 
272
    return true;
330
    return true;
273
  }
331
  }
274
 
332
 
275
  @Override
333
  @Override
276
  public int hashCode() {
334
  public int hashCode() {
Line 299... Line 357...
299
    }
357
    }
300
    lastComparison = TBaseHelper.compareTo(password, typedOther.password);
358
    lastComparison = TBaseHelper.compareTo(password, typedOther.password);
301
    if (lastComparison != 0) {
359
    if (lastComparison != 0) {
302
      return lastComparison;
360
      return lastComparison;
303
    }
361
    }
-
 
362
    lastComparison = Boolean.valueOf(isSetRole()).compareTo(isSetRole());
-
 
363
    if (lastComparison != 0) {
-
 
364
      return lastComparison;
-
 
365
    }
-
 
366
    lastComparison = TBaseHelper.compareTo(role, typedOther.role);
-
 
367
    if (lastComparison != 0) {
-
 
368
      return lastComparison;
-
 
369
    }
304
    return 0;
370
    return 0;
305
  }
371
  }
306
 
372
 
307
  public void read(TProtocol iprot) throws TException {
373
  public void read(TProtocol iprot) throws TException {
308
    TField field;
374
    TField field;
Line 330... Line 396...
330
              this.password = iprot.readString();
396
              this.password = iprot.readString();
331
            } else { 
397
            } else { 
332
              TProtocolUtil.skip(iprot, field.type);
398
              TProtocolUtil.skip(iprot, field.type);
333
            }
399
            }
334
            break;
400
            break;
-
 
401
          case ROLE:
-
 
402
            if (field.type == TType.I64) {
-
 
403
              this.role = iprot.readI64();
-
 
404
              setRoleIsSet(true);
-
 
405
            } else { 
-
 
406
              TProtocolUtil.skip(iprot, field.type);
-
 
407
            }
-
 
408
            break;
335
        }
409
        }
336
        iprot.readFieldEnd();
410
        iprot.readFieldEnd();
337
      }
411
      }
338
    }
412
    }
339
    iprot.readStructEnd();
413
    iprot.readStructEnd();
Line 352... Line 426...
352
    if (this.password != null) {
426
    if (this.password != null) {
353
      oprot.writeFieldBegin(PASSWORD_FIELD_DESC);
427
      oprot.writeFieldBegin(PASSWORD_FIELD_DESC);
354
      oprot.writeString(this.password);
428
      oprot.writeString(this.password);
355
      oprot.writeFieldEnd();
429
      oprot.writeFieldEnd();
356
    }
430
    }
-
 
431
    oprot.writeFieldBegin(ROLE_FIELD_DESC);
-
 
432
    oprot.writeI64(this.role);
-
 
433
    oprot.writeFieldEnd();
357
    oprot.writeFieldStop();
434
    oprot.writeFieldStop();
358
    oprot.writeStructEnd();
435
    oprot.writeStructEnd();
359
  }
436
  }
360
 
437
 
361
  @Override
438
  @Override
Line 376... Line 453...
376
      sb.append("null");
453
      sb.append("null");
377
    } else {
454
    } else {
378
      sb.append(this.password);
455
      sb.append(this.password);
379
    }
456
    }
380
    first = false;
457
    first = false;
-
 
458
    if (!first) sb.append(", ");
-
 
459
    sb.append("role:");
-
 
460
    sb.append(this.role);
-
 
461
    first = false;
381
    sb.append(")");
462
    sb.append(")");
382
    return sb.toString();
463
    return sb.toString();
383
  }
464
  }
384
 
465
 
385
  public void validate() throws TException {
466
  public void validate() throws TException {