Subversion Repositories SmartDukaan

Rev

Rev 1611 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1611 ankur.sing 1
/**
3430 rajveer 2
 * Autogenerated by Thrift Compiler (0.7.0)
1611 ankur.sing 3
 *
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
 */
6
package in.shop2020.utils;
7
 
8
import java.util.List;
9
import java.util.ArrayList;
10
import java.util.Map;
11
import java.util.HashMap;
12
import java.util.EnumMap;
13
import java.util.Set;
14
import java.util.HashSet;
15
import java.util.EnumSet;
16
import java.util.Collections;
17
import java.util.BitSet;
3430 rajveer 18
import java.nio.ByteBuffer;
1611 ankur.sing 19
import java.util.Arrays;
20
import org.slf4j.Logger;
21
import org.slf4j.LoggerFactory;
22
 
3430 rajveer 23
public class StatisticsUser implements org.apache.thrift.TBase<StatisticsUser, StatisticsUser._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("StatisticsUser");
1611 ankur.sing 25
 
3430 rajveer 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);
1611 ankur.sing 27
 
3430 rajveer 28
  private String username; // required
1611 ankur.sing 29
 
30
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 31
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1611 ankur.sing 32
    USERNAME((short)1, "username");
33
 
34
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
35
 
36
    static {
37
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
38
        byName.put(field.getFieldName(), field);
39
      }
40
    }
41
 
42
    /**
43
     * Find the _Fields constant that matches fieldId, or null if its not found.
44
     */
45
    public static _Fields findByThriftId(int fieldId) {
3430 rajveer 46
      switch(fieldId) {
47
        case 1: // USERNAME
48
          return USERNAME;
49
        default:
50
          return null;
51
      }
1611 ankur.sing 52
    }
53
 
54
    /**
55
     * Find the _Fields constant that matches fieldId, throwing an exception
56
     * if it is not found.
57
     */
58
    public static _Fields findByThriftIdOrThrow(int fieldId) {
59
      _Fields fields = findByThriftId(fieldId);
60
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
61
      return fields;
62
    }
63
 
64
    /**
65
     * Find the _Fields constant that matches name, or null if its not found.
66
     */
67
    public static _Fields findByName(String name) {
68
      return byName.get(name);
69
    }
70
 
71
    private final short _thriftId;
72
    private final String _fieldName;
73
 
74
    _Fields(short thriftId, String fieldName) {
75
      _thriftId = thriftId;
76
      _fieldName = fieldName;
77
    }
78
 
79
    public short getThriftFieldId() {
80
      return _thriftId;
81
    }
82
 
83
    public String getFieldName() {
84
      return _fieldName;
85
    }
86
  }
87
 
88
  // isset id assignments
89
 
3430 rajveer 90
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1611 ankur.sing 91
  static {
3430 rajveer 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
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(StatisticsUser.class, metaDataMap);
1611 ankur.sing 97
  }
98
 
99
  public StatisticsUser() {
100
  }
101
 
102
  public StatisticsUser(
103
    String username)
104
  {
105
    this();
106
    this.username = username;
107
  }
108
 
109
  /**
110
   * Performs a deep copy on <i>other</i>.
111
   */
112
  public StatisticsUser(StatisticsUser other) {
113
    if (other.isSetUsername()) {
114
      this.username = other.username;
115
    }
116
  }
117
 
118
  public StatisticsUser deepCopy() {
119
    return new StatisticsUser(this);
120
  }
121
 
3430 rajveer 122
  @Override
123
  public void clear() {
124
    this.username = null;
1611 ankur.sing 125
  }
126
 
127
  public String getUsername() {
128
    return this.username;
129
  }
130
 
3430 rajveer 131
  public void setUsername(String username) {
1611 ankur.sing 132
    this.username = username;
133
  }
134
 
135
  public void unsetUsername() {
136
    this.username = null;
137
  }
138
 
3430 rajveer 139
  /** Returns true if field username is set (has been assigned a value) and false otherwise */
1611 ankur.sing 140
  public boolean isSetUsername() {
141
    return this.username != null;
142
  }
143
 
144
  public void setUsernameIsSet(boolean value) {
145
    if (!value) {
146
      this.username = null;
147
    }
148
  }
149
 
150
  public void setFieldValue(_Fields field, Object value) {
151
    switch (field) {
152
    case USERNAME:
153
      if (value == null) {
154
        unsetUsername();
155
      } else {
156
        setUsername((String)value);
157
      }
158
      break;
159
 
160
    }
161
  }
162
 
163
  public Object getFieldValue(_Fields field) {
164
    switch (field) {
165
    case USERNAME:
166
      return getUsername();
167
 
168
    }
169
    throw new IllegalStateException();
170
  }
171
 
3430 rajveer 172
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
173
  public boolean isSet(_Fields field) {
174
    if (field == null) {
175
      throw new IllegalArgumentException();
176
    }
1611 ankur.sing 177
 
178
    switch (field) {
179
    case USERNAME:
180
      return isSetUsername();
181
    }
182
    throw new IllegalStateException();
183
  }
184
 
185
  @Override
186
  public boolean equals(Object that) {
187
    if (that == null)
188
      return false;
189
    if (that instanceof StatisticsUser)
190
      return this.equals((StatisticsUser)that);
191
    return false;
192
  }
193
 
194
  public boolean equals(StatisticsUser that) {
195
    if (that == null)
196
      return false;
197
 
198
    boolean this_present_username = true && this.isSetUsername();
199
    boolean that_present_username = true && that.isSetUsername();
200
    if (this_present_username || that_present_username) {
201
      if (!(this_present_username && that_present_username))
202
        return false;
203
      if (!this.username.equals(that.username))
204
        return false;
205
    }
206
 
207
    return true;
208
  }
209
 
210
  @Override
211
  public int hashCode() {
212
    return 0;
213
  }
214
 
215
  public int compareTo(StatisticsUser other) {
216
    if (!getClass().equals(other.getClass())) {
217
      return getClass().getName().compareTo(other.getClass().getName());
218
    }
219
 
220
    int lastComparison = 0;
221
    StatisticsUser typedOther = (StatisticsUser)other;
222
 
3430 rajveer 223
    lastComparison = Boolean.valueOf(isSetUsername()).compareTo(typedOther.isSetUsername());
1611 ankur.sing 224
    if (lastComparison != 0) {
225
      return lastComparison;
226
    }
3430 rajveer 227
    if (isSetUsername()) {
228
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, typedOther.username);
229
      if (lastComparison != 0) {
230
        return lastComparison;
231
      }
1611 ankur.sing 232
    }
233
    return 0;
234
  }
235
 
3430 rajveer 236
  public _Fields fieldForId(int fieldId) {
237
    return _Fields.findByThriftId(fieldId);
238
  }
239
 
240
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
241
    org.apache.thrift.protocol.TField field;
1611 ankur.sing 242
    iprot.readStructBegin();
243
    while (true)
244
    {
245
      field = iprot.readFieldBegin();
3430 rajveer 246
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1611 ankur.sing 247
        break;
248
      }
3430 rajveer 249
      switch (field.id) {
250
        case 1: // USERNAME
251
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
252
            this.username = iprot.readString();
253
          } else { 
254
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
255
          }
256
          break;
257
        default:
258
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1611 ankur.sing 259
      }
3430 rajveer 260
      iprot.readFieldEnd();
1611 ankur.sing 261
    }
262
    iprot.readStructEnd();
263
    validate();
264
  }
265
 
3430 rajveer 266
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1611 ankur.sing 267
    validate();
268
 
269
    oprot.writeStructBegin(STRUCT_DESC);
270
    if (this.username != null) {
271
      oprot.writeFieldBegin(USERNAME_FIELD_DESC);
272
      oprot.writeString(this.username);
273
      oprot.writeFieldEnd();
274
    }
275
    oprot.writeFieldStop();
276
    oprot.writeStructEnd();
277
  }
278
 
279
  @Override
280
  public String toString() {
281
    StringBuilder sb = new StringBuilder("StatisticsUser(");
282
    boolean first = true;
283
 
284
    sb.append("username:");
285
    if (this.username == null) {
286
      sb.append("null");
287
    } else {
288
      sb.append(this.username);
289
    }
290
    first = false;
291
    sb.append(")");
292
    return sb.toString();
293
  }
294
 
3430 rajveer 295
  public void validate() throws org.apache.thrift.TException {
1611 ankur.sing 296
    // check for required fields
297
  }
298
 
3430 rajveer 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
 
1611 ankur.sing 315
}
316