Subversion Repositories SmartDukaan

Rev

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

Rev 3430 Rev 12256
Line 23... Line 23...
23
public class ReportUser implements org.apache.thrift.TBase<ReportUser, ReportUser._Fields>, java.io.Serializable, Cloneable {
23
public class ReportUser implements org.apache.thrift.TBase<ReportUser, ReportUser._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ReportUser");
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ReportUser");
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 ROLE_FIELD_DESC = new org.apache.thrift.protocol.TField("role", org.apache.thrift.protocol.TType.I64, (short)2);
27
  private static final org.apache.thrift.protocol.TField ROLE_FIELD_DESC = new org.apache.thrift.protocol.TField("role", org.apache.thrift.protocol.TType.I64, (short)2);
-
 
28
  private static final org.apache.thrift.protocol.TField EMAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("email", org.apache.thrift.protocol.TType.STRING, (short)3);
28
 
29
 
29
  private String username; // required
30
  private String username; // required
30
  private long role; // required
31
  private long role; // required
-
 
32
  private String email; // required
31
 
33
 
32
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
34
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
33
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
35
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
34
    USERNAME((short)1, "username"),
36
    USERNAME((short)1, "username"),
35
    ROLE((short)2, "role");
37
    ROLE((short)2, "role"),
-
 
38
    EMAIL((short)3, "email");
36
 
39
 
37
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
40
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
38
 
41
 
39
    static {
42
    static {
40
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
43
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
Line 49... Line 52...
49
      switch(fieldId) {
52
      switch(fieldId) {
50
        case 1: // USERNAME
53
        case 1: // USERNAME
51
          return USERNAME;
54
          return USERNAME;
52
        case 2: // ROLE
55
        case 2: // ROLE
53
          return ROLE;
56
          return ROLE;
-
 
57
        case 3: // EMAIL
-
 
58
          return EMAIL;
54
        default:
59
        default:
55
          return null;
60
          return null;
56
      }
61
      }
57
    }
62
    }
58
 
63
 
Line 99... Line 104...
99
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
104
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
100
    tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.DEFAULT, 
105
    tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.DEFAULT, 
101
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
106
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
102
    tmpMap.put(_Fields.ROLE, new org.apache.thrift.meta_data.FieldMetaData("role", org.apache.thrift.TFieldRequirementType.DEFAULT, 
107
    tmpMap.put(_Fields.ROLE, new org.apache.thrift.meta_data.FieldMetaData("role", org.apache.thrift.TFieldRequirementType.DEFAULT, 
103
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
108
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-
 
109
    tmpMap.put(_Fields.EMAIL, new org.apache.thrift.meta_data.FieldMetaData("email", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
110
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
104
    metaDataMap = Collections.unmodifiableMap(tmpMap);
111
    metaDataMap = Collections.unmodifiableMap(tmpMap);
105
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ReportUser.class, metaDataMap);
112
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ReportUser.class, metaDataMap);
106
  }
113
  }
107
 
114
 
108
  public ReportUser() {
115
  public ReportUser() {
109
  }
116
  }
110
 
117
 
111
  public ReportUser(
118
  public ReportUser(
112
    String username,
119
    String username,
113
    long role)
120
    long role,
-
 
121
    String email)
114
  {
122
  {
115
    this();
123
    this();
116
    this.username = username;
124
    this.username = username;
117
    this.role = role;
125
    this.role = role;
118
    setRoleIsSet(true);
126
    setRoleIsSet(true);
-
 
127
    this.email = email;
119
  }
128
  }
120
 
129
 
121
  /**
130
  /**
122
   * Performs a deep copy on <i>other</i>.
131
   * Performs a deep copy on <i>other</i>.
123
   */
132
   */
Line 126... Line 135...
126
    __isset_bit_vector.or(other.__isset_bit_vector);
135
    __isset_bit_vector.or(other.__isset_bit_vector);
127
    if (other.isSetUsername()) {
136
    if (other.isSetUsername()) {
128
      this.username = other.username;
137
      this.username = other.username;
129
    }
138
    }
130
    this.role = other.role;
139
    this.role = other.role;
-
 
140
    if (other.isSetEmail()) {
-
 
141
      this.email = other.email;
-
 
142
    }
131
  }
143
  }
132
 
144
 
133
  public ReportUser deepCopy() {
145
  public ReportUser deepCopy() {
134
    return new ReportUser(this);
146
    return new ReportUser(this);
135
  }
147
  }
Line 137... Line 149...
137
  @Override
149
  @Override
138
  public void clear() {
150
  public void clear() {
139
    this.username = null;
151
    this.username = null;
140
    setRoleIsSet(false);
152
    setRoleIsSet(false);
141
    this.role = 0;
153
    this.role = 0;
-
 
154
    this.email = null;
142
  }
155
  }
143
 
156
 
144
  public String getUsername() {
157
  public String getUsername() {
145
    return this.username;
158
    return this.username;
146
  }
159
  }
Line 184... Line 197...
184
 
197
 
185
  public void setRoleIsSet(boolean value) {
198
  public void setRoleIsSet(boolean value) {
186
    __isset_bit_vector.set(__ROLE_ISSET_ID, value);
199
    __isset_bit_vector.set(__ROLE_ISSET_ID, value);
187
  }
200
  }
188
 
201
 
-
 
202
  public String getEmail() {
-
 
203
    return this.email;
-
 
204
  }
-
 
205
 
-
 
206
  public void setEmail(String email) {
-
 
207
    this.email = email;
-
 
208
  }
-
 
209
 
-
 
210
  public void unsetEmail() {
-
 
211
    this.email = null;
-
 
212
  }
-
 
213
 
-
 
214
  /** Returns true if field email is set (has been assigned a value) and false otherwise */
-
 
215
  public boolean isSetEmail() {
-
 
216
    return this.email != null;
-
 
217
  }
-
 
218
 
-
 
219
  public void setEmailIsSet(boolean value) {
-
 
220
    if (!value) {
-
 
221
      this.email = null;
-
 
222
    }
-
 
223
  }
-
 
224
 
189
  public void setFieldValue(_Fields field, Object value) {
225
  public void setFieldValue(_Fields field, Object value) {
190
    switch (field) {
226
    switch (field) {
191
    case USERNAME:
227
    case USERNAME:
192
      if (value == null) {
228
      if (value == null) {
193
        unsetUsername();
229
        unsetUsername();
Line 202... Line 238...
202
      } else {
238
      } else {
203
        setRole((Long)value);
239
        setRole((Long)value);
204
      }
240
      }
205
      break;
241
      break;
206
 
242
 
-
 
243
    case EMAIL:
-
 
244
      if (value == null) {
-
 
245
        unsetEmail();
-
 
246
      } else {
-
 
247
        setEmail((String)value);
-
 
248
      }
-
 
249
      break;
-
 
250
 
207
    }
251
    }
208
  }
252
  }
209
 
253
 
210
  public Object getFieldValue(_Fields field) {
254
  public Object getFieldValue(_Fields field) {
211
    switch (field) {
255
    switch (field) {
Line 213... Line 257...
213
      return getUsername();
257
      return getUsername();
214
 
258
 
215
    case ROLE:
259
    case ROLE:
216
      return Long.valueOf(getRole());
260
      return Long.valueOf(getRole());
217
 
261
 
-
 
262
    case EMAIL:
-
 
263
      return getEmail();
-
 
264
 
218
    }
265
    }
219
    throw new IllegalStateException();
266
    throw new IllegalStateException();
220
  }
267
  }
221
 
268
 
222
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
269
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
Line 228... Line 275...
228
    switch (field) {
275
    switch (field) {
229
    case USERNAME:
276
    case USERNAME:
230
      return isSetUsername();
277
      return isSetUsername();
231
    case ROLE:
278
    case ROLE:
232
      return isSetRole();
279
      return isSetRole();
-
 
280
    case EMAIL:
-
 
281
      return isSetEmail();
233
    }
282
    }
234
    throw new IllegalStateException();
283
    throw new IllegalStateException();
235
  }
284
  }
236
 
285
 
237
  @Override
286
  @Override
Line 263... Line 312...
263
        return false;
312
        return false;
264
      if (this.role != that.role)
313
      if (this.role != that.role)
265
        return false;
314
        return false;
266
    }
315
    }
267
 
316
 
-
 
317
    boolean this_present_email = true && this.isSetEmail();
-
 
318
    boolean that_present_email = true && that.isSetEmail();
-
 
319
    if (this_present_email || that_present_email) {
-
 
320
      if (!(this_present_email && that_present_email))
-
 
321
        return false;
-
 
322
      if (!this.email.equals(that.email))
-
 
323
        return false;
-
 
324
    }
-
 
325
 
268
    return true;
326
    return true;
269
  }
327
  }
270
 
328
 
271
  @Override
329
  @Override
272
  public int hashCode() {
330
  public int hashCode() {
Line 299... Line 357...
299
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.role, typedOther.role);
357
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.role, typedOther.role);
300
      if (lastComparison != 0) {
358
      if (lastComparison != 0) {
301
        return lastComparison;
359
        return lastComparison;
302
      }
360
      }
303
    }
361
    }
-
 
362
    lastComparison = Boolean.valueOf(isSetEmail()).compareTo(typedOther.isSetEmail());
-
 
363
    if (lastComparison != 0) {
-
 
364
      return lastComparison;
-
 
365
    }
-
 
366
    if (isSetEmail()) {
-
 
367
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.email, typedOther.email);
-
 
368
      if (lastComparison != 0) {
-
 
369
        return lastComparison;
-
 
370
      }
-
 
371
    }
304
    return 0;
372
    return 0;
305
  }
373
  }
306
 
374
 
307
  public _Fields fieldForId(int fieldId) {
375
  public _Fields fieldForId(int fieldId) {
308
    return _Fields.findByThriftId(fieldId);
376
    return _Fields.findByThriftId(fieldId);
Line 331... Line 399...
331
            setRoleIsSet(true);
399
            setRoleIsSet(true);
332
          } else { 
400
          } else { 
333
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
401
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
334
          }
402
          }
335
          break;
403
          break;
-
 
404
        case 3: // EMAIL
-
 
405
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
-
 
406
            this.email = iprot.readString();
-
 
407
          } else { 
-
 
408
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
409
          }
-
 
410
          break;
336
        default:
411
        default:
337
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
412
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
338
      }
413
      }
339
      iprot.readFieldEnd();
414
      iprot.readFieldEnd();
340
    }
415
    }
Line 352... Line 427...
352
      oprot.writeFieldEnd();
427
      oprot.writeFieldEnd();
353
    }
428
    }
354
    oprot.writeFieldBegin(ROLE_FIELD_DESC);
429
    oprot.writeFieldBegin(ROLE_FIELD_DESC);
355
    oprot.writeI64(this.role);
430
    oprot.writeI64(this.role);
356
    oprot.writeFieldEnd();
431
    oprot.writeFieldEnd();
-
 
432
    if (this.email != null) {
-
 
433
      oprot.writeFieldBegin(EMAIL_FIELD_DESC);
-
 
434
      oprot.writeString(this.email);
-
 
435
      oprot.writeFieldEnd();
-
 
436
    }
357
    oprot.writeFieldStop();
437
    oprot.writeFieldStop();
358
    oprot.writeStructEnd();
438
    oprot.writeStructEnd();
359
  }
439
  }
360
 
440
 
361
  @Override
441
  @Override
Line 372... Line 452...
372
    first = false;
452
    first = false;
373
    if (!first) sb.append(", ");
453
    if (!first) sb.append(", ");
374
    sb.append("role:");
454
    sb.append("role:");
375
    sb.append(this.role);
455
    sb.append(this.role);
376
    first = false;
456
    first = false;
-
 
457
    if (!first) sb.append(", ");
-
 
458
    sb.append("email:");
-
 
459
    if (this.email == null) {
-
 
460
      sb.append("null");
-
 
461
    } else {
-
 
462
      sb.append(this.email);
-
 
463
    }
-
 
464
    first = false;
377
    sb.append(")");
465
    sb.append(")");
378
    return sb.toString();
466
    return sb.toString();
379
  }
467
  }
380
 
468
 
381
  public void validate() throws org.apache.thrift.TException {
469
  public void validate() throws org.apache.thrift.TException {