Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
123 ashish 1
/**
3430 rajveer 2
 * Autogenerated by Thrift Compiler (0.7.0)
123 ashish 3
 *
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
 */
6
package in.shop2020.model.v1.user;
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;
123 ashish 19
import java.util.Arrays;
20
import org.slf4j.Logger;
21
import org.slf4j.LoggerFactory;
22
 
23
/**
24
 * All the social handles
25
 */
3430 rajveer 26
public class SocialHandles implements org.apache.thrift.TBase<SocialHandles, SocialHandles._Fields>, java.io.Serializable, Cloneable {
27
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SocialHandles");
123 ashish 28
 
3430 rajveer 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);
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);
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);
123 ashish 32
 
3430 rajveer 33
  private String facebook; // required
34
  private String opensocial; // required
35
  private String twitter; // required
123 ashish 36
 
37
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 38
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
123 ashish 39
    FACEBOOK((short)1, "facebook"),
40
    OPENSOCIAL((short)2, "opensocial"),
41
    TWITTER((short)3, "twitter");
42
 
43
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
44
 
45
    static {
46
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
47
        byName.put(field.getFieldName(), field);
48
      }
49
    }
50
 
51
    /**
52
     * Find the _Fields constant that matches fieldId, or null if its not found.
53
     */
54
    public static _Fields findByThriftId(int fieldId) {
3430 rajveer 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
      }
123 ashish 65
    }
66
 
67
    /**
68
     * Find the _Fields constant that matches fieldId, throwing an exception
69
     * if it is not found.
70
     */
71
    public static _Fields findByThriftIdOrThrow(int fieldId) {
72
      _Fields fields = findByThriftId(fieldId);
73
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
74
      return fields;
75
    }
76
 
77
    /**
78
     * Find the _Fields constant that matches name, or null if its not found.
79
     */
80
    public static _Fields findByName(String name) {
81
      return byName.get(name);
82
    }
83
 
84
    private final short _thriftId;
85
    private final String _fieldName;
86
 
87
    _Fields(short thriftId, String fieldName) {
88
      _thriftId = thriftId;
89
      _fieldName = fieldName;
90
    }
91
 
92
    public short getThriftFieldId() {
93
      return _thriftId;
94
    }
95
 
96
    public String getFieldName() {
97
      return _fieldName;
98
    }
99
  }
100
 
101
  // isset id assignments
102
 
3430 rajveer 103
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
123 ashish 104
  static {
3430 rajveer 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);
113
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SocialHandles.class, metaDataMap);
123 ashish 114
  }
115
 
116
  public SocialHandles() {
117
  }
118
 
119
  public SocialHandles(
120
    String facebook,
121
    String opensocial,
122
    String twitter)
123
  {
124
    this();
125
    this.facebook = facebook;
126
    this.opensocial = opensocial;
127
    this.twitter = twitter;
128
  }
129
 
130
  /**
131
   * Performs a deep copy on <i>other</i>.
132
   */
133
  public SocialHandles(SocialHandles other) {
134
    if (other.isSetFacebook()) {
135
      this.facebook = other.facebook;
136
    }
137
    if (other.isSetOpensocial()) {
138
      this.opensocial = other.opensocial;
139
    }
140
    if (other.isSetTwitter()) {
141
      this.twitter = other.twitter;
142
    }
143
  }
144
 
145
  public SocialHandles deepCopy() {
146
    return new SocialHandles(this);
147
  }
148
 
3430 rajveer 149
  @Override
150
  public void clear() {
151
    this.facebook = null;
152
    this.opensocial = null;
153
    this.twitter = null;
123 ashish 154
  }
155
 
156
  public String getFacebook() {
157
    return this.facebook;
158
  }
159
 
3430 rajveer 160
  public void setFacebook(String facebook) {
123 ashish 161
    this.facebook = facebook;
162
  }
163
 
164
  public void unsetFacebook() {
165
    this.facebook = null;
166
  }
167
 
3430 rajveer 168
  /** Returns true if field facebook is set (has been assigned a value) and false otherwise */
123 ashish 169
  public boolean isSetFacebook() {
170
    return this.facebook != null;
171
  }
172
 
173
  public void setFacebookIsSet(boolean value) {
174
    if (!value) {
175
      this.facebook = null;
176
    }
177
  }
178
 
179
  public String getOpensocial() {
180
    return this.opensocial;
181
  }
182
 
3430 rajveer 183
  public void setOpensocial(String opensocial) {
123 ashish 184
    this.opensocial = opensocial;
185
  }
186
 
187
  public void unsetOpensocial() {
188
    this.opensocial = null;
189
  }
190
 
3430 rajveer 191
  /** Returns true if field opensocial is set (has been assigned a value) and false otherwise */
123 ashish 192
  public boolean isSetOpensocial() {
193
    return this.opensocial != null;
194
  }
195
 
196
  public void setOpensocialIsSet(boolean value) {
197
    if (!value) {
198
      this.opensocial = null;
199
    }
200
  }
201
 
202
  public String getTwitter() {
203
    return this.twitter;
204
  }
205
 
3430 rajveer 206
  public void setTwitter(String twitter) {
123 ashish 207
    this.twitter = twitter;
208
  }
209
 
210
  public void unsetTwitter() {
211
    this.twitter = null;
212
  }
213
 
3430 rajveer 214
  /** Returns true if field twitter is set (has been assigned a value) and false otherwise */
123 ashish 215
  public boolean isSetTwitter() {
216
    return this.twitter != null;
217
  }
218
 
219
  public void setTwitterIsSet(boolean value) {
220
    if (!value) {
221
      this.twitter = null;
222
    }
223
  }
224
 
225
  public void setFieldValue(_Fields field, Object value) {
226
    switch (field) {
227
    case FACEBOOK:
228
      if (value == null) {
229
        unsetFacebook();
230
      } else {
231
        setFacebook((String)value);
232
      }
233
      break;
234
 
235
    case OPENSOCIAL:
236
      if (value == null) {
237
        unsetOpensocial();
238
      } else {
239
        setOpensocial((String)value);
240
      }
241
      break;
242
 
243
    case TWITTER:
244
      if (value == null) {
245
        unsetTwitter();
246
      } else {
247
        setTwitter((String)value);
248
      }
249
      break;
250
 
251
    }
252
  }
253
 
254
  public Object getFieldValue(_Fields field) {
255
    switch (field) {
256
    case FACEBOOK:
257
      return getFacebook();
258
 
259
    case OPENSOCIAL:
260
      return getOpensocial();
261
 
262
    case TWITTER:
263
      return getTwitter();
264
 
265
    }
266
    throw new IllegalStateException();
267
  }
268
 
3430 rajveer 269
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
270
  public boolean isSet(_Fields field) {
271
    if (field == null) {
272
      throw new IllegalArgumentException();
273
    }
123 ashish 274
 
275
    switch (field) {
276
    case FACEBOOK:
277
      return isSetFacebook();
278
    case OPENSOCIAL:
279
      return isSetOpensocial();
280
    case TWITTER:
281
      return isSetTwitter();
282
    }
283
    throw new IllegalStateException();
284
  }
285
 
286
  @Override
287
  public boolean equals(Object that) {
288
    if (that == null)
289
      return false;
290
    if (that instanceof SocialHandles)
291
      return this.equals((SocialHandles)that);
292
    return false;
293
  }
294
 
295
  public boolean equals(SocialHandles that) {
296
    if (that == null)
297
      return false;
298
 
299
    boolean this_present_facebook = true && this.isSetFacebook();
300
    boolean that_present_facebook = true && that.isSetFacebook();
301
    if (this_present_facebook || that_present_facebook) {
302
      if (!(this_present_facebook && that_present_facebook))
303
        return false;
304
      if (!this.facebook.equals(that.facebook))
305
        return false;
306
    }
307
 
308
    boolean this_present_opensocial = true && this.isSetOpensocial();
309
    boolean that_present_opensocial = true && that.isSetOpensocial();
310
    if (this_present_opensocial || that_present_opensocial) {
311
      if (!(this_present_opensocial && that_present_opensocial))
312
        return false;
313
      if (!this.opensocial.equals(that.opensocial))
314
        return false;
315
    }
316
 
317
    boolean this_present_twitter = true && this.isSetTwitter();
318
    boolean that_present_twitter = true && that.isSetTwitter();
319
    if (this_present_twitter || that_present_twitter) {
320
      if (!(this_present_twitter && that_present_twitter))
321
        return false;
322
      if (!this.twitter.equals(that.twitter))
323
        return false;
324
    }
325
 
326
    return true;
327
  }
328
 
329
  @Override
330
  public int hashCode() {
331
    return 0;
332
  }
333
 
334
  public int compareTo(SocialHandles other) {
335
    if (!getClass().equals(other.getClass())) {
336
      return getClass().getName().compareTo(other.getClass().getName());
337
    }
338
 
339
    int lastComparison = 0;
340
    SocialHandles typedOther = (SocialHandles)other;
341
 
3430 rajveer 342
    lastComparison = Boolean.valueOf(isSetFacebook()).compareTo(typedOther.isSetFacebook());
123 ashish 343
    if (lastComparison != 0) {
344
      return lastComparison;
345
    }
3430 rajveer 346
    if (isSetFacebook()) {
347
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.facebook, typedOther.facebook);
348
      if (lastComparison != 0) {
349
        return lastComparison;
350
      }
123 ashish 351
    }
3430 rajveer 352
    lastComparison = Boolean.valueOf(isSetOpensocial()).compareTo(typedOther.isSetOpensocial());
123 ashish 353
    if (lastComparison != 0) {
354
      return lastComparison;
355
    }
3430 rajveer 356
    if (isSetOpensocial()) {
357
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.opensocial, typedOther.opensocial);
358
      if (lastComparison != 0) {
359
        return lastComparison;
360
      }
123 ashish 361
    }
3430 rajveer 362
    lastComparison = Boolean.valueOf(isSetTwitter()).compareTo(typedOther.isSetTwitter());
123 ashish 363
    if (lastComparison != 0) {
364
      return lastComparison;
365
    }
3430 rajveer 366
    if (isSetTwitter()) {
367
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.twitter, typedOther.twitter);
368
      if (lastComparison != 0) {
369
        return lastComparison;
370
      }
123 ashish 371
    }
372
    return 0;
373
  }
374
 
3430 rajveer 375
  public _Fields fieldForId(int fieldId) {
376
    return _Fields.findByThriftId(fieldId);
377
  }
378
 
379
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
380
    org.apache.thrift.protocol.TField field;
123 ashish 381
    iprot.readStructBegin();
382
    while (true)
383
    {
384
      field = iprot.readFieldBegin();
3430 rajveer 385
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
123 ashish 386
        break;
387
      }
3430 rajveer 388
      switch (field.id) {
389
        case 1: // FACEBOOK
390
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
391
            this.facebook = iprot.readString();
392
          } else { 
393
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
394
          }
395
          break;
396
        case 2: // OPENSOCIAL
397
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
398
            this.opensocial = iprot.readString();
399
          } else { 
400
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
401
          }
402
          break;
403
        case 3: // TWITTER
404
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
405
            this.twitter = iprot.readString();
406
          } else { 
407
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
408
          }
409
          break;
410
        default:
411
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
123 ashish 412
      }
3430 rajveer 413
      iprot.readFieldEnd();
123 ashish 414
    }
415
    iprot.readStructEnd();
416
    validate();
417
  }
418
 
3430 rajveer 419
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
123 ashish 420
    validate();
421
 
422
    oprot.writeStructBegin(STRUCT_DESC);
423
    if (this.facebook != null) {
424
      oprot.writeFieldBegin(FACEBOOK_FIELD_DESC);
425
      oprot.writeString(this.facebook);
426
      oprot.writeFieldEnd();
427
    }
428
    if (this.opensocial != null) {
429
      oprot.writeFieldBegin(OPENSOCIAL_FIELD_DESC);
430
      oprot.writeString(this.opensocial);
431
      oprot.writeFieldEnd();
432
    }
433
    if (this.twitter != null) {
434
      oprot.writeFieldBegin(TWITTER_FIELD_DESC);
435
      oprot.writeString(this.twitter);
436
      oprot.writeFieldEnd();
437
    }
438
    oprot.writeFieldStop();
439
    oprot.writeStructEnd();
440
  }
441
 
442
  @Override
443
  public String toString() {
444
    StringBuilder sb = new StringBuilder("SocialHandles(");
445
    boolean first = true;
446
 
447
    sb.append("facebook:");
448
    if (this.facebook == null) {
449
      sb.append("null");
450
    } else {
451
      sb.append(this.facebook);
452
    }
453
    first = false;
454
    if (!first) sb.append(", ");
455
    sb.append("opensocial:");
456
    if (this.opensocial == null) {
457
      sb.append("null");
458
    } else {
459
      sb.append(this.opensocial);
460
    }
461
    first = false;
462
    if (!first) sb.append(", ");
463
    sb.append("twitter:");
464
    if (this.twitter == null) {
465
      sb.append("null");
466
    } else {
467
      sb.append(this.twitter);
468
    }
469
    first = false;
470
    sb.append(")");
471
    return sb.toString();
472
  }
473
 
3430 rajveer 474
  public void validate() throws org.apache.thrift.TException {
123 ashish 475
    // check for required fields
476
  }
477
 
3430 rajveer 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
 
123 ashish 494
}
495