Subversion Repositories SmartDukaan

Rev

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

Rev 1013 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.model.v1.user;
6
package in.shop2020.model.v1.user;
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
/**
23
/**
27
 * All the social handles
24
 * All the social handles
28
 */
25
 */
29
public class SocialHandles implements TBase<SocialHandles._Fields>, java.io.Serializable, Cloneable, Comparable<SocialHandles> {
26
public class SocialHandles implements org.apache.thrift.TBase<SocialHandles, SocialHandles._Fields>, java.io.Serializable, Cloneable {
30
  private static final TStruct STRUCT_DESC = new TStruct("SocialHandles");
27
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SocialHandles");
31
 
28
 
32
  private static final TField FACEBOOK_FIELD_DESC = new TField("facebook", TType.STRING, (short)1);
29
  private static final org.apache.thrift.protocol.TField FACEBOOK_FIELD_DESC = new org.apache.thrift.protocol.TField("facebook", org.apache.thrift.protocol.TType.STRING, (short)1);
33
  private static final TField OPENSOCIAL_FIELD_DESC = new TField("opensocial", TType.STRING, (short)2);
30
  private static final org.apache.thrift.protocol.TField OPENSOCIAL_FIELD_DESC = new org.apache.thrift.protocol.TField("opensocial", org.apache.thrift.protocol.TType.STRING, (short)2);
34
  private static final TField TWITTER_FIELD_DESC = new TField("twitter", TType.STRING, (short)3);
31
  private static final org.apache.thrift.protocol.TField TWITTER_FIELD_DESC = new org.apache.thrift.protocol.TField("twitter", org.apache.thrift.protocol.TType.STRING, (short)3);
35
 
32
 
36
  private String facebook;
33
  private String facebook; // required
37
  private String opensocial;
34
  private String opensocial; // required
38
  private String twitter;
35
  private String twitter; // required
39
 
36
 
40
  /** 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. */
41
  public enum _Fields implements TFieldIdEnum {
38
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
42
    FACEBOOK((short)1, "facebook"),
39
    FACEBOOK((short)1, "facebook"),
43
    OPENSOCIAL((short)2, "opensocial"),
40
    OPENSOCIAL((short)2, "opensocial"),
44
    TWITTER((short)3, "twitter");
41
    TWITTER((short)3, "twitter");
45
 
42
 
46
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
-
 
47
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
43
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
48
 
44
 
49
    static {
45
    static {
50
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
46
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
51
        byId.put((int)field._thriftId, field);
-
 
52
        byName.put(field.getFieldName(), field);
47
        byName.put(field.getFieldName(), field);
53
      }
48
      }
54
    }
49
    }
55
 
50
 
56
    /**
51
    /**
57
     * Find the _Fields constant that matches fieldId, or null if its not found.
52
     * Find the _Fields constant that matches fieldId, or null if its not found.
58
     */
53
     */
59
    public static _Fields findByThriftId(int fieldId) {
54
    public static _Fields findByThriftId(int fieldId) {
60
      return byId.get(fieldId);
55
      switch(fieldId) {
-
 
56
        case 1: // FACEBOOK
-
 
57
          return FACEBOOK;
-
 
58
        case 2: // OPENSOCIAL
-
 
59
          return OPENSOCIAL;
-
 
60
        case 3: // TWITTER
-
 
61
          return TWITTER;
-
 
62
        default:
-
 
63
          return null;
-
 
64
      }
61
    }
65
    }
62
 
66
 
63
    /**
67
    /**
64
     * Find the _Fields constant that matches fieldId, throwing an exception
68
     * Find the _Fields constant that matches fieldId, throwing an exception
65
     * if it is not found.
69
     * if it is not found.
Line 94... Line 98...
94
    }
98
    }
95
  }
99
  }
96
 
100
 
97
  // isset id assignments
101
  // isset id assignments
98
 
102
 
99
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
103
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
100
    put(_Fields.FACEBOOK, new FieldMetaData("facebook", TFieldRequirementType.DEFAULT, 
-
 
101
        new FieldValueMetaData(TType.STRING)));
-
 
102
    put(_Fields.OPENSOCIAL, new FieldMetaData("opensocial", TFieldRequirementType.DEFAULT, 
-
 
103
        new FieldValueMetaData(TType.STRING)));
-
 
104
    put(_Fields.TWITTER, new FieldMetaData("twitter", TFieldRequirementType.DEFAULT, 
-
 
105
        new FieldValueMetaData(TType.STRING)));
-
 
106
  }});
-
 
107
 
-
 
108
  static {
104
  static {
-
 
105
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
-
 
106
    tmpMap.put(_Fields.FACEBOOK, new org.apache.thrift.meta_data.FieldMetaData("facebook", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
107
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-
 
108
    tmpMap.put(_Fields.OPENSOCIAL, new org.apache.thrift.meta_data.FieldMetaData("opensocial", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
109
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-
 
110
    tmpMap.put(_Fields.TWITTER, new org.apache.thrift.meta_data.FieldMetaData("twitter", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
111
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-
 
112
    metaDataMap = Collections.unmodifiableMap(tmpMap);
109
    FieldMetaData.addStructMetaDataMap(SocialHandles.class, metaDataMap);
113
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SocialHandles.class, metaDataMap);
110
  }
114
  }
111
 
115
 
112
  public SocialHandles() {
116
  public SocialHandles() {
113
  }
117
  }
114
 
118
 
Line 140... Line 144...
140
 
144
 
141
  public SocialHandles deepCopy() {
145
  public SocialHandles deepCopy() {
142
    return new SocialHandles(this);
146
    return new SocialHandles(this);
143
  }
147
  }
144
 
148
 
145
  @Deprecated
149
  @Override
146
  public SocialHandles clone() {
150
  public void clear() {
-
 
151
    this.facebook = null;
147
    return new SocialHandles(this);
152
    this.opensocial = null;
-
 
153
    this.twitter = null;
148
  }
154
  }
149
 
155
 
150
  public String getFacebook() {
156
  public String getFacebook() {
151
    return this.facebook;
157
    return this.facebook;
152
  }
158
  }
153
 
159
 
154
  public SocialHandles setFacebook(String facebook) {
160
  public void setFacebook(String facebook) {
155
    this.facebook = facebook;
161
    this.facebook = facebook;
156
    return this;
-
 
157
  }
162
  }
158
 
163
 
159
  public void unsetFacebook() {
164
  public void unsetFacebook() {
160
    this.facebook = null;
165
    this.facebook = null;
161
  }
166
  }
162
 
167
 
163
  /** Returns true if field facebook is set (has been asigned a value) and false otherwise */
168
  /** Returns true if field facebook is set (has been assigned a value) and false otherwise */
164
  public boolean isSetFacebook() {
169
  public boolean isSetFacebook() {
165
    return this.facebook != null;
170
    return this.facebook != null;
166
  }
171
  }
167
 
172
 
168
  public void setFacebookIsSet(boolean value) {
173
  public void setFacebookIsSet(boolean value) {
Line 173... Line 178...
173
 
178
 
174
  public String getOpensocial() {
179
  public String getOpensocial() {
175
    return this.opensocial;
180
    return this.opensocial;
176
  }
181
  }
177
 
182
 
178
  public SocialHandles setOpensocial(String opensocial) {
183
  public void setOpensocial(String opensocial) {
179
    this.opensocial = opensocial;
184
    this.opensocial = opensocial;
180
    return this;
-
 
181
  }
185
  }
182
 
186
 
183
  public void unsetOpensocial() {
187
  public void unsetOpensocial() {
184
    this.opensocial = null;
188
    this.opensocial = null;
185
  }
189
  }
186
 
190
 
187
  /** Returns true if field opensocial is set (has been asigned a value) and false otherwise */
191
  /** Returns true if field opensocial is set (has been assigned a value) and false otherwise */
188
  public boolean isSetOpensocial() {
192
  public boolean isSetOpensocial() {
189
    return this.opensocial != null;
193
    return this.opensocial != null;
190
  }
194
  }
191
 
195
 
192
  public void setOpensocialIsSet(boolean value) {
196
  public void setOpensocialIsSet(boolean value) {
Line 197... Line 201...
197
 
201
 
198
  public String getTwitter() {
202
  public String getTwitter() {
199
    return this.twitter;
203
    return this.twitter;
200
  }
204
  }
201
 
205
 
202
  public SocialHandles setTwitter(String twitter) {
206
  public void setTwitter(String twitter) {
203
    this.twitter = twitter;
207
    this.twitter = twitter;
204
    return this;
-
 
205
  }
208
  }
206
 
209
 
207
  public void unsetTwitter() {
210
  public void unsetTwitter() {
208
    this.twitter = null;
211
    this.twitter = null;
209
  }
212
  }
210
 
213
 
211
  /** Returns true if field twitter is set (has been asigned a value) and false otherwise */
214
  /** Returns true if field twitter is set (has been assigned a value) and false otherwise */
212
  public boolean isSetTwitter() {
215
  public boolean isSetTwitter() {
213
    return this.twitter != null;
216
    return this.twitter != null;
214
  }
217
  }
215
 
218
 
216
  public void setTwitterIsSet(boolean value) {
219
  public void setTwitterIsSet(boolean value) {
Line 246... Line 249...
246
      break;
249
      break;
247
 
250
 
248
    }
251
    }
249
  }
252
  }
250
 
253
 
251
  public void setFieldValue(int fieldID, Object value) {
-
 
252
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
253
  }
-
 
254
 
-
 
255
  public Object getFieldValue(_Fields field) {
254
  public Object getFieldValue(_Fields field) {
256
    switch (field) {
255
    switch (field) {
257
    case FACEBOOK:
256
    case FACEBOOK:
258
      return getFacebook();
257
      return getFacebook();
259
 
258
 
Line 265... Line 264...
265
 
264
 
266
    }
265
    }
267
    throw new IllegalStateException();
266
    throw new IllegalStateException();
268
  }
267
  }
269
 
268
 
270
  public Object getFieldValue(int fieldId) {
-
 
271
    return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
272
  }
-
 
273
 
-
 
274
  /** 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 */
275
  public boolean isSet(_Fields field) {
270
  public boolean isSet(_Fields field) {
-
 
271
    if (field == null) {
-
 
272
      throw new IllegalArgumentException();
-
 
273
    }
-
 
274
 
276
    switch (field) {
275
    switch (field) {
277
    case FACEBOOK:
276
    case FACEBOOK:
278
      return isSetFacebook();
277
      return isSetFacebook();
279
    case OPENSOCIAL:
278
    case OPENSOCIAL:
280
      return isSetOpensocial();
279
      return isSetOpensocial();
Line 282... Line 281...
282
      return isSetTwitter();
281
      return isSetTwitter();
283
    }
282
    }
284
    throw new IllegalStateException();
283
    throw new IllegalStateException();
285
  }
284
  }
286
 
285
 
287
  public boolean isSet(int fieldID) {
-
 
288
    return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
289
  }
-
 
290
 
-
 
291
  @Override
286
  @Override
292
  public boolean equals(Object that) {
287
  public boolean equals(Object that) {
293
    if (that == null)
288
    if (that == null)
294
      return false;
289
      return false;
295
    if (that instanceof SocialHandles)
290
    if (that instanceof SocialHandles)
Line 342... Line 337...
342
    }
337
    }
343
 
338
 
344
    int lastComparison = 0;
339
    int lastComparison = 0;
345
    SocialHandles typedOther = (SocialHandles)other;
340
    SocialHandles typedOther = (SocialHandles)other;
346
 
341
 
347
    lastComparison = Boolean.valueOf(isSetFacebook()).compareTo(isSetFacebook());
342
    lastComparison = Boolean.valueOf(isSetFacebook()).compareTo(typedOther.isSetFacebook());
348
    if (lastComparison != 0) {
343
    if (lastComparison != 0) {
349
      return lastComparison;
344
      return lastComparison;
350
    }
345
    }
-
 
346
    if (isSetFacebook()) {
351
    lastComparison = TBaseHelper.compareTo(facebook, typedOther.facebook);
347
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.facebook, typedOther.facebook);
352
    if (lastComparison != 0) {
348
      if (lastComparison != 0) {
353
      return lastComparison;
349
        return lastComparison;
-
 
350
      }
354
    }
351
    }
355
    lastComparison = Boolean.valueOf(isSetOpensocial()).compareTo(isSetOpensocial());
352
    lastComparison = Boolean.valueOf(isSetOpensocial()).compareTo(typedOther.isSetOpensocial());
356
    if (lastComparison != 0) {
353
    if (lastComparison != 0) {
357
      return lastComparison;
354
      return lastComparison;
358
    }
355
    }
-
 
356
    if (isSetOpensocial()) {
359
    lastComparison = TBaseHelper.compareTo(opensocial, typedOther.opensocial);
357
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.opensocial, typedOther.opensocial);
360
    if (lastComparison != 0) {
358
      if (lastComparison != 0) {
361
      return lastComparison;
359
        return lastComparison;
-
 
360
      }
362
    }
361
    }
363
    lastComparison = Boolean.valueOf(isSetTwitter()).compareTo(isSetTwitter());
362
    lastComparison = Boolean.valueOf(isSetTwitter()).compareTo(typedOther.isSetTwitter());
364
    if (lastComparison != 0) {
363
    if (lastComparison != 0) {
365
      return lastComparison;
364
      return lastComparison;
366
    }
365
    }
-
 
366
    if (isSetTwitter()) {
367
    lastComparison = TBaseHelper.compareTo(twitter, typedOther.twitter);
367
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.twitter, typedOther.twitter);
368
    if (lastComparison != 0) {
368
      if (lastComparison != 0) {
369
      return lastComparison;
369
        return lastComparison;
-
 
370
      }
370
    }
371
    }
371
    return 0;
372
    return 0;
372
  }
373
  }
373
 
374
 
-
 
375
  public _Fields fieldForId(int fieldId) {
-
 
376
    return _Fields.findByThriftId(fieldId);
-
 
377
  }
-
 
378
 
374
  public void read(TProtocol iprot) throws TException {
379
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
375
    TField field;
380
    org.apache.thrift.protocol.TField field;
376
    iprot.readStructBegin();
381
    iprot.readStructBegin();
377
    while (true)
382
    while (true)
378
    {
383
    {
379
      field = iprot.readFieldBegin();
384
      field = iprot.readFieldBegin();
380
      if (field.type == TType.STOP) { 
385
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
381
        break;
386
        break;
382
      }
387
      }
383
      _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
384
      if (fieldId == null) {
-
 
385
        TProtocolUtil.skip(iprot, field.type);
-
 
386
      } else {
-
 
387
        switch (fieldId) {
388
      switch (field.id) {
388
          case FACEBOOK:
389
        case 1: // FACEBOOK
389
            if (field.type == TType.STRING) {
390
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
390
              this.facebook = iprot.readString();
391
            this.facebook = iprot.readString();
391
            } else { 
392
          } else { 
392
              TProtocolUtil.skip(iprot, field.type);
393
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
393
            }
394
          }
394
            break;
395
          break;
395
          case OPENSOCIAL:
396
        case 2: // OPENSOCIAL
396
            if (field.type == TType.STRING) {
397
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
397
              this.opensocial = iprot.readString();
398
            this.opensocial = iprot.readString();
398
            } else { 
399
          } else { 
399
              TProtocolUtil.skip(iprot, field.type);
400
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
400
            }
401
          }
401
            break;
402
          break;
402
          case TWITTER:
403
        case 3: // TWITTER
403
            if (field.type == TType.STRING) {
404
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
404
              this.twitter = iprot.readString();
405
            this.twitter = iprot.readString();
405
            } else { 
406
          } else { 
406
              TProtocolUtil.skip(iprot, field.type);
407
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
407
            }
408
          }
408
            break;
409
          break;
409
        }
410
        default:
410
        iprot.readFieldEnd();
411
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
411
      }
412
      }
-
 
413
      iprot.readFieldEnd();
412
    }
414
    }
413
    iprot.readStructEnd();
415
    iprot.readStructEnd();
414
    validate();
416
    validate();
415
  }
417
  }
416
 
418
 
417
  public void write(TProtocol oprot) throws TException {
419
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
418
    validate();
420
    validate();
419
 
421
 
420
    oprot.writeStructBegin(STRUCT_DESC);
422
    oprot.writeStructBegin(STRUCT_DESC);
421
    if (this.facebook != null) {
423
    if (this.facebook != null) {
422
      oprot.writeFieldBegin(FACEBOOK_FIELD_DESC);
424
      oprot.writeFieldBegin(FACEBOOK_FIELD_DESC);
Line 467... Line 469...
467
    first = false;
469
    first = false;
468
    sb.append(")");
470
    sb.append(")");
469
    return sb.toString();
471
    return sb.toString();
470
  }
472
  }
471
 
473
 
472
  public void validate() throws TException {
474
  public void validate() throws org.apache.thrift.TException {
473
    // check for required fields
475
    // check for required fields
474
  }
476
  }
475
 
477
 
-
 
478
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
-
 
479
    try {
-
 
480
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
-
 
481
    } catch (org.apache.thrift.TException te) {
-
 
482
      throw new java.io.IOException(te);
-
 
483
    }
-
 
484
  }
-
 
485
 
-
 
486
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
-
 
487
    try {
-
 
488
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
-
 
489
    } catch (org.apache.thrift.TException te) {
-
 
490
      throw new java.io.IOException(te);
-
 
491
    }
-
 
492
  }
-
 
493
 
476
}
494
}
477
 
495