Subversion Repositories SmartDukaan

Rev

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

Rev 1611 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.*;
23
public class StatisticsUser implements org.apache.thrift.TBase<StatisticsUser, StatisticsUser._Fields>, java.io.Serializable, Cloneable {
24
import org.apache.thrift.protocol.*;
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("StatisticsUser");
25
 
25
 
26
public class StatisticsUser implements TBase<StatisticsUser._Fields>, java.io.Serializable, Cloneable, Comparable<StatisticsUser> {
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 TStruct STRUCT_DESC = new TStruct("StatisticsUser");
-
 
28
 
27
 
29
  private static final TField USERNAME_FIELD_DESC = new TField("username", TType.STRING, (short)1);
-
 
30
 
-
 
31
  private String username;
28
  private String username; // required
32
 
29
 
33
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
30
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
34
  public enum _Fields implements TFieldIdEnum {
31
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
35
    USERNAME((short)1, "username");
32
    USERNAME((short)1, "username");
36
 
33
 
37
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
-
 
38
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
34
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
39
 
35
 
40
    static {
36
    static {
41
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
37
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
42
        byId.put((int)field._thriftId, field);
-
 
43
        byName.put(field.getFieldName(), field);
38
        byName.put(field.getFieldName(), field);
44
      }
39
      }
45
    }
40
    }
46
 
41
 
47
    /**
42
    /**
48
     * Find the _Fields constant that matches fieldId, or null if its not found.
43
     * Find the _Fields constant that matches fieldId, or null if its not found.
49
     */
44
     */
50
    public static _Fields findByThriftId(int fieldId) {
45
    public static _Fields findByThriftId(int fieldId) {
51
      return byId.get(fieldId);
46
      switch(fieldId) {
-
 
47
        case 1: // USERNAME
-
 
48
          return USERNAME;
-
 
49
        default:
-
 
50
          return null;
-
 
51
      }
52
    }
52
    }
53
 
53
 
54
    /**
54
    /**
55
     * Find the _Fields constant that matches fieldId, throwing an exception
55
     * Find the _Fields constant that matches fieldId, throwing an exception
56
     * if it is not found.
56
     * if it is not found.
Line 85... Line 85...
85
    }
85
    }
86
  }
86
  }
87
 
87
 
88
  // isset id assignments
88
  // isset id assignments
89
 
89
 
90
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
90
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
91
    put(_Fields.USERNAME, new FieldMetaData("username", TFieldRequirementType.DEFAULT, 
-
 
92
        new FieldValueMetaData(TType.STRING)));
-
 
93
  }});
-
 
94
 
-
 
95
  static {
91
  static {
-
 
92
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-
 
93
    tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
94
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-
 
95
    metaDataMap = Collections.unmodifiableMap(tmpMap);
96
    FieldMetaData.addStructMetaDataMap(StatisticsUser.class, metaDataMap);
96
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(StatisticsUser.class, metaDataMap);
97
  }
97
  }
98
 
98
 
99
  public StatisticsUser() {
99
  public StatisticsUser() {
100
  }
100
  }
101
 
101
 
Line 117... Line 117...
117
 
117
 
118
  public StatisticsUser deepCopy() {
118
  public StatisticsUser deepCopy() {
119
    return new StatisticsUser(this);
119
    return new StatisticsUser(this);
120
  }
120
  }
121
 
121
 
122
  @Deprecated
122
  @Override
123
  public StatisticsUser clone() {
123
  public void clear() {
124
    return new StatisticsUser(this);
124
    this.username = null;
125
  }
125
  }
126
 
126
 
127
  public String getUsername() {
127
  public String getUsername() {
128
    return this.username;
128
    return this.username;
129
  }
129
  }
130
 
130
 
131
  public StatisticsUser setUsername(String username) {
131
  public void setUsername(String username) {
132
    this.username = username;
132
    this.username = username;
133
    return this;
-
 
134
  }
133
  }
135
 
134
 
136
  public void unsetUsername() {
135
  public void unsetUsername() {
137
    this.username = null;
136
    this.username = null;
138
  }
137
  }
139
 
138
 
140
  /** Returns true if field username is set (has been asigned a value) and false otherwise */
139
  /** Returns true if field username is set (has been assigned a value) and false otherwise */
141
  public boolean isSetUsername() {
140
  public boolean isSetUsername() {
142
    return this.username != null;
141
    return this.username != null;
143
  }
142
  }
144
 
143
 
145
  public void setUsernameIsSet(boolean value) {
144
  public void setUsernameIsSet(boolean value) {
Line 159... Line 158...
159
      break;
158
      break;
160
 
159
 
161
    }
160
    }
162
  }
161
  }
163
 
162
 
164
  public void setFieldValue(int fieldID, Object value) {
-
 
165
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
166
  }
-
 
167
 
-
 
168
  public Object getFieldValue(_Fields field) {
163
  public Object getFieldValue(_Fields field) {
169
    switch (field) {
164
    switch (field) {
170
    case USERNAME:
165
    case USERNAME:
171
      return getUsername();
166
      return getUsername();
172
 
167
 
173
    }
168
    }
174
    throw new IllegalStateException();
169
    throw new IllegalStateException();
175
  }
170
  }
176
 
171
 
177
  public Object getFieldValue(int fieldId) {
-
 
178
    return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
179
  }
-
 
180
 
-
 
181
  /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
172
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
182
  public boolean isSet(_Fields field) {
173
  public boolean isSet(_Fields field) {
-
 
174
    if (field == null) {
-
 
175
      throw new IllegalArgumentException();
-
 
176
    }
-
 
177
 
183
    switch (field) {
178
    switch (field) {
184
    case USERNAME:
179
    case USERNAME:
185
      return isSetUsername();
180
      return isSetUsername();
186
    }
181
    }
187
    throw new IllegalStateException();
182
    throw new IllegalStateException();
188
  }
183
  }
189
 
184
 
190
  public boolean isSet(int fieldID) {
-
 
191
    return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
192
  }
-
 
193
 
-
 
194
  @Override
185
  @Override
195
  public boolean equals(Object that) {
186
  public boolean equals(Object that) {
196
    if (that == null)
187
    if (that == null)
197
      return false;
188
      return false;
198
    if (that instanceof StatisticsUser)
189
    if (that instanceof StatisticsUser)
Line 227... Line 218...
227
    }
218
    }
228
 
219
 
229
    int lastComparison = 0;
220
    int lastComparison = 0;
230
    StatisticsUser typedOther = (StatisticsUser)other;
221
    StatisticsUser typedOther = (StatisticsUser)other;
231
 
222
 
232
    lastComparison = Boolean.valueOf(isSetUsername()).compareTo(isSetUsername());
223
    lastComparison = Boolean.valueOf(isSetUsername()).compareTo(typedOther.isSetUsername());
233
    if (lastComparison != 0) {
224
    if (lastComparison != 0) {
234
      return lastComparison;
225
      return lastComparison;
235
    }
226
    }
-
 
227
    if (isSetUsername()) {
236
    lastComparison = TBaseHelper.compareTo(username, typedOther.username);
228
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, typedOther.username);
237
    if (lastComparison != 0) {
229
      if (lastComparison != 0) {
238
      return lastComparison;
230
        return lastComparison;
-
 
231
      }
239
    }
232
    }
240
    return 0;
233
    return 0;
241
  }
234
  }
242
 
235
 
-
 
236
  public _Fields fieldForId(int fieldId) {
-
 
237
    return _Fields.findByThriftId(fieldId);
-
 
238
  }
-
 
239
 
243
  public void read(TProtocol iprot) throws TException {
240
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
244
    TField field;
241
    org.apache.thrift.protocol.TField field;
245
    iprot.readStructBegin();
242
    iprot.readStructBegin();
246
    while (true)
243
    while (true)
247
    {
244
    {
248
      field = iprot.readFieldBegin();
245
      field = iprot.readFieldBegin();
249
      if (field.type == TType.STOP) { 
246
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
250
        break;
247
        break;
251
      }
248
      }
252
      _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
253
      if (fieldId == null) {
-
 
254
        TProtocolUtil.skip(iprot, field.type);
-
 
255
      } else {
-
 
256
        switch (fieldId) {
249
      switch (field.id) {
257
          case USERNAME:
250
        case 1: // USERNAME
258
            if (field.type == TType.STRING) {
251
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
259
              this.username = iprot.readString();
252
            this.username = iprot.readString();
260
            } else { 
253
          } else { 
261
              TProtocolUtil.skip(iprot, field.type);
254
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
262
            }
255
          }
263
            break;
256
          break;
264
        }
257
        default:
265
        iprot.readFieldEnd();
258
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
266
      }
259
      }
-
 
260
      iprot.readFieldEnd();
267
    }
261
    }
268
    iprot.readStructEnd();
262
    iprot.readStructEnd();
269
    validate();
263
    validate();
270
  }
264
  }
271
 
265
 
272
  public void write(TProtocol oprot) throws TException {
266
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
273
    validate();
267
    validate();
274
 
268
 
275
    oprot.writeStructBegin(STRUCT_DESC);
269
    oprot.writeStructBegin(STRUCT_DESC);
276
    if (this.username != null) {
270
    if (this.username != null) {
277
      oprot.writeFieldBegin(USERNAME_FIELD_DESC);
271
      oprot.writeFieldBegin(USERNAME_FIELD_DESC);
Line 296... Line 290...
296
    first = false;
290
    first = false;
297
    sb.append(")");
291
    sb.append(")");
298
    return sb.toString();
292
    return sb.toString();
299
  }
293
  }
300
 
294
 
301
  public void validate() throws TException {
295
  public void validate() throws org.apache.thrift.TException {
302
    // check for required fields
296
    // check for required fields
303
  }
297
  }
304
 
298
 
-
 
299
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-
 
300
    try {
-
 
301
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-
 
302
    } catch (org.apache.thrift.TException te) {
-
 
303
      throw new java.io.IOException(te);
-
 
304
    }
-
 
305
  }
-
 
306
 
-
 
307
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-
 
308
    try {
-
 
309
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-
 
310
    } catch (org.apache.thrift.TException te) {
-
 
311
      throw new java.io.IOException(te);
-
 
312
    }
-
 
313
  }
-
 
314
 
305
}
315
}
306
 
316