Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
1847 vikas 1
/**
3430 rajveer 2
 * Autogenerated by Thrift Compiler (0.7.0)
1847 vikas 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;
1847 vikas 19
import java.util.Arrays;
20
import org.slf4j.Logger;
21
import org.slf4j.LoggerFactory;
22
 
3430 rajveer 23
public class MasterAffiliate implements org.apache.thrift.TBase<MasterAffiliate, MasterAffiliate._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("MasterAffiliate");
1847 vikas 25
 
3430 rajveer 26
  private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I64, (short)1);
27
  private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)2);
28
  private static final org.apache.thrift.protocol.TField ADDED_ON_FIELD_DESC = new org.apache.thrift.protocol.TField("addedOn", org.apache.thrift.protocol.TType.I64, (short)3);
1847 vikas 29
 
3430 rajveer 30
  private long id; // required
31
  private String name; // required
32
  private long addedOn; // required
1847 vikas 33
 
34
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 35
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1847 vikas 36
    ID((short)1, "id"),
1860 vikas 37
    NAME((short)2, "name"),
38
    ADDED_ON((short)3, "addedOn");
1847 vikas 39
 
40
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
41
 
42
    static {
43
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
44
        byName.put(field.getFieldName(), field);
45
      }
46
    }
47
 
48
    /**
49
     * Find the _Fields constant that matches fieldId, or null if its not found.
50
     */
51
    public static _Fields findByThriftId(int fieldId) {
3430 rajveer 52
      switch(fieldId) {
53
        case 1: // ID
54
          return ID;
55
        case 2: // NAME
56
          return NAME;
57
        case 3: // ADDED_ON
58
          return ADDED_ON;
59
        default:
60
          return null;
61
      }
1847 vikas 62
    }
63
 
64
    /**
65
     * Find the _Fields constant that matches fieldId, throwing an exception
66
     * if it is not found.
67
     */
68
    public static _Fields findByThriftIdOrThrow(int fieldId) {
69
      _Fields fields = findByThriftId(fieldId);
70
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
71
      return fields;
72
    }
73
 
74
    /**
75
     * Find the _Fields constant that matches name, or null if its not found.
76
     */
77
    public static _Fields findByName(String name) {
78
      return byName.get(name);
79
    }
80
 
81
    private final short _thriftId;
82
    private final String _fieldName;
83
 
84
    _Fields(short thriftId, String fieldName) {
85
      _thriftId = thriftId;
86
      _fieldName = fieldName;
87
    }
88
 
89
    public short getThriftFieldId() {
90
      return _thriftId;
91
    }
92
 
93
    public String getFieldName() {
94
      return _fieldName;
95
    }
96
  }
97
 
98
  // isset id assignments
99
  private static final int __ID_ISSET_ID = 0;
1860 vikas 100
  private static final int __ADDEDON_ISSET_ID = 1;
101
  private BitSet __isset_bit_vector = new BitSet(2);
1847 vikas 102
 
3430 rajveer 103
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1847 vikas 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.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
107
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
108
    tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
109
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
110
    tmpMap.put(_Fields.ADDED_ON, new org.apache.thrift.meta_data.FieldMetaData("addedOn", org.apache.thrift.TFieldRequirementType.DEFAULT, 
111
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
112
    metaDataMap = Collections.unmodifiableMap(tmpMap);
113
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(MasterAffiliate.class, metaDataMap);
1847 vikas 114
  }
115
 
116
  public MasterAffiliate() {
117
  }
118
 
119
  public MasterAffiliate(
120
    long id,
1860 vikas 121
    String name,
122
    long addedOn)
1847 vikas 123
  {
124
    this();
125
    this.id = id;
126
    setIdIsSet(true);
127
    this.name = name;
1860 vikas 128
    this.addedOn = addedOn;
129
    setAddedOnIsSet(true);
1847 vikas 130
  }
131
 
132
  /**
133
   * Performs a deep copy on <i>other</i>.
134
   */
135
  public MasterAffiliate(MasterAffiliate other) {
136
    __isset_bit_vector.clear();
137
    __isset_bit_vector.or(other.__isset_bit_vector);
138
    this.id = other.id;
139
    if (other.isSetName()) {
140
      this.name = other.name;
141
    }
1860 vikas 142
    this.addedOn = other.addedOn;
1847 vikas 143
  }
144
 
145
  public MasterAffiliate deepCopy() {
146
    return new MasterAffiliate(this);
147
  }
148
 
3430 rajveer 149
  @Override
150
  public void clear() {
151
    setIdIsSet(false);
152
    this.id = 0;
153
    this.name = null;
154
    setAddedOnIsSet(false);
155
    this.addedOn = 0;
1847 vikas 156
  }
157
 
158
  public long getId() {
159
    return this.id;
160
  }
161
 
3430 rajveer 162
  public void setId(long id) {
1847 vikas 163
    this.id = id;
164
    setIdIsSet(true);
165
  }
166
 
167
  public void unsetId() {
168
    __isset_bit_vector.clear(__ID_ISSET_ID);
169
  }
170
 
3430 rajveer 171
  /** Returns true if field id is set (has been assigned a value) and false otherwise */
1847 vikas 172
  public boolean isSetId() {
173
    return __isset_bit_vector.get(__ID_ISSET_ID);
174
  }
175
 
176
  public void setIdIsSet(boolean value) {
177
    __isset_bit_vector.set(__ID_ISSET_ID, value);
178
  }
179
 
180
  public String getName() {
181
    return this.name;
182
  }
183
 
3430 rajveer 184
  public void setName(String name) {
1847 vikas 185
    this.name = name;
186
  }
187
 
188
  public void unsetName() {
189
    this.name = null;
190
  }
191
 
3430 rajveer 192
  /** Returns true if field name is set (has been assigned a value) and false otherwise */
1847 vikas 193
  public boolean isSetName() {
194
    return this.name != null;
195
  }
196
 
197
  public void setNameIsSet(boolean value) {
198
    if (!value) {
199
      this.name = null;
200
    }
201
  }
202
 
1860 vikas 203
  public long getAddedOn() {
204
    return this.addedOn;
205
  }
206
 
3430 rajveer 207
  public void setAddedOn(long addedOn) {
1860 vikas 208
    this.addedOn = addedOn;
209
    setAddedOnIsSet(true);
210
  }
211
 
212
  public void unsetAddedOn() {
213
    __isset_bit_vector.clear(__ADDEDON_ISSET_ID);
214
  }
215
 
3430 rajveer 216
  /** Returns true if field addedOn is set (has been assigned a value) and false otherwise */
1860 vikas 217
  public boolean isSetAddedOn() {
218
    return __isset_bit_vector.get(__ADDEDON_ISSET_ID);
219
  }
220
 
221
  public void setAddedOnIsSet(boolean value) {
222
    __isset_bit_vector.set(__ADDEDON_ISSET_ID, value);
223
  }
224
 
1847 vikas 225
  public void setFieldValue(_Fields field, Object value) {
226
    switch (field) {
227
    case ID:
228
      if (value == null) {
229
        unsetId();
230
      } else {
231
        setId((Long)value);
232
      }
233
      break;
234
 
235
    case NAME:
236
      if (value == null) {
237
        unsetName();
238
      } else {
239
        setName((String)value);
240
      }
241
      break;
242
 
1860 vikas 243
    case ADDED_ON:
244
      if (value == null) {
245
        unsetAddedOn();
246
      } else {
247
        setAddedOn((Long)value);
248
      }
249
      break;
250
 
1847 vikas 251
    }
252
  }
253
 
254
  public Object getFieldValue(_Fields field) {
255
    switch (field) {
256
    case ID:
3430 rajveer 257
      return Long.valueOf(getId());
1847 vikas 258
 
259
    case NAME:
260
      return getName();
261
 
1860 vikas 262
    case ADDED_ON:
3430 rajveer 263
      return Long.valueOf(getAddedOn());
1860 vikas 264
 
1847 vikas 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
    }
1847 vikas 274
 
275
    switch (field) {
276
    case ID:
277
      return isSetId();
278
    case NAME:
279
      return isSetName();
1860 vikas 280
    case ADDED_ON:
281
      return isSetAddedOn();
1847 vikas 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 MasterAffiliate)
291
      return this.equals((MasterAffiliate)that);
292
    return false;
293
  }
294
 
295
  public boolean equals(MasterAffiliate that) {
296
    if (that == null)
297
      return false;
298
 
299
    boolean this_present_id = true;
300
    boolean that_present_id = true;
301
    if (this_present_id || that_present_id) {
302
      if (!(this_present_id && that_present_id))
303
        return false;
304
      if (this.id != that.id)
305
        return false;
306
    }
307
 
308
    boolean this_present_name = true && this.isSetName();
309
    boolean that_present_name = true && that.isSetName();
310
    if (this_present_name || that_present_name) {
311
      if (!(this_present_name && that_present_name))
312
        return false;
313
      if (!this.name.equals(that.name))
314
        return false;
315
    }
316
 
1860 vikas 317
    boolean this_present_addedOn = true;
318
    boolean that_present_addedOn = true;
319
    if (this_present_addedOn || that_present_addedOn) {
320
      if (!(this_present_addedOn && that_present_addedOn))
321
        return false;
322
      if (this.addedOn != that.addedOn)
323
        return false;
324
    }
325
 
1847 vikas 326
    return true;
327
  }
328
 
329
  @Override
330
  public int hashCode() {
331
    return 0;
332
  }
333
 
334
  public int compareTo(MasterAffiliate other) {
335
    if (!getClass().equals(other.getClass())) {
336
      return getClass().getName().compareTo(other.getClass().getName());
337
    }
338
 
339
    int lastComparison = 0;
340
    MasterAffiliate typedOther = (MasterAffiliate)other;
341
 
3430 rajveer 342
    lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
1847 vikas 343
    if (lastComparison != 0) {
344
      return lastComparison;
345
    }
3430 rajveer 346
    if (isSetId()) {
347
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
348
      if (lastComparison != 0) {
349
        return lastComparison;
350
      }
1847 vikas 351
    }
3430 rajveer 352
    lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());
1847 vikas 353
    if (lastComparison != 0) {
354
      return lastComparison;
355
    }
3430 rajveer 356
    if (isSetName()) {
357
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name);
358
      if (lastComparison != 0) {
359
        return lastComparison;
360
      }
1847 vikas 361
    }
3430 rajveer 362
    lastComparison = Boolean.valueOf(isSetAddedOn()).compareTo(typedOther.isSetAddedOn());
1860 vikas 363
    if (lastComparison != 0) {
364
      return lastComparison;
365
    }
3430 rajveer 366
    if (isSetAddedOn()) {
367
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.addedOn, typedOther.addedOn);
368
      if (lastComparison != 0) {
369
        return lastComparison;
370
      }
1860 vikas 371
    }
1847 vikas 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;
1847 vikas 381
    iprot.readStructBegin();
382
    while (true)
383
    {
384
      field = iprot.readFieldBegin();
3430 rajveer 385
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1847 vikas 386
        break;
387
      }
3430 rajveer 388
      switch (field.id) {
389
        case 1: // ID
390
          if (field.type == org.apache.thrift.protocol.TType.I64) {
391
            this.id = iprot.readI64();
392
            setIdIsSet(true);
393
          } else { 
394
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
395
          }
396
          break;
397
        case 2: // NAME
398
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
399
            this.name = iprot.readString();
400
          } else { 
401
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
402
          }
403
          break;
404
        case 3: // ADDED_ON
405
          if (field.type == org.apache.thrift.protocol.TType.I64) {
406
            this.addedOn = iprot.readI64();
407
            setAddedOnIsSet(true);
408
          } else { 
409
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
410
          }
411
          break;
412
        default:
413
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1847 vikas 414
      }
3430 rajveer 415
      iprot.readFieldEnd();
1847 vikas 416
    }
417
    iprot.readStructEnd();
418
    validate();
419
  }
420
 
3430 rajveer 421
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1847 vikas 422
    validate();
423
 
424
    oprot.writeStructBegin(STRUCT_DESC);
425
    oprot.writeFieldBegin(ID_FIELD_DESC);
426
    oprot.writeI64(this.id);
427
    oprot.writeFieldEnd();
428
    if (this.name != null) {
429
      oprot.writeFieldBegin(NAME_FIELD_DESC);
430
      oprot.writeString(this.name);
431
      oprot.writeFieldEnd();
432
    }
1860 vikas 433
    oprot.writeFieldBegin(ADDED_ON_FIELD_DESC);
434
    oprot.writeI64(this.addedOn);
435
    oprot.writeFieldEnd();
1847 vikas 436
    oprot.writeFieldStop();
437
    oprot.writeStructEnd();
438
  }
439
 
440
  @Override
441
  public String toString() {
442
    StringBuilder sb = new StringBuilder("MasterAffiliate(");
443
    boolean first = true;
444
 
445
    sb.append("id:");
446
    sb.append(this.id);
447
    first = false;
448
    if (!first) sb.append(", ");
449
    sb.append("name:");
450
    if (this.name == null) {
451
      sb.append("null");
452
    } else {
453
      sb.append(this.name);
454
    }
455
    first = false;
1860 vikas 456
    if (!first) sb.append(", ");
457
    sb.append("addedOn:");
458
    sb.append(this.addedOn);
459
    first = false;
1847 vikas 460
    sb.append(")");
461
    return sb.toString();
462
  }
463
 
3430 rajveer 464
  public void validate() throws org.apache.thrift.TException {
1847 vikas 465
    // check for required fields
466
  }
467
 
3430 rajveer 468
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
469
    try {
470
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
471
    } catch (org.apache.thrift.TException te) {
472
      throw new java.io.IOException(te);
473
    }
474
  }
475
 
476
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
477
    try {
478
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
479
      __isset_bit_vector = new BitSet(1);
480
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
481
    } catch (org.apache.thrift.TException te) {
482
      throw new java.io.IOException(te);
483
    }
484
  }
485
 
1847 vikas 486
}
487