Subversion Repositories SmartDukaan

Rev

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

Rev 668 Rev 697
Line 25... Line 25...
25
 
25
 
26
public class LineItem implements TBase<LineItem._Fields>, java.io.Serializable, Cloneable, Comparable<LineItem> {
26
public class LineItem implements TBase<LineItem._Fields>, java.io.Serializable, Cloneable, Comparable<LineItem> {
27
  private static final TStruct STRUCT_DESC = new TStruct("LineItem");
27
  private static final TStruct STRUCT_DESC = new TStruct("LineItem");
28
 
28
 
29
  private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)1);
29
  private static final TField ID_FIELD_DESC = new TField("id", TType.I64, (short)1);
30
  private static final TField SKU_ID_FIELD_DESC = new TField("sku_id", TType.STRING, (short)2);
30
  private static final TField ITEM_ID_FIELD_DESC = new TField("item_id", TType.I64, (short)2);
31
  private static final TField BRAND_FIELD_DESC = new TField("brand", TType.STRING, (short)3);
31
  private static final TField BRAND_FIELD_DESC = new TField("brand", TType.STRING, (short)3);
32
  private static final TField MODEL_NUMBER_FIELD_DESC = new TField("model_number", TType.STRING, (short)4);
32
  private static final TField MODEL_NUMBER_FIELD_DESC = new TField("model_number", TType.STRING, (short)4);
33
  private static final TField MODEL_NAME_FIELD_DESC = new TField("model_name", TType.STRING, (short)5);
33
  private static final TField MODEL_NAME_FIELD_DESC = new TField("model_name", TType.STRING, (short)5);
34
  private static final TField EXTRA_INFO_FIELD_DESC = new TField("extra_info", TType.STRING, (short)6);
34
  private static final TField EXTRA_INFO_FIELD_DESC = new TField("extra_info", TType.STRING, (short)6);
35
  private static final TField QUANTITY_FIELD_DESC = new TField("quantity", TType.DOUBLE, (short)7);
35
  private static final TField QUANTITY_FIELD_DESC = new TField("quantity", TType.DOUBLE, (short)7);
Line 38... Line 38...
38
  private static final TField TOTAL_PRICE_FIELD_DESC = new TField("total_price", TType.DOUBLE, (short)10);
38
  private static final TField TOTAL_PRICE_FIELD_DESC = new TField("total_price", TType.DOUBLE, (short)10);
39
  private static final TField TOTAL_WEIGHT_FIELD_DESC = new TField("total_weight", TType.DOUBLE, (short)11);
39
  private static final TField TOTAL_WEIGHT_FIELD_DESC = new TField("total_weight", TType.DOUBLE, (short)11);
40
  private static final TField COLOR_FIELD_DESC = new TField("color", TType.STRING, (short)12);
40
  private static final TField COLOR_FIELD_DESC = new TField("color", TType.STRING, (short)12);
41
 
41
 
42
  private long id;
42
  private long id;
43
  private String sku_id;
43
  private long item_id;
44
  private String brand;
44
  private String brand;
45
  private String model_number;
45
  private String model_number;
46
  private String model_name;
46
  private String model_name;
47
  private String extra_info;
47
  private String extra_info;
48
  private double quantity;
48
  private double quantity;
Line 53... Line 53...
53
  private String color;
53
  private String color;
54
 
54
 
55
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
55
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
56
  public enum _Fields implements TFieldIdEnum {
56
  public enum _Fields implements TFieldIdEnum {
57
    ID((short)1, "id"),
57
    ID((short)1, "id"),
58
    SKU_ID((short)2, "sku_id"),
58
    ITEM_ID((short)2, "item_id"),
59
    BRAND((short)3, "brand"),
59
    BRAND((short)3, "brand"),
60
    MODEL_NUMBER((short)4, "model_number"),
60
    MODEL_NUMBER((short)4, "model_number"),
61
    MODEL_NAME((short)5, "model_name"),
61
    MODEL_NAME((short)5, "model_name"),
62
    EXTRA_INFO((short)6, "extra_info"),
62
    EXTRA_INFO((short)6, "extra_info"),
63
    QUANTITY((short)7, "quantity"),
63
    QUANTITY((short)7, "quantity"),
Line 118... Line 118...
118
    }
118
    }
119
  }
119
  }
120
 
120
 
121
  // isset id assignments
121
  // isset id assignments
122
  private static final int __ID_ISSET_ID = 0;
122
  private static final int __ID_ISSET_ID = 0;
-
 
123
  private static final int __ITEM_ID_ISSET_ID = 1;
123
  private static final int __QUANTITY_ISSET_ID = 1;
124
  private static final int __QUANTITY_ISSET_ID = 2;
124
  private static final int __UNIT_PRICE_ISSET_ID = 2;
125
  private static final int __UNIT_PRICE_ISSET_ID = 3;
125
  private static final int __UNIT_WEIGHT_ISSET_ID = 3;
126
  private static final int __UNIT_WEIGHT_ISSET_ID = 4;
126
  private static final int __TOTAL_PRICE_ISSET_ID = 4;
127
  private static final int __TOTAL_PRICE_ISSET_ID = 5;
127
  private static final int __TOTAL_WEIGHT_ISSET_ID = 5;
128
  private static final int __TOTAL_WEIGHT_ISSET_ID = 6;
128
  private BitSet __isset_bit_vector = new BitSet(6);
129
  private BitSet __isset_bit_vector = new BitSet(7);
129
 
130
 
130
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
131
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
131
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
132
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
132
        new FieldValueMetaData(TType.I64)));
133
        new FieldValueMetaData(TType.I64)));
133
    put(_Fields.SKU_ID, new FieldMetaData("sku_id", TFieldRequirementType.DEFAULT, 
134
    put(_Fields.ITEM_ID, new FieldMetaData("item_id", TFieldRequirementType.DEFAULT, 
134
        new FieldValueMetaData(TType.STRING)));
135
        new FieldValueMetaData(TType.I64)));
135
    put(_Fields.BRAND, new FieldMetaData("brand", TFieldRequirementType.DEFAULT, 
136
    put(_Fields.BRAND, new FieldMetaData("brand", TFieldRequirementType.DEFAULT, 
136
        new FieldValueMetaData(TType.STRING)));
137
        new FieldValueMetaData(TType.STRING)));
137
    put(_Fields.MODEL_NUMBER, new FieldMetaData("model_number", TFieldRequirementType.DEFAULT, 
138
    put(_Fields.MODEL_NUMBER, new FieldMetaData("model_number", TFieldRequirementType.DEFAULT, 
138
        new FieldValueMetaData(TType.STRING)));
139
        new FieldValueMetaData(TType.STRING)));
139
    put(_Fields.MODEL_NAME, new FieldMetaData("model_name", TFieldRequirementType.DEFAULT, 
140
    put(_Fields.MODEL_NAME, new FieldMetaData("model_name", TFieldRequirementType.DEFAULT, 
Line 161... Line 162...
161
  public LineItem() {
162
  public LineItem() {
162
  }
163
  }
163
 
164
 
164
  public LineItem(
165
  public LineItem(
165
    long id,
166
    long id,
166
    String sku_id,
167
    long item_id,
167
    String brand,
168
    String brand,
168
    String model_number,
169
    String model_number,
169
    String model_name,
170
    String model_name,
170
    String extra_info,
171
    String extra_info,
171
    double quantity,
172
    double quantity,
Line 176... Line 177...
176
    String color)
177
    String color)
177
  {
178
  {
178
    this();
179
    this();
179
    this.id = id;
180
    this.id = id;
180
    setIdIsSet(true);
181
    setIdIsSet(true);
181
    this.sku_id = sku_id;
182
    this.item_id = item_id;
-
 
183
    setItem_idIsSet(true);
182
    this.brand = brand;
184
    this.brand = brand;
183
    this.model_number = model_number;
185
    this.model_number = model_number;
184
    this.model_name = model_name;
186
    this.model_name = model_name;
185
    this.extra_info = extra_info;
187
    this.extra_info = extra_info;
186
    this.quantity = quantity;
188
    this.quantity = quantity;
Line 201... Line 203...
201
   */
203
   */
202
  public LineItem(LineItem other) {
204
  public LineItem(LineItem other) {
203
    __isset_bit_vector.clear();
205
    __isset_bit_vector.clear();
204
    __isset_bit_vector.or(other.__isset_bit_vector);
206
    __isset_bit_vector.or(other.__isset_bit_vector);
205
    this.id = other.id;
207
    this.id = other.id;
206
    if (other.isSetSku_id()) {
-
 
207
      this.sku_id = other.sku_id;
208
    this.item_id = other.item_id;
208
    }
-
 
209
    if (other.isSetBrand()) {
209
    if (other.isSetBrand()) {
210
      this.brand = other.brand;
210
      this.brand = other.brand;
211
    }
211
    }
212
    if (other.isSetModel_number()) {
212
    if (other.isSetModel_number()) {
213
      this.model_number = other.model_number;
213
      this.model_number = other.model_number;
Line 258... Line 258...
258
 
258
 
259
  public void setIdIsSet(boolean value) {
259
  public void setIdIsSet(boolean value) {
260
    __isset_bit_vector.set(__ID_ISSET_ID, value);
260
    __isset_bit_vector.set(__ID_ISSET_ID, value);
261
  }
261
  }
262
 
262
 
263
  public String getSku_id() {
263
  public long getItem_id() {
264
    return this.sku_id;
264
    return this.item_id;
265
  }
265
  }
266
 
266
 
267
  public LineItem setSku_id(String sku_id) {
267
  public LineItem setItem_id(long item_id) {
268
    this.sku_id = sku_id;
268
    this.item_id = item_id;
-
 
269
    setItem_idIsSet(true);
269
    return this;
270
    return this;
270
  }
271
  }
271
 
272
 
272
  public void unsetSku_id() {
273
  public void unsetItem_id() {
273
    this.sku_id = null;
274
    __isset_bit_vector.clear(__ITEM_ID_ISSET_ID);
274
  }
275
  }
275
 
276
 
276
  /** Returns true if field sku_id is set (has been asigned a value) and false otherwise */
277
  /** Returns true if field item_id is set (has been asigned a value) and false otherwise */
277
  public boolean isSetSku_id() {
278
  public boolean isSetItem_id() {
278
    return this.sku_id != null;
279
    return __isset_bit_vector.get(__ITEM_ID_ISSET_ID);
279
  }
280
  }
280
 
281
 
281
  public void setSku_idIsSet(boolean value) {
282
  public void setItem_idIsSet(boolean value) {
282
    if (!value) {
-
 
283
      this.sku_id = null;
283
    __isset_bit_vector.set(__ITEM_ID_ISSET_ID, value);
284
    }
-
 
285
  }
284
  }
286
 
285
 
287
  public String getBrand() {
286
  public String getBrand() {
288
    return this.brand;
287
    return this.brand;
289
  }
288
  }
Line 527... Line 526...
527
      } else {
526
      } else {
528
        setId((Long)value);
527
        setId((Long)value);
529
      }
528
      }
530
      break;
529
      break;
531
 
530
 
532
    case SKU_ID:
531
    case ITEM_ID:
533
      if (value == null) {
532
      if (value == null) {
534
        unsetSku_id();
533
        unsetItem_id();
535
      } else {
534
      } else {
536
        setSku_id((String)value);
535
        setItem_id((Long)value);
537
      }
536
      }
538
      break;
537
      break;
539
 
538
 
540
    case BRAND:
539
    case BRAND:
541
      if (value == null) {
540
      if (value == null) {
Line 627... Line 626...
627
  public Object getFieldValue(_Fields field) {
626
  public Object getFieldValue(_Fields field) {
628
    switch (field) {
627
    switch (field) {
629
    case ID:
628
    case ID:
630
      return new Long(getId());
629
      return new Long(getId());
631
 
630
 
632
    case SKU_ID:
631
    case ITEM_ID:
633
      return getSku_id();
632
      return new Long(getItem_id());
634
 
633
 
635
    case BRAND:
634
    case BRAND:
636
      return getBrand();
635
      return getBrand();
637
 
636
 
638
    case MODEL_NUMBER:
637
    case MODEL_NUMBER:
Line 673... Line 672...
673
  /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
672
  /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
674
  public boolean isSet(_Fields field) {
673
  public boolean isSet(_Fields field) {
675
    switch (field) {
674
    switch (field) {
676
    case ID:
675
    case ID:
677
      return isSetId();
676
      return isSetId();
678
    case SKU_ID:
677
    case ITEM_ID:
679
      return isSetSku_id();
678
      return isSetItem_id();
680
    case BRAND:
679
    case BRAND:
681
      return isSetBrand();
680
      return isSetBrand();
682
    case MODEL_NUMBER:
681
    case MODEL_NUMBER:
683
      return isSetModel_number();
682
      return isSetModel_number();
684
    case MODEL_NAME:
683
    case MODEL_NAME:
Line 725... Line 724...
725
        return false;
724
        return false;
726
      if (this.id != that.id)
725
      if (this.id != that.id)
727
        return false;
726
        return false;
728
    }
727
    }
729
 
728
 
730
    boolean this_present_sku_id = true && this.isSetSku_id();
729
    boolean this_present_item_id = true;
731
    boolean that_present_sku_id = true && that.isSetSku_id();
730
    boolean that_present_item_id = true;
732
    if (this_present_sku_id || that_present_sku_id) {
731
    if (this_present_item_id || that_present_item_id) {
733
      if (!(this_present_sku_id && that_present_sku_id))
732
      if (!(this_present_item_id && that_present_item_id))
734
        return false;
733
        return false;
735
      if (!this.sku_id.equals(that.sku_id))
734
      if (this.item_id != that.item_id)
736
        return false;
735
        return false;
737
    }
736
    }
738
 
737
 
739
    boolean this_present_brand = true && this.isSetBrand();
738
    boolean this_present_brand = true && this.isSetBrand();
740
    boolean that_present_brand = true && that.isSetBrand();
739
    boolean that_present_brand = true && that.isSetBrand();
Line 848... Line 847...
848
    }
847
    }
849
    lastComparison = TBaseHelper.compareTo(id, typedOther.id);
848
    lastComparison = TBaseHelper.compareTo(id, typedOther.id);
850
    if (lastComparison != 0) {
849
    if (lastComparison != 0) {
851
      return lastComparison;
850
      return lastComparison;
852
    }
851
    }
853
    lastComparison = Boolean.valueOf(isSetSku_id()).compareTo(isSetSku_id());
852
    lastComparison = Boolean.valueOf(isSetItem_id()).compareTo(isSetItem_id());
854
    if (lastComparison != 0) {
853
    if (lastComparison != 0) {
855
      return lastComparison;
854
      return lastComparison;
856
    }
855
    }
857
    lastComparison = TBaseHelper.compareTo(sku_id, typedOther.sku_id);
856
    lastComparison = TBaseHelper.compareTo(item_id, typedOther.item_id);
858
    if (lastComparison != 0) {
857
    if (lastComparison != 0) {
859
      return lastComparison;
858
      return lastComparison;
860
    }
859
    }
861
    lastComparison = Boolean.valueOf(isSetBrand()).compareTo(isSetBrand());
860
    lastComparison = Boolean.valueOf(isSetBrand()).compareTo(isSetBrand());
862
    if (lastComparison != 0) {
861
    if (lastComparison != 0) {
Line 961... Line 960...
961
              setIdIsSet(true);
960
              setIdIsSet(true);
962
            } else { 
961
            } else { 
963
              TProtocolUtil.skip(iprot, field.type);
962
              TProtocolUtil.skip(iprot, field.type);
964
            }
963
            }
965
            break;
964
            break;
966
          case SKU_ID:
965
          case ITEM_ID:
967
            if (field.type == TType.STRING) {
966
            if (field.type == TType.I64) {
968
              this.sku_id = iprot.readString();
967
              this.item_id = iprot.readI64();
-
 
968
              setItem_idIsSet(true);
969
            } else { 
969
            } else { 
970
              TProtocolUtil.skip(iprot, field.type);
970
              TProtocolUtil.skip(iprot, field.type);
971
            }
971
            }
972
            break;
972
            break;
973
          case BRAND:
973
          case BRAND:
Line 1058... Line 1058...
1058
 
1058
 
1059
    oprot.writeStructBegin(STRUCT_DESC);
1059
    oprot.writeStructBegin(STRUCT_DESC);
1060
    oprot.writeFieldBegin(ID_FIELD_DESC);
1060
    oprot.writeFieldBegin(ID_FIELD_DESC);
1061
    oprot.writeI64(this.id);
1061
    oprot.writeI64(this.id);
1062
    oprot.writeFieldEnd();
1062
    oprot.writeFieldEnd();
1063
    if (this.sku_id != null) {
-
 
1064
      oprot.writeFieldBegin(SKU_ID_FIELD_DESC);
1063
    oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
1065
      oprot.writeString(this.sku_id);
1064
    oprot.writeI64(this.item_id);
1066
      oprot.writeFieldEnd();
1065
    oprot.writeFieldEnd();
1067
    }
-
 
1068
    if (this.brand != null) {
1066
    if (this.brand != null) {
1069
      oprot.writeFieldBegin(BRAND_FIELD_DESC);
1067
      oprot.writeFieldBegin(BRAND_FIELD_DESC);
1070
      oprot.writeString(this.brand);
1068
      oprot.writeString(this.brand);
1071
      oprot.writeFieldEnd();
1069
      oprot.writeFieldEnd();
1072
    }
1070
    }
Line 1116... Line 1114...
1116
 
1114
 
1117
    sb.append("id:");
1115
    sb.append("id:");
1118
    sb.append(this.id);
1116
    sb.append(this.id);
1119
    first = false;
1117
    first = false;
1120
    if (!first) sb.append(", ");
1118
    if (!first) sb.append(", ");
1121
    sb.append("sku_id:");
1119
    sb.append("item_id:");
1122
    if (this.sku_id == null) {
-
 
1123
      sb.append("null");
-
 
1124
    } else {
-
 
1125
      sb.append(this.sku_id);
1120
    sb.append(this.item_id);
1126
    }
-
 
1127
    first = false;
1121
    first = false;
1128
    if (!first) sb.append(", ");
1122
    if (!first) sb.append(", ");
1129
    sb.append("brand:");
1123
    sb.append("brand:");
1130
    if (this.brand == null) {
1124
    if (this.brand == null) {
1131
      sb.append("null");
1125
      sb.append("null");