Subversion Repositories SmartDukaan

Rev

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

Rev 2357 Rev 3430
Line 1... Line 1...
1
/**
1
/**
2
 * Autogenerated by Thrift
2
 * Autogenerated by Thrift Compiler (0.7.0)
3
 *
3
 *
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
 */
5
 */
6
package in.shop2020.utils;
6
package in.shop2020.utils;
7
 
7
 
Line 13... Line 13...
13
import java.util.Set;
13
import java.util.Set;
14
import java.util.HashSet;
14
import java.util.HashSet;
15
import java.util.EnumSet;
15
import java.util.EnumSet;
16
import java.util.Collections;
16
import java.util.Collections;
17
import java.util.BitSet;
17
import java.util.BitSet;
-
 
18
import java.nio.ByteBuffer;
18
import java.util.Arrays;
19
import java.util.Arrays;
19
import org.slf4j.Logger;
20
import org.slf4j.Logger;
20
import org.slf4j.LoggerFactory;
21
import org.slf4j.LoggerFactory;
21
 
22
 
22
import org.apache.thrift.*;
-
 
23
import org.apache.thrift.meta_data.*;
-
 
24
import org.apache.thrift.protocol.*;
-
 
25
 
-
 
26
public class CatalogDashboardUser implements TBase<CatalogDashboardUser._Fields>, java.io.Serializable, Cloneable, Comparable<CatalogDashboardUser> {
23
public class CatalogDashboardUser implements org.apache.thrift.TBase<CatalogDashboardUser, CatalogDashboardUser._Fields>, java.io.Serializable, Cloneable {
27
  private static final TStruct STRUCT_DESC = new TStruct("CatalogDashboardUser");
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CatalogDashboardUser");
28
 
25
 
29
  private static final TField USERNAME_FIELD_DESC = new TField("username", 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);
30
  private static final TField PASSWORD_FIELD_DESC = new TField("password", 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);
31
  private static final TField ROLE_FIELD_DESC = new TField("role", TType.I64, (short)3);
28
  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)3);
32
 
29
 
33
  private String username;
30
  private String username; // required
34
  private String password;
31
  private String password; // required
35
  private long role;
32
  private long role; // required
36
 
33
 
37
  /** 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. */
38
  public enum _Fields implements TFieldIdEnum {
35
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
39
    USERNAME((short)1, "username"),
36
    USERNAME((short)1, "username"),
40
    PASSWORD((short)2, "password"),
37
    PASSWORD((short)2, "password"),
41
    ROLE((short)3, "role");
38
    ROLE((short)3, "role");
42
 
39
 
43
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
-
 
44
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
40
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
45
 
41
 
46
    static {
42
    static {
47
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
43
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
48
        byId.put((int)field._thriftId, field);
-
 
49
        byName.put(field.getFieldName(), field);
44
        byName.put(field.getFieldName(), field);
50
      }
45
      }
51
    }
46
    }
52
 
47
 
53
    /**
48
    /**
54
     * Find the _Fields constant that matches fieldId, or null if its not found.
49
     * Find the _Fields constant that matches fieldId, or null if its not found.
55
     */
50
     */
56
    public static _Fields findByThriftId(int fieldId) {
51
    public static _Fields findByThriftId(int fieldId) {
57
      return byId.get(fieldId);
52
      switch(fieldId) {
-
 
53
        case 1: // USERNAME
-
 
54
          return USERNAME;
-
 
55
        case 2: // PASSWORD
-
 
56
          return PASSWORD;
-
 
57
        case 3: // ROLE
-
 
58
          return ROLE;
-
 
59
        default:
-
 
60
          return null;
-
 
61
      }
58
    }
62
    }
59
 
63
 
60
    /**
64
    /**
61
     * Find the _Fields constant that matches fieldId, throwing an exception
65
     * Find the _Fields constant that matches fieldId, throwing an exception
62
     * if it is not found.
66
     * if it is not found.
Line 93... Line 97...
93
 
97
 
94
  // isset id assignments
98
  // isset id assignments
95
  private static final int __ROLE_ISSET_ID = 0;
99
  private static final int __ROLE_ISSET_ID = 0;
96
  private BitSet __isset_bit_vector = new BitSet(1);
100
  private BitSet __isset_bit_vector = new BitSet(1);
97
 
101
 
98
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
102
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
99
    put(_Fields.USERNAME, new FieldMetaData("username", TFieldRequirementType.DEFAULT, 
-
 
100
        new FieldValueMetaData(TType.STRING)));
-
 
101
    put(_Fields.PASSWORD, new FieldMetaData("password", TFieldRequirementType.DEFAULT, 
-
 
102
        new FieldValueMetaData(TType.STRING)));
-
 
103
    put(_Fields.ROLE, new FieldMetaData("role", TFieldRequirementType.DEFAULT, 
-
 
104
        new FieldValueMetaData(TType.I64)));
-
 
105
  }});
-
 
106
 
-
 
107
  static {
103
  static {
-
 
104
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-
 
105
    tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
106
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-
 
107
    tmpMap.put(_Fields.PASSWORD, new org.apache.thrift.meta_data.FieldMetaData("password", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
108
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-
 
109
    tmpMap.put(_Fields.ROLE, new org.apache.thrift.meta_data.FieldMetaData("role", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
110
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-
 
111
    metaDataMap = Collections.unmodifiableMap(tmpMap);
108
    FieldMetaData.addStructMetaDataMap(CatalogDashboardUser.class, metaDataMap);
112
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CatalogDashboardUser.class, metaDataMap);
109
  }
113
  }
110
 
114
 
111
  public CatalogDashboardUser() {
115
  public CatalogDashboardUser() {
112
  }
116
  }
113
 
117
 
Line 140... Line 144...
140
 
144
 
141
  public CatalogDashboardUser deepCopy() {
145
  public CatalogDashboardUser deepCopy() {
142
    return new CatalogDashboardUser(this);
146
    return new CatalogDashboardUser(this);
143
  }
147
  }
144
 
148
 
145
  @Deprecated
149
  @Override
146
  public CatalogDashboardUser clone() {
150
  public void clear() {
-
 
151
    this.username = null;
-
 
152
    this.password = null;
147
    return new CatalogDashboardUser(this);
153
    setRoleIsSet(false);
-
 
154
    this.role = 0;
148
  }
155
  }
149
 
156
 
150
  public String getUsername() {
157
  public String getUsername() {
151
    return this.username;
158
    return this.username;
152
  }
159
  }
153
 
160
 
154
  public CatalogDashboardUser setUsername(String username) {
161
  public void setUsername(String username) {
155
    this.username = username;
162
    this.username = username;
156
    return this;
-
 
157
  }
163
  }
158
 
164
 
159
  public void unsetUsername() {
165
  public void unsetUsername() {
160
    this.username = null;
166
    this.username = null;
161
  }
167
  }
162
 
168
 
163
  /** Returns true if field username is set (has been asigned a value) and false otherwise */
169
  /** Returns true if field username is set (has been assigned a value) and false otherwise */
164
  public boolean isSetUsername() {
170
  public boolean isSetUsername() {
165
    return this.username != null;
171
    return this.username != null;
166
  }
172
  }
167
 
173
 
168
  public void setUsernameIsSet(boolean value) {
174
  public void setUsernameIsSet(boolean value) {
Line 173... Line 179...
173
 
179
 
174
  public String getPassword() {
180
  public String getPassword() {
175
    return this.password;
181
    return this.password;
176
  }
182
  }
177
 
183
 
178
  public CatalogDashboardUser setPassword(String password) {
184
  public void setPassword(String password) {
179
    this.password = password;
185
    this.password = password;
180
    return this;
-
 
181
  }
186
  }
182
 
187
 
183
  public void unsetPassword() {
188
  public void unsetPassword() {
184
    this.password = null;
189
    this.password = null;
185
  }
190
  }
186
 
191
 
187
  /** Returns true if field password is set (has been asigned a value) and false otherwise */
192
  /** Returns true if field password is set (has been assigned a value) and false otherwise */
188
  public boolean isSetPassword() {
193
  public boolean isSetPassword() {
189
    return this.password != null;
194
    return this.password != null;
190
  }
195
  }
191
 
196
 
192
  public void setPasswordIsSet(boolean value) {
197
  public void setPasswordIsSet(boolean value) {
Line 197... Line 202...
197
 
202
 
198
  public long getRole() {
203
  public long getRole() {
199
    return this.role;
204
    return this.role;
200
  }
205
  }
201
 
206
 
202
  public CatalogDashboardUser setRole(long role) {
207
  public void setRole(long role) {
203
    this.role = role;
208
    this.role = role;
204
    setRoleIsSet(true);
209
    setRoleIsSet(true);
205
    return this;
-
 
206
  }
210
  }
207
 
211
 
208
  public void unsetRole() {
212
  public void unsetRole() {
209
    __isset_bit_vector.clear(__ROLE_ISSET_ID);
213
    __isset_bit_vector.clear(__ROLE_ISSET_ID);
210
  }
214
  }
211
 
215
 
212
  /** Returns true if field role is set (has been asigned a value) and false otherwise */
216
  /** Returns true if field role is set (has been assigned a value) and false otherwise */
213
  public boolean isSetRole() {
217
  public boolean isSetRole() {
214
    return __isset_bit_vector.get(__ROLE_ISSET_ID);
218
    return __isset_bit_vector.get(__ROLE_ISSET_ID);
215
  }
219
  }
216
 
220
 
217
  public void setRoleIsSet(boolean value) {
221
  public void setRoleIsSet(boolean value) {
Line 245... Line 249...
245
      break;
249
      break;
246
 
250
 
247
    }
251
    }
248
  }
252
  }
249
 
253
 
250
  public void setFieldValue(int fieldID, Object value) {
-
 
251
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
252
  }
-
 
253
 
-
 
254
  public Object getFieldValue(_Fields field) {
254
  public Object getFieldValue(_Fields field) {
255
    switch (field) {
255
    switch (field) {
256
    case USERNAME:
256
    case USERNAME:
257
      return getUsername();
257
      return getUsername();
258
 
258
 
259
    case PASSWORD:
259
    case PASSWORD:
260
      return getPassword();
260
      return getPassword();
261
 
261
 
262
    case ROLE:
262
    case ROLE:
263
      return new Long(getRole());
263
      return Long.valueOf(getRole());
264
 
264
 
265
    }
265
    }
266
    throw new IllegalStateException();
266
    throw new IllegalStateException();
267
  }
267
  }
268
 
268
 
269
  public Object getFieldValue(int fieldId) {
-
 
270
    return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
271
  }
-
 
272
 
-
 
273
  /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
269
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
274
  public boolean isSet(_Fields field) {
270
  public boolean isSet(_Fields field) {
-
 
271
    if (field == null) {
-
 
272
      throw new IllegalArgumentException();
-
 
273
    }
-
 
274
 
275
    switch (field) {
275
    switch (field) {
276
    case USERNAME:
276
    case USERNAME:
277
      return isSetUsername();
277
      return isSetUsername();
278
    case PASSWORD:
278
    case PASSWORD:
279
      return isSetPassword();
279
      return isSetPassword();
Line 281... Line 281...
281
      return isSetRole();
281
      return isSetRole();
282
    }
282
    }
283
    throw new IllegalStateException();
283
    throw new IllegalStateException();
284
  }
284
  }
285
 
285
 
286
  public boolean isSet(int fieldID) {
-
 
287
    return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
288
  }
-
 
289
 
-
 
290
  @Override
286
  @Override
291
  public boolean equals(Object that) {
287
  public boolean equals(Object that) {
292
    if (that == null)
288
    if (that == null)
293
      return false;
289
      return false;
294
    if (that instanceof CatalogDashboardUser)
290
    if (that instanceof CatalogDashboardUser)
Line 341... Line 337...
341
    }
337
    }
342
 
338
 
343
    int lastComparison = 0;
339
    int lastComparison = 0;
344
    CatalogDashboardUser typedOther = (CatalogDashboardUser)other;
340
    CatalogDashboardUser typedOther = (CatalogDashboardUser)other;
345
 
341
 
346
    lastComparison = Boolean.valueOf(isSetUsername()).compareTo(isSetUsername());
342
    lastComparison = Boolean.valueOf(isSetUsername()).compareTo(typedOther.isSetUsername());
347
    if (lastComparison != 0) {
343
    if (lastComparison != 0) {
348
      return lastComparison;
344
      return lastComparison;
349
    }
345
    }
-
 
346
    if (isSetUsername()) {
350
    lastComparison = TBaseHelper.compareTo(username, typedOther.username);
347
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, typedOther.username);
351
    if (lastComparison != 0) {
348
      if (lastComparison != 0) {
352
      return lastComparison;
349
        return lastComparison;
-
 
350
      }
353
    }
351
    }
354
    lastComparison = Boolean.valueOf(isSetPassword()).compareTo(isSetPassword());
352
    lastComparison = Boolean.valueOf(isSetPassword()).compareTo(typedOther.isSetPassword());
355
    if (lastComparison != 0) {
353
    if (lastComparison != 0) {
356
      return lastComparison;
354
      return lastComparison;
357
    }
355
    }
-
 
356
    if (isSetPassword()) {
358
    lastComparison = TBaseHelper.compareTo(password, typedOther.password);
357
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.password, typedOther.password);
359
    if (lastComparison != 0) {
358
      if (lastComparison != 0) {
360
      return lastComparison;
359
        return lastComparison;
-
 
360
      }
361
    }
361
    }
362
    lastComparison = Boolean.valueOf(isSetRole()).compareTo(isSetRole());
362
    lastComparison = Boolean.valueOf(isSetRole()).compareTo(typedOther.isSetRole());
363
    if (lastComparison != 0) {
363
    if (lastComparison != 0) {
364
      return lastComparison;
364
      return lastComparison;
365
    }
365
    }
-
 
366
    if (isSetRole()) {
366
    lastComparison = TBaseHelper.compareTo(role, typedOther.role);
367
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.role, typedOther.role);
367
    if (lastComparison != 0) {
368
      if (lastComparison != 0) {
368
      return lastComparison;
369
        return lastComparison;
-
 
370
      }
369
    }
371
    }
370
    return 0;
372
    return 0;
371
  }
373
  }
372
 
374
 
-
 
375
  public _Fields fieldForId(int fieldId) {
-
 
376
    return _Fields.findByThriftId(fieldId);
-
 
377
  }
-
 
378
 
373
  public void read(TProtocol iprot) throws TException {
379
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
374
    TField field;
380
    org.apache.thrift.protocol.TField field;
375
    iprot.readStructBegin();
381
    iprot.readStructBegin();
376
    while (true)
382
    while (true)
377
    {
383
    {
378
      field = iprot.readFieldBegin();
384
      field = iprot.readFieldBegin();
379
      if (field.type == TType.STOP) { 
385
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
380
        break;
386
        break;
381
      }
387
      }
382
      _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
383
      if (fieldId == null) {
-
 
384
        TProtocolUtil.skip(iprot, field.type);
-
 
385
      } else {
-
 
386
        switch (fieldId) {
388
      switch (field.id) {
387
          case USERNAME:
389
        case 1: // USERNAME
388
            if (field.type == TType.STRING) {
390
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
389
              this.username = iprot.readString();
391
            this.username = iprot.readString();
390
            } else { 
392
          } else { 
391
              TProtocolUtil.skip(iprot, field.type);
393
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
392
            }
394
          }
393
            break;
395
          break;
394
          case PASSWORD:
396
        case 2: // PASSWORD
395
            if (field.type == TType.STRING) {
397
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
396
              this.password = iprot.readString();
398
            this.password = iprot.readString();
397
            } else { 
399
          } else { 
398
              TProtocolUtil.skip(iprot, field.type);
400
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
399
            }
401
          }
400
            break;
402
          break;
401
          case ROLE:
403
        case 3: // ROLE
402
            if (field.type == TType.I64) {
404
          if (field.type == org.apache.thrift.protocol.TType.I64) {
403
              this.role = iprot.readI64();
405
            this.role = iprot.readI64();
404
              setRoleIsSet(true);
406
            setRoleIsSet(true);
405
            } else { 
407
          } else { 
406
              TProtocolUtil.skip(iprot, field.type);
408
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
407
            }
409
          }
408
            break;
410
          break;
409
        }
411
        default:
410
        iprot.readFieldEnd();
412
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
411
      }
413
      }
-
 
414
      iprot.readFieldEnd();
412
    }
415
    }
413
    iprot.readStructEnd();
416
    iprot.readStructEnd();
414
    validate();
417
    validate();
415
  }
418
  }
416
 
419
 
417
  public void write(TProtocol oprot) throws TException {
420
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
418
    validate();
421
    validate();
419
 
422
 
420
    oprot.writeStructBegin(STRUCT_DESC);
423
    oprot.writeStructBegin(STRUCT_DESC);
421
    if (this.username != null) {
424
    if (this.username != null) {
422
      oprot.writeFieldBegin(USERNAME_FIELD_DESC);
425
      oprot.writeFieldBegin(USERNAME_FIELD_DESC);
Line 461... Line 464...
461
    first = false;
464
    first = false;
462
    sb.append(")");
465
    sb.append(")");
463
    return sb.toString();
466
    return sb.toString();
464
  }
467
  }
465
 
468
 
466
  public void validate() throws TException {
469
  public void validate() throws org.apache.thrift.TException {
467
    // check for required fields
470
    // check for required fields
468
  }
471
  }
469
 
472
 
-
 
473
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-
 
474
    try {
-
 
475
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-
 
476
    } catch (org.apache.thrift.TException te) {
-
 
477
      throw new java.io.IOException(te);
-
 
478
    }
-
 
479
  }
-
 
480
 
-
 
481
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-
 
482
    try {
-
 
483
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
-
 
484
      __isset_bit_vector = new BitSet(1);
-
 
485
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-
 
486
    } catch (org.apache.thrift.TException te) {
-
 
487
      throw new java.io.IOException(te);
-
 
488
    }
-
 
489
  }
-
 
490
 
470
}
491
}
471
 
492