Subversion Repositories SmartDukaan

Rev

Rev 5305 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1969 rajveer 1
/**
3430 rajveer 2
 * Autogenerated by Thrift Compiler (0.7.0)
1969 rajveer 3
 *
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
 */
6
package in.shop2020.model.v1.catalog;
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;
1969 rajveer 19
import java.util.Arrays;
20
import org.slf4j.Logger;
21
import org.slf4j.LoggerFactory;
22
 
3430 rajveer 23
public class Category implements org.apache.thrift.TBase<Category, Category._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Category");
1969 rajveer 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 LABEL_FIELD_DESC = new org.apache.thrift.protocol.TField("label", org.apache.thrift.protocol.TType.STRING, (short)2);
28
  private static final org.apache.thrift.protocol.TField DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("description", org.apache.thrift.protocol.TType.STRING, (short)3);
29
  private static final org.apache.thrift.protocol.TField PARENT_CATEGORY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("parent_category_id", org.apache.thrift.protocol.TType.I64, (short)4);
30
  private static final org.apache.thrift.protocol.TField CHILDREN_CATEGORY_IDS_FIELD_DESC = new org.apache.thrift.protocol.TField("children_category_ids", org.apache.thrift.protocol.TType.LIST, (short)5);
4762 phani.kuma 31
  private static final org.apache.thrift.protocol.TField DISPLAY_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("display_name", org.apache.thrift.protocol.TType.STRING, (short)6);
1969 rajveer 32
 
3430 rajveer 33
  private long id; // required
34
  private String label; // required
35
  private String description; // required
36
  private long parent_category_id; // required
37
  private List<Long> children_category_ids; // required
4762 phani.kuma 38
  private String display_name; // required
1969 rajveer 39
 
40
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
3430 rajveer 41
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
1969 rajveer 42
    ID((short)1, "id"),
43
    LABEL((short)2, "label"),
44
    DESCRIPTION((short)3, "description"),
45
    PARENT_CATEGORY_ID((short)4, "parent_category_id"),
46
    /**
47
     * This field should not be used.
48
     */
4762 phani.kuma 49
    CHILDREN_CATEGORY_IDS((short)5, "children_category_ids"),
50
    DISPLAY_NAME((short)6, "display_name");
1969 rajveer 51
 
52
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
53
 
54
    static {
55
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
56
        byName.put(field.getFieldName(), field);
57
      }
58
    }
59
 
60
    /**
61
     * Find the _Fields constant that matches fieldId, or null if its not found.
62
     */
63
    public static _Fields findByThriftId(int fieldId) {
3430 rajveer 64
      switch(fieldId) {
65
        case 1: // ID
66
          return ID;
67
        case 2: // LABEL
68
          return LABEL;
69
        case 3: // DESCRIPTION
70
          return DESCRIPTION;
71
        case 4: // PARENT_CATEGORY_ID
72
          return PARENT_CATEGORY_ID;
73
        case 5: // CHILDREN_CATEGORY_IDS
74
          return CHILDREN_CATEGORY_IDS;
4762 phani.kuma 75
        case 6: // DISPLAY_NAME
76
          return DISPLAY_NAME;
3430 rajveer 77
        default:
78
          return null;
79
      }
1969 rajveer 80
    }
81
 
82
    /**
83
     * Find the _Fields constant that matches fieldId, throwing an exception
84
     * if it is not found.
85
     */
86
    public static _Fields findByThriftIdOrThrow(int fieldId) {
87
      _Fields fields = findByThriftId(fieldId);
88
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
89
      return fields;
90
    }
91
 
92
    /**
93
     * Find the _Fields constant that matches name, or null if its not found.
94
     */
95
    public static _Fields findByName(String name) {
96
      return byName.get(name);
97
    }
98
 
99
    private final short _thriftId;
100
    private final String _fieldName;
101
 
102
    _Fields(short thriftId, String fieldName) {
103
      _thriftId = thriftId;
104
      _fieldName = fieldName;
105
    }
106
 
107
    public short getThriftFieldId() {
108
      return _thriftId;
109
    }
110
 
111
    public String getFieldName() {
112
      return _fieldName;
113
    }
114
  }
115
 
116
  // isset id assignments
117
  private static final int __ID_ISSET_ID = 0;
118
  private static final int __PARENT_CATEGORY_ID_ISSET_ID = 1;
119
  private BitSet __isset_bit_vector = new BitSet(2);
120
 
3430 rajveer 121
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
1969 rajveer 122
  static {
3430 rajveer 123
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
124
    tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
125
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
126
    tmpMap.put(_Fields.LABEL, new org.apache.thrift.meta_data.FieldMetaData("label", org.apache.thrift.TFieldRequirementType.DEFAULT, 
127
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
128
    tmpMap.put(_Fields.DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("description", org.apache.thrift.TFieldRequirementType.DEFAULT, 
129
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
130
    tmpMap.put(_Fields.PARENT_CATEGORY_ID, new org.apache.thrift.meta_data.FieldMetaData("parent_category_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
131
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
132
    tmpMap.put(_Fields.CHILDREN_CATEGORY_IDS, new org.apache.thrift.meta_data.FieldMetaData("children_category_ids", org.apache.thrift.TFieldRequirementType.DEFAULT, 
133
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
134
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
4762 phani.kuma 135
    tmpMap.put(_Fields.DISPLAY_NAME, new org.apache.thrift.meta_data.FieldMetaData("display_name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
136
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
3430 rajveer 137
    metaDataMap = Collections.unmodifiableMap(tmpMap);
138
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Category.class, metaDataMap);
1969 rajveer 139
  }
140
 
141
  public Category() {
142
  }
143
 
144
  public Category(
145
    long id,
146
    String label,
147
    String description,
148
    long parent_category_id,
4762 phani.kuma 149
    List<Long> children_category_ids,
150
    String display_name)
1969 rajveer 151
  {
152
    this();
153
    this.id = id;
154
    setIdIsSet(true);
155
    this.label = label;
156
    this.description = description;
157
    this.parent_category_id = parent_category_id;
158
    setParent_category_idIsSet(true);
159
    this.children_category_ids = children_category_ids;
4762 phani.kuma 160
    this.display_name = display_name;
1969 rajveer 161
  }
162
 
163
  /**
164
   * Performs a deep copy on <i>other</i>.
165
   */
166
  public Category(Category other) {
167
    __isset_bit_vector.clear();
168
    __isset_bit_vector.or(other.__isset_bit_vector);
169
    this.id = other.id;
170
    if (other.isSetLabel()) {
171
      this.label = other.label;
172
    }
173
    if (other.isSetDescription()) {
174
      this.description = other.description;
175
    }
176
    this.parent_category_id = other.parent_category_id;
177
    if (other.isSetChildren_category_ids()) {
178
      List<Long> __this__children_category_ids = new ArrayList<Long>();
179
      for (Long other_element : other.children_category_ids) {
180
        __this__children_category_ids.add(other_element);
181
      }
182
      this.children_category_ids = __this__children_category_ids;
183
    }
4762 phani.kuma 184
    if (other.isSetDisplay_name()) {
185
      this.display_name = other.display_name;
186
    }
1969 rajveer 187
  }
188
 
189
  public Category deepCopy() {
190
    return new Category(this);
191
  }
192
 
3430 rajveer 193
  @Override
194
  public void clear() {
195
    setIdIsSet(false);
196
    this.id = 0;
197
    this.label = null;
198
    this.description = null;
199
    setParent_category_idIsSet(false);
200
    this.parent_category_id = 0;
201
    this.children_category_ids = null;
4762 phani.kuma 202
    this.display_name = null;
1969 rajveer 203
  }
204
 
205
  public long getId() {
206
    return this.id;
207
  }
208
 
3430 rajveer 209
  public void setId(long id) {
1969 rajveer 210
    this.id = id;
211
    setIdIsSet(true);
212
  }
213
 
214
  public void unsetId() {
215
    __isset_bit_vector.clear(__ID_ISSET_ID);
216
  }
217
 
3430 rajveer 218
  /** Returns true if field id is set (has been assigned a value) and false otherwise */
1969 rajveer 219
  public boolean isSetId() {
220
    return __isset_bit_vector.get(__ID_ISSET_ID);
221
  }
222
 
223
  public void setIdIsSet(boolean value) {
224
    __isset_bit_vector.set(__ID_ISSET_ID, value);
225
  }
226
 
227
  public String getLabel() {
228
    return this.label;
229
  }
230
 
3430 rajveer 231
  public void setLabel(String label) {
1969 rajveer 232
    this.label = label;
233
  }
234
 
235
  public void unsetLabel() {
236
    this.label = null;
237
  }
238
 
3430 rajveer 239
  /** Returns true if field label is set (has been assigned a value) and false otherwise */
1969 rajveer 240
  public boolean isSetLabel() {
241
    return this.label != null;
242
  }
243
 
244
  public void setLabelIsSet(boolean value) {
245
    if (!value) {
246
      this.label = null;
247
    }
248
  }
249
 
250
  public String getDescription() {
251
    return this.description;
252
  }
253
 
3430 rajveer 254
  public void setDescription(String description) {
1969 rajveer 255
    this.description = description;
256
  }
257
 
258
  public void unsetDescription() {
259
    this.description = null;
260
  }
261
 
3430 rajveer 262
  /** Returns true if field description is set (has been assigned a value) and false otherwise */
1969 rajveer 263
  public boolean isSetDescription() {
264
    return this.description != null;
265
  }
266
 
267
  public void setDescriptionIsSet(boolean value) {
268
    if (!value) {
269
      this.description = null;
270
    }
271
  }
272
 
273
  public long getParent_category_id() {
274
    return this.parent_category_id;
275
  }
276
 
3430 rajveer 277
  public void setParent_category_id(long parent_category_id) {
1969 rajveer 278
    this.parent_category_id = parent_category_id;
279
    setParent_category_idIsSet(true);
280
  }
281
 
282
  public void unsetParent_category_id() {
283
    __isset_bit_vector.clear(__PARENT_CATEGORY_ID_ISSET_ID);
284
  }
285
 
3430 rajveer 286
  /** Returns true if field parent_category_id is set (has been assigned a value) and false otherwise */
1969 rajveer 287
  public boolean isSetParent_category_id() {
288
    return __isset_bit_vector.get(__PARENT_CATEGORY_ID_ISSET_ID);
289
  }
290
 
291
  public void setParent_category_idIsSet(boolean value) {
292
    __isset_bit_vector.set(__PARENT_CATEGORY_ID_ISSET_ID, value);
293
  }
294
 
295
  public int getChildren_category_idsSize() {
296
    return (this.children_category_ids == null) ? 0 : this.children_category_ids.size();
297
  }
298
 
299
  public java.util.Iterator<Long> getChildren_category_idsIterator() {
300
    return (this.children_category_ids == null) ? null : this.children_category_ids.iterator();
301
  }
302
 
303
  public void addToChildren_category_ids(long elem) {
304
    if (this.children_category_ids == null) {
305
      this.children_category_ids = new ArrayList<Long>();
306
    }
307
    this.children_category_ids.add(elem);
308
  }
309
 
310
  /**
311
   * This field should not be used.
312
   */
313
  public List<Long> getChildren_category_ids() {
314
    return this.children_category_ids;
315
  }
316
 
317
  /**
318
   * This field should not be used.
319
   */
3430 rajveer 320
  public void setChildren_category_ids(List<Long> children_category_ids) {
1969 rajveer 321
    this.children_category_ids = children_category_ids;
322
  }
323
 
324
  public void unsetChildren_category_ids() {
325
    this.children_category_ids = null;
326
  }
327
 
3430 rajveer 328
  /** Returns true if field children_category_ids is set (has been assigned a value) and false otherwise */
1969 rajveer 329
  public boolean isSetChildren_category_ids() {
330
    return this.children_category_ids != null;
331
  }
332
 
333
  public void setChildren_category_idsIsSet(boolean value) {
334
    if (!value) {
335
      this.children_category_ids = null;
336
    }
337
  }
338
 
4762 phani.kuma 339
  public String getDisplay_name() {
340
    return this.display_name;
341
  }
342
 
343
  public void setDisplay_name(String display_name) {
344
    this.display_name = display_name;
345
  }
346
 
347
  public void unsetDisplay_name() {
348
    this.display_name = null;
349
  }
350
 
351
  /** Returns true if field display_name is set (has been assigned a value) and false otherwise */
352
  public boolean isSetDisplay_name() {
353
    return this.display_name != null;
354
  }
355
 
356
  public void setDisplay_nameIsSet(boolean value) {
357
    if (!value) {
358
      this.display_name = null;
359
    }
360
  }
361
 
1969 rajveer 362
  public void setFieldValue(_Fields field, Object value) {
363
    switch (field) {
364
    case ID:
365
      if (value == null) {
366
        unsetId();
367
      } else {
368
        setId((Long)value);
369
      }
370
      break;
371
 
372
    case LABEL:
373
      if (value == null) {
374
        unsetLabel();
375
      } else {
376
        setLabel((String)value);
377
      }
378
      break;
379
 
380
    case DESCRIPTION:
381
      if (value == null) {
382
        unsetDescription();
383
      } else {
384
        setDescription((String)value);
385
      }
386
      break;
387
 
388
    case PARENT_CATEGORY_ID:
389
      if (value == null) {
390
        unsetParent_category_id();
391
      } else {
392
        setParent_category_id((Long)value);
393
      }
394
      break;
395
 
396
    case CHILDREN_CATEGORY_IDS:
397
      if (value == null) {
398
        unsetChildren_category_ids();
399
      } else {
400
        setChildren_category_ids((List<Long>)value);
401
      }
402
      break;
403
 
4762 phani.kuma 404
    case DISPLAY_NAME:
405
      if (value == null) {
406
        unsetDisplay_name();
407
      } else {
408
        setDisplay_name((String)value);
409
      }
410
      break;
411
 
1969 rajveer 412
    }
413
  }
414
 
415
  public Object getFieldValue(_Fields field) {
416
    switch (field) {
417
    case ID:
3430 rajveer 418
      return Long.valueOf(getId());
1969 rajveer 419
 
420
    case LABEL:
421
      return getLabel();
422
 
423
    case DESCRIPTION:
424
      return getDescription();
425
 
426
    case PARENT_CATEGORY_ID:
3430 rajveer 427
      return Long.valueOf(getParent_category_id());
1969 rajveer 428
 
429
    case CHILDREN_CATEGORY_IDS:
430
      return getChildren_category_ids();
431
 
4762 phani.kuma 432
    case DISPLAY_NAME:
433
      return getDisplay_name();
434
 
1969 rajveer 435
    }
436
    throw new IllegalStateException();
437
  }
438
 
3430 rajveer 439
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
440
  public boolean isSet(_Fields field) {
441
    if (field == null) {
442
      throw new IllegalArgumentException();
443
    }
1969 rajveer 444
 
445
    switch (field) {
446
    case ID:
447
      return isSetId();
448
    case LABEL:
449
      return isSetLabel();
450
    case DESCRIPTION:
451
      return isSetDescription();
452
    case PARENT_CATEGORY_ID:
453
      return isSetParent_category_id();
454
    case CHILDREN_CATEGORY_IDS:
455
      return isSetChildren_category_ids();
4762 phani.kuma 456
    case DISPLAY_NAME:
457
      return isSetDisplay_name();
1969 rajveer 458
    }
459
    throw new IllegalStateException();
460
  }
461
 
462
  @Override
463
  public boolean equals(Object that) {
464
    if (that == null)
465
      return false;
466
    if (that instanceof Category)
467
      return this.equals((Category)that);
468
    return false;
469
  }
470
 
471
  public boolean equals(Category that) {
472
    if (that == null)
473
      return false;
474
 
475
    boolean this_present_id = true;
476
    boolean that_present_id = true;
477
    if (this_present_id || that_present_id) {
478
      if (!(this_present_id && that_present_id))
479
        return false;
480
      if (this.id != that.id)
481
        return false;
482
    }
483
 
484
    boolean this_present_label = true && this.isSetLabel();
485
    boolean that_present_label = true && that.isSetLabel();
486
    if (this_present_label || that_present_label) {
487
      if (!(this_present_label && that_present_label))
488
        return false;
489
      if (!this.label.equals(that.label))
490
        return false;
491
    }
492
 
493
    boolean this_present_description = true && this.isSetDescription();
494
    boolean that_present_description = true && that.isSetDescription();
495
    if (this_present_description || that_present_description) {
496
      if (!(this_present_description && that_present_description))
497
        return false;
498
      if (!this.description.equals(that.description))
499
        return false;
500
    }
501
 
502
    boolean this_present_parent_category_id = true;
503
    boolean that_present_parent_category_id = true;
504
    if (this_present_parent_category_id || that_present_parent_category_id) {
505
      if (!(this_present_parent_category_id && that_present_parent_category_id))
506
        return false;
507
      if (this.parent_category_id != that.parent_category_id)
508
        return false;
509
    }
510
 
511
    boolean this_present_children_category_ids = true && this.isSetChildren_category_ids();
512
    boolean that_present_children_category_ids = true && that.isSetChildren_category_ids();
513
    if (this_present_children_category_ids || that_present_children_category_ids) {
514
      if (!(this_present_children_category_ids && that_present_children_category_ids))
515
        return false;
516
      if (!this.children_category_ids.equals(that.children_category_ids))
517
        return false;
518
    }
519
 
4762 phani.kuma 520
    boolean this_present_display_name = true && this.isSetDisplay_name();
521
    boolean that_present_display_name = true && that.isSetDisplay_name();
522
    if (this_present_display_name || that_present_display_name) {
523
      if (!(this_present_display_name && that_present_display_name))
524
        return false;
525
      if (!this.display_name.equals(that.display_name))
526
        return false;
527
    }
528
 
1969 rajveer 529
    return true;
530
  }
531
 
532
  @Override
533
  public int hashCode() {
534
    return 0;
535
  }
536
 
537
  public int compareTo(Category other) {
538
    if (!getClass().equals(other.getClass())) {
539
      return getClass().getName().compareTo(other.getClass().getName());
540
    }
541
 
542
    int lastComparison = 0;
543
    Category typedOther = (Category)other;
544
 
3430 rajveer 545
    lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
1969 rajveer 546
    if (lastComparison != 0) {
547
      return lastComparison;
548
    }
3430 rajveer 549
    if (isSetId()) {
550
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
551
      if (lastComparison != 0) {
552
        return lastComparison;
553
      }
1969 rajveer 554
    }
3430 rajveer 555
    lastComparison = Boolean.valueOf(isSetLabel()).compareTo(typedOther.isSetLabel());
1969 rajveer 556
    if (lastComparison != 0) {
557
      return lastComparison;
558
    }
3430 rajveer 559
    if (isSetLabel()) {
560
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.label, typedOther.label);
561
      if (lastComparison != 0) {
562
        return lastComparison;
563
      }
1969 rajveer 564
    }
3430 rajveer 565
    lastComparison = Boolean.valueOf(isSetDescription()).compareTo(typedOther.isSetDescription());
1969 rajveer 566
    if (lastComparison != 0) {
567
      return lastComparison;
568
    }
3430 rajveer 569
    if (isSetDescription()) {
570
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.description, typedOther.description);
571
      if (lastComparison != 0) {
572
        return lastComparison;
573
      }
1969 rajveer 574
    }
3430 rajveer 575
    lastComparison = Boolean.valueOf(isSetParent_category_id()).compareTo(typedOther.isSetParent_category_id());
1969 rajveer 576
    if (lastComparison != 0) {
577
      return lastComparison;
578
    }
3430 rajveer 579
    if (isSetParent_category_id()) {
580
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parent_category_id, typedOther.parent_category_id);
581
      if (lastComparison != 0) {
582
        return lastComparison;
583
      }
1969 rajveer 584
    }
3430 rajveer 585
    lastComparison = Boolean.valueOf(isSetChildren_category_ids()).compareTo(typedOther.isSetChildren_category_ids());
1969 rajveer 586
    if (lastComparison != 0) {
587
      return lastComparison;
588
    }
3430 rajveer 589
    if (isSetChildren_category_ids()) {
590
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.children_category_ids, typedOther.children_category_ids);
591
      if (lastComparison != 0) {
592
        return lastComparison;
593
      }
1969 rajveer 594
    }
4762 phani.kuma 595
    lastComparison = Boolean.valueOf(isSetDisplay_name()).compareTo(typedOther.isSetDisplay_name());
596
    if (lastComparison != 0) {
597
      return lastComparison;
598
    }
599
    if (isSetDisplay_name()) {
600
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.display_name, typedOther.display_name);
601
      if (lastComparison != 0) {
602
        return lastComparison;
603
      }
604
    }
1969 rajveer 605
    return 0;
606
  }
607
 
3430 rajveer 608
  public _Fields fieldForId(int fieldId) {
609
    return _Fields.findByThriftId(fieldId);
610
  }
611
 
612
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
613
    org.apache.thrift.protocol.TField field;
1969 rajveer 614
    iprot.readStructBegin();
615
    while (true)
616
    {
617
      field = iprot.readFieldBegin();
3430 rajveer 618
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
1969 rajveer 619
        break;
620
      }
3430 rajveer 621
      switch (field.id) {
622
        case 1: // ID
623
          if (field.type == org.apache.thrift.protocol.TType.I64) {
624
            this.id = iprot.readI64();
625
            setIdIsSet(true);
626
          } else { 
627
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
628
          }
629
          break;
630
        case 2: // LABEL
631
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
632
            this.label = iprot.readString();
633
          } else { 
634
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
635
          }
636
          break;
637
        case 3: // DESCRIPTION
638
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
639
            this.description = iprot.readString();
640
          } else { 
641
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
642
          }
643
          break;
644
        case 4: // PARENT_CATEGORY_ID
645
          if (field.type == org.apache.thrift.protocol.TType.I64) {
646
            this.parent_category_id = iprot.readI64();
647
            setParent_category_idIsSet(true);
648
          } else { 
649
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
650
          }
651
          break;
652
        case 5: // CHILDREN_CATEGORY_IDS
653
          if (field.type == org.apache.thrift.protocol.TType.LIST) {
654
            {
5336 rajveer 655
              org.apache.thrift.protocol.TList _list15 = iprot.readListBegin();
656
              this.children_category_ids = new ArrayList<Long>(_list15.size);
657
              for (int _i16 = 0; _i16 < _list15.size; ++_i16)
1969 rajveer 658
              {
5336 rajveer 659
                long _elem17; // required
660
                _elem17 = iprot.readI64();
661
                this.children_category_ids.add(_elem17);
1969 rajveer 662
              }
3430 rajveer 663
              iprot.readListEnd();
1969 rajveer 664
            }
3430 rajveer 665
          } else { 
666
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
667
          }
668
          break;
4762 phani.kuma 669
        case 6: // DISPLAY_NAME
670
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
671
            this.display_name = iprot.readString();
672
          } else { 
673
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
674
          }
675
          break;
3430 rajveer 676
        default:
677
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1969 rajveer 678
      }
3430 rajveer 679
      iprot.readFieldEnd();
1969 rajveer 680
    }
681
    iprot.readStructEnd();
682
    validate();
683
  }
684
 
3430 rajveer 685
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
1969 rajveer 686
    validate();
687
 
688
    oprot.writeStructBegin(STRUCT_DESC);
689
    oprot.writeFieldBegin(ID_FIELD_DESC);
690
    oprot.writeI64(this.id);
691
    oprot.writeFieldEnd();
692
    if (this.label != null) {
693
      oprot.writeFieldBegin(LABEL_FIELD_DESC);
694
      oprot.writeString(this.label);
695
      oprot.writeFieldEnd();
696
    }
697
    if (this.description != null) {
698
      oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC);
699
      oprot.writeString(this.description);
700
      oprot.writeFieldEnd();
701
    }
702
    oprot.writeFieldBegin(PARENT_CATEGORY_ID_FIELD_DESC);
703
    oprot.writeI64(this.parent_category_id);
704
    oprot.writeFieldEnd();
705
    if (this.children_category_ids != null) {
706
      oprot.writeFieldBegin(CHILDREN_CATEGORY_IDS_FIELD_DESC);
707
      {
3430 rajveer 708
        oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, this.children_category_ids.size()));
5336 rajveer 709
        for (long _iter18 : this.children_category_ids)
1969 rajveer 710
        {
5336 rajveer 711
          oprot.writeI64(_iter18);
1969 rajveer 712
        }
713
        oprot.writeListEnd();
714
      }
715
      oprot.writeFieldEnd();
716
    }
4762 phani.kuma 717
    if (this.display_name != null) {
718
      oprot.writeFieldBegin(DISPLAY_NAME_FIELD_DESC);
719
      oprot.writeString(this.display_name);
720
      oprot.writeFieldEnd();
721
    }
1969 rajveer 722
    oprot.writeFieldStop();
723
    oprot.writeStructEnd();
724
  }
725
 
726
  @Override
727
  public String toString() {
728
    StringBuilder sb = new StringBuilder("Category(");
729
    boolean first = true;
730
 
731
    sb.append("id:");
732
    sb.append(this.id);
733
    first = false;
734
    if (!first) sb.append(", ");
735
    sb.append("label:");
736
    if (this.label == null) {
737
      sb.append("null");
738
    } else {
739
      sb.append(this.label);
740
    }
741
    first = false;
742
    if (!first) sb.append(", ");
743
    sb.append("description:");
744
    if (this.description == null) {
745
      sb.append("null");
746
    } else {
747
      sb.append(this.description);
748
    }
749
    first = false;
750
    if (!first) sb.append(", ");
751
    sb.append("parent_category_id:");
752
    sb.append(this.parent_category_id);
753
    first = false;
754
    if (!first) sb.append(", ");
755
    sb.append("children_category_ids:");
756
    if (this.children_category_ids == null) {
757
      sb.append("null");
758
    } else {
759
      sb.append(this.children_category_ids);
760
    }
761
    first = false;
4762 phani.kuma 762
    if (!first) sb.append(", ");
763
    sb.append("display_name:");
764
    if (this.display_name == null) {
765
      sb.append("null");
766
    } else {
767
      sb.append(this.display_name);
768
    }
769
    first = false;
1969 rajveer 770
    sb.append(")");
771
    return sb.toString();
772
  }
773
 
3430 rajveer 774
  public void validate() throws org.apache.thrift.TException {
1969 rajveer 775
    // check for required fields
776
  }
777
 
3430 rajveer 778
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
779
    try {
780
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
781
    } catch (org.apache.thrift.TException te) {
782
      throw new java.io.IOException(te);
783
    }
784
  }
785
 
786
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
787
    try {
788
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
789
      __isset_bit_vector = new BitSet(1);
790
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
791
    } catch (org.apache.thrift.TException te) {
792
      throw new java.io.IOException(te);
793
    }
794
  }
795
 
1969 rajveer 796
}
797