Subversion Repositories SmartDukaan

Rev

Rev 4506 | Rev 5305 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4506 Rev 4762
Line 26... Line 26...
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);
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);
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);
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);
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);
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);
-
 
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);
31
 
32
 
32
  private long id; // required
33
  private long id; // required
33
  private String label; // required
34
  private String label; // required
34
  private String description; // required
35
  private String description; // required
35
  private long parent_category_id; // required
36
  private long parent_category_id; // required
36
  private List<Long> children_category_ids; // required
37
  private List<Long> children_category_ids; // required
-
 
38
  private String display_name; // required
37
 
39
 
38
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
40
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
39
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
41
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
40
    ID((short)1, "id"),
42
    ID((short)1, "id"),
41
    LABEL((short)2, "label"),
43
    LABEL((short)2, "label"),
42
    DESCRIPTION((short)3, "description"),
44
    DESCRIPTION((short)3, "description"),
43
    PARENT_CATEGORY_ID((short)4, "parent_category_id"),
45
    PARENT_CATEGORY_ID((short)4, "parent_category_id"),
44
    /**
46
    /**
45
     * This field should not be used.
47
     * This field should not be used.
46
     */
48
     */
47
    CHILDREN_CATEGORY_IDS((short)5, "children_category_ids");
49
    CHILDREN_CATEGORY_IDS((short)5, "children_category_ids"),
-
 
50
    DISPLAY_NAME((short)6, "display_name");
48
 
51
 
49
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
52
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
50
 
53
 
51
    static {
54
    static {
52
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
55
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
Line 67... Line 70...
67
          return DESCRIPTION;
70
          return DESCRIPTION;
68
        case 4: // PARENT_CATEGORY_ID
71
        case 4: // PARENT_CATEGORY_ID
69
          return PARENT_CATEGORY_ID;
72
          return PARENT_CATEGORY_ID;
70
        case 5: // CHILDREN_CATEGORY_IDS
73
        case 5: // CHILDREN_CATEGORY_IDS
71
          return CHILDREN_CATEGORY_IDS;
74
          return CHILDREN_CATEGORY_IDS;
-
 
75
        case 6: // DISPLAY_NAME
-
 
76
          return DISPLAY_NAME;
72
        default:
77
        default:
73
          return null;
78
          return null;
74
      }
79
      }
75
    }
80
    }
76
 
81
 
Line 125... Line 130...
125
    tmpMap.put(_Fields.PARENT_CATEGORY_ID, new org.apache.thrift.meta_data.FieldMetaData("parent_category_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
130
    tmpMap.put(_Fields.PARENT_CATEGORY_ID, new org.apache.thrift.meta_data.FieldMetaData("parent_category_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
126
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
131
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
127
    tmpMap.put(_Fields.CHILDREN_CATEGORY_IDS, new org.apache.thrift.meta_data.FieldMetaData("children_category_ids", org.apache.thrift.TFieldRequirementType.DEFAULT, 
132
    tmpMap.put(_Fields.CHILDREN_CATEGORY_IDS, new org.apache.thrift.meta_data.FieldMetaData("children_category_ids", org.apache.thrift.TFieldRequirementType.DEFAULT, 
128
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
133
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
129
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
134
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))));
-
 
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)));
130
    metaDataMap = Collections.unmodifiableMap(tmpMap);
137
    metaDataMap = Collections.unmodifiableMap(tmpMap);
131
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Category.class, metaDataMap);
138
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Category.class, metaDataMap);
132
  }
139
  }
133
 
140
 
134
  public Category() {
141
  public Category() {
Line 137... Line 144...
137
  public Category(
144
  public Category(
138
    long id,
145
    long id,
139
    String label,
146
    String label,
140
    String description,
147
    String description,
141
    long parent_category_id,
148
    long parent_category_id,
142
    List<Long> children_category_ids)
149
    List<Long> children_category_ids,
-
 
150
    String display_name)
143
  {
151
  {
144
    this();
152
    this();
145
    this.id = id;
153
    this.id = id;
146
    setIdIsSet(true);
154
    setIdIsSet(true);
147
    this.label = label;
155
    this.label = label;
148
    this.description = description;
156
    this.description = description;
149
    this.parent_category_id = parent_category_id;
157
    this.parent_category_id = parent_category_id;
150
    setParent_category_idIsSet(true);
158
    setParent_category_idIsSet(true);
151
    this.children_category_ids = children_category_ids;
159
    this.children_category_ids = children_category_ids;
-
 
160
    this.display_name = display_name;
152
  }
161
  }
153
 
162
 
154
  /**
163
  /**
155
   * Performs a deep copy on <i>other</i>.
164
   * Performs a deep copy on <i>other</i>.
156
   */
165
   */
Line 170... Line 179...
170
      for (Long other_element : other.children_category_ids) {
179
      for (Long other_element : other.children_category_ids) {
171
        __this__children_category_ids.add(other_element);
180
        __this__children_category_ids.add(other_element);
172
      }
181
      }
173
      this.children_category_ids = __this__children_category_ids;
182
      this.children_category_ids = __this__children_category_ids;
174
    }
183
    }
-
 
184
    if (other.isSetDisplay_name()) {
-
 
185
      this.display_name = other.display_name;
-
 
186
    }
175
  }
187
  }
176
 
188
 
177
  public Category deepCopy() {
189
  public Category deepCopy() {
178
    return new Category(this);
190
    return new Category(this);
179
  }
191
  }
Line 185... Line 197...
185
    this.label = null;
197
    this.label = null;
186
    this.description = null;
198
    this.description = null;
187
    setParent_category_idIsSet(false);
199
    setParent_category_idIsSet(false);
188
    this.parent_category_id = 0;
200
    this.parent_category_id = 0;
189
    this.children_category_ids = null;
201
    this.children_category_ids = null;
-
 
202
    this.display_name = null;
190
  }
203
  }
191
 
204
 
192
  public long getId() {
205
  public long getId() {
193
    return this.id;
206
    return this.id;
194
  }
207
  }
Line 321... Line 334...
321
    if (!value) {
334
    if (!value) {
322
      this.children_category_ids = null;
335
      this.children_category_ids = null;
323
    }
336
    }
324
  }
337
  }
325
 
338
 
-
 
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
 
326
  public void setFieldValue(_Fields field, Object value) {
362
  public void setFieldValue(_Fields field, Object value) {
327
    switch (field) {
363
    switch (field) {
328
    case ID:
364
    case ID:
329
      if (value == null) {
365
      if (value == null) {
330
        unsetId();
366
        unsetId();
Line 363... Line 399...
363
      } else {
399
      } else {
364
        setChildren_category_ids((List<Long>)value);
400
        setChildren_category_ids((List<Long>)value);
365
      }
401
      }
366
      break;
402
      break;
367
 
403
 
-
 
404
    case DISPLAY_NAME:
-
 
405
      if (value == null) {
-
 
406
        unsetDisplay_name();
-
 
407
      } else {
-
 
408
        setDisplay_name((String)value);
-
 
409
      }
-
 
410
      break;
-
 
411
 
368
    }
412
    }
369
  }
413
  }
370
 
414
 
371
  public Object getFieldValue(_Fields field) {
415
  public Object getFieldValue(_Fields field) {
372
    switch (field) {
416
    switch (field) {
Line 383... Line 427...
383
      return Long.valueOf(getParent_category_id());
427
      return Long.valueOf(getParent_category_id());
384
 
428
 
385
    case CHILDREN_CATEGORY_IDS:
429
    case CHILDREN_CATEGORY_IDS:
386
      return getChildren_category_ids();
430
      return getChildren_category_ids();
387
 
431
 
-
 
432
    case DISPLAY_NAME:
-
 
433
      return getDisplay_name();
-
 
434
 
388
    }
435
    }
389
    throw new IllegalStateException();
436
    throw new IllegalStateException();
390
  }
437
  }
391
 
438
 
392
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
439
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
Line 404... Line 451...
404
      return isSetDescription();
451
      return isSetDescription();
405
    case PARENT_CATEGORY_ID:
452
    case PARENT_CATEGORY_ID:
406
      return isSetParent_category_id();
453
      return isSetParent_category_id();
407
    case CHILDREN_CATEGORY_IDS:
454
    case CHILDREN_CATEGORY_IDS:
408
      return isSetChildren_category_ids();
455
      return isSetChildren_category_ids();
-
 
456
    case DISPLAY_NAME:
-
 
457
      return isSetDisplay_name();
409
    }
458
    }
410
    throw new IllegalStateException();
459
    throw new IllegalStateException();
411
  }
460
  }
412
 
461
 
413
  @Override
462
  @Override
Line 466... Line 515...
466
        return false;
515
        return false;
467
      if (!this.children_category_ids.equals(that.children_category_ids))
516
      if (!this.children_category_ids.equals(that.children_category_ids))
468
        return false;
517
        return false;
469
    }
518
    }
470
 
519
 
-
 
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
 
471
    return true;
529
    return true;
472
  }
530
  }
473
 
531
 
474
  @Override
532
  @Override
475
  public int hashCode() {
533
  public int hashCode() {
Line 532... Line 590...
532
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.children_category_ids, typedOther.children_category_ids);
590
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.children_category_ids, typedOther.children_category_ids);
533
      if (lastComparison != 0) {
591
      if (lastComparison != 0) {
534
        return lastComparison;
592
        return lastComparison;
535
      }
593
      }
536
    }
594
    }
-
 
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
    }
537
    return 0;
605
    return 0;
538
  }
606
  }
539
 
607
 
540
  public _Fields fieldForId(int fieldId) {
608
  public _Fields fieldForId(int fieldId) {
541
    return _Fields.findByThriftId(fieldId);
609
    return _Fields.findByThriftId(fieldId);
Line 596... Line 664...
596
            }
664
            }
597
          } else { 
665
          } else { 
598
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
666
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
599
          }
667
          }
600
          break;
668
          break;
-
 
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;
601
        default:
676
        default:
602
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
677
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
603
      }
678
      }
604
      iprot.readFieldEnd();
679
      iprot.readFieldEnd();
605
    }
680
    }
Line 637... Line 712...
637
        }
712
        }
638
        oprot.writeListEnd();
713
        oprot.writeListEnd();
639
      }
714
      }
640
      oprot.writeFieldEnd();
715
      oprot.writeFieldEnd();
641
    }
716
    }
-
 
717
    if (this.display_name != null) {
-
 
718
      oprot.writeFieldBegin(DISPLAY_NAME_FIELD_DESC);
-
 
719
      oprot.writeString(this.display_name);
-
 
720
      oprot.writeFieldEnd();
-
 
721
    }
642
    oprot.writeFieldStop();
722
    oprot.writeFieldStop();
643
    oprot.writeStructEnd();
723
    oprot.writeStructEnd();
644
  }
724
  }
645
 
725
 
646
  @Override
726
  @Override
Line 677... Line 757...
677
      sb.append("null");
757
      sb.append("null");
678
    } else {
758
    } else {
679
      sb.append(this.children_category_ids);
759
      sb.append(this.children_category_ids);
680
    }
760
    }
681
    first = false;
761
    first = false;
-
 
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;
682
    sb.append(")");
770
    sb.append(")");
683
    return sb.toString();
771
    return sb.toString();
684
  }
772
  }
685
 
773
 
686
  public void validate() throws org.apache.thrift.TException {
774
  public void validate() throws org.apache.thrift.TException {