Subversion Repositories SmartDukaan

Rev

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

Rev 1013 Rev 1022
Line 36... Line 36...
36
  private static final TField EXTRA_INFO_FIELD_DESC = new TField("extra_info", TType.STRING, (short)8);
36
  private static final TField EXTRA_INFO_FIELD_DESC = new TField("extra_info", TType.STRING, (short)8);
37
  private static final TField QUANTITY_FIELD_DESC = new TField("quantity", TType.DOUBLE, (short)9);
37
  private static final TField QUANTITY_FIELD_DESC = new TField("quantity", TType.DOUBLE, (short)9);
38
  private static final TField UNIT_PRICE_FIELD_DESC = new TField("unit_price", TType.DOUBLE, (short)10);
38
  private static final TField UNIT_PRICE_FIELD_DESC = new TField("unit_price", TType.DOUBLE, (short)10);
39
  private static final TField UNIT_WEIGHT_FIELD_DESC = new TField("unit_weight", TType.DOUBLE, (short)11);
39
  private static final TField UNIT_WEIGHT_FIELD_DESC = new TField("unit_weight", TType.DOUBLE, (short)11);
40
  private static final TField TOTAL_PRICE_FIELD_DESC = new TField("total_price", TType.DOUBLE, (short)12);
40
  private static final TField TOTAL_PRICE_FIELD_DESC = new TField("total_price", TType.DOUBLE, (short)12);
-
 
41
  private static final TField TRANSFER_PRICE_FIELD_DESC = new TField("transfer_price", TType.DOUBLE, (short)13);
41
  private static final TField TOTAL_WEIGHT_FIELD_DESC = new TField("total_weight", TType.DOUBLE, (short)13);
42
  private static final TField TOTAL_WEIGHT_FIELD_DESC = new TField("total_weight", TType.DOUBLE, (short)14);
42
 
43
 
43
  private long id;
44
  private long id;
44
  private long item_id;
45
  private long item_id;
45
  private String productGroup;
46
  private String productGroup;
46
  private String brand;
47
  private String brand;
Line 50... Line 51...
50
  private String extra_info;
51
  private String extra_info;
51
  private double quantity;
52
  private double quantity;
52
  private double unit_price;
53
  private double unit_price;
53
  private double unit_weight;
54
  private double unit_weight;
54
  private double total_price;
55
  private double total_price;
-
 
56
  private double transfer_price;
55
  private double total_weight;
57
  private double total_weight;
56
 
58
 
57
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
59
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
58
  public enum _Fields implements TFieldIdEnum {
60
  public enum _Fields implements TFieldIdEnum {
59
    ID((short)1, "id"),
61
    ID((short)1, "id"),
Line 66... Line 68...
66
    EXTRA_INFO((short)8, "extra_info"),
68
    EXTRA_INFO((short)8, "extra_info"),
67
    QUANTITY((short)9, "quantity"),
69
    QUANTITY((short)9, "quantity"),
68
    UNIT_PRICE((short)10, "unit_price"),
70
    UNIT_PRICE((short)10, "unit_price"),
69
    UNIT_WEIGHT((short)11, "unit_weight"),
71
    UNIT_WEIGHT((short)11, "unit_weight"),
70
    TOTAL_PRICE((short)12, "total_price"),
72
    TOTAL_PRICE((short)12, "total_price"),
-
 
73
    TRANSFER_PRICE((short)13, "transfer_price"),
71
    TOTAL_WEIGHT((short)13, "total_weight");
74
    TOTAL_WEIGHT((short)14, "total_weight");
72
 
75
 
73
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
76
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
74
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
77
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
75
 
78
 
76
    static {
79
    static {
Line 126... Line 129...
126
  private static final int __ITEM_ID_ISSET_ID = 1;
129
  private static final int __ITEM_ID_ISSET_ID = 1;
127
  private static final int __QUANTITY_ISSET_ID = 2;
130
  private static final int __QUANTITY_ISSET_ID = 2;
128
  private static final int __UNIT_PRICE_ISSET_ID = 3;
131
  private static final int __UNIT_PRICE_ISSET_ID = 3;
129
  private static final int __UNIT_WEIGHT_ISSET_ID = 4;
132
  private static final int __UNIT_WEIGHT_ISSET_ID = 4;
130
  private static final int __TOTAL_PRICE_ISSET_ID = 5;
133
  private static final int __TOTAL_PRICE_ISSET_ID = 5;
-
 
134
  private static final int __TRANSFER_PRICE_ISSET_ID = 6;
131
  private static final int __TOTAL_WEIGHT_ISSET_ID = 6;
135
  private static final int __TOTAL_WEIGHT_ISSET_ID = 7;
132
  private BitSet __isset_bit_vector = new BitSet(7);
136
  private BitSet __isset_bit_vector = new BitSet(8);
133
 
137
 
134
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
138
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
135
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
139
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
136
        new FieldValueMetaData(TType.I64)));
140
        new FieldValueMetaData(TType.I64)));
137
    put(_Fields.ITEM_ID, new FieldMetaData("item_id", TFieldRequirementType.DEFAULT, 
141
    put(_Fields.ITEM_ID, new FieldMetaData("item_id", TFieldRequirementType.DEFAULT, 
Line 154... Line 158...
154
        new FieldValueMetaData(TType.DOUBLE)));
158
        new FieldValueMetaData(TType.DOUBLE)));
155
    put(_Fields.UNIT_WEIGHT, new FieldMetaData("unit_weight", TFieldRequirementType.DEFAULT, 
159
    put(_Fields.UNIT_WEIGHT, new FieldMetaData("unit_weight", TFieldRequirementType.DEFAULT, 
156
        new FieldValueMetaData(TType.DOUBLE)));
160
        new FieldValueMetaData(TType.DOUBLE)));
157
    put(_Fields.TOTAL_PRICE, new FieldMetaData("total_price", TFieldRequirementType.DEFAULT, 
161
    put(_Fields.TOTAL_PRICE, new FieldMetaData("total_price", TFieldRequirementType.DEFAULT, 
158
        new FieldValueMetaData(TType.DOUBLE)));
162
        new FieldValueMetaData(TType.DOUBLE)));
-
 
163
    put(_Fields.TRANSFER_PRICE, new FieldMetaData("transfer_price", TFieldRequirementType.DEFAULT, 
-
 
164
        new FieldValueMetaData(TType.DOUBLE)));
159
    put(_Fields.TOTAL_WEIGHT, new FieldMetaData("total_weight", TFieldRequirementType.DEFAULT, 
165
    put(_Fields.TOTAL_WEIGHT, new FieldMetaData("total_weight", TFieldRequirementType.DEFAULT, 
160
        new FieldValueMetaData(TType.DOUBLE)));
166
        new FieldValueMetaData(TType.DOUBLE)));
161
  }});
167
  }});
162
 
168
 
163
  static {
169
  static {
Line 178... Line 184...
178
    String extra_info,
184
    String extra_info,
179
    double quantity,
185
    double quantity,
180
    double unit_price,
186
    double unit_price,
181
    double unit_weight,
187
    double unit_weight,
182
    double total_price,
188
    double total_price,
-
 
189
    double transfer_price,
183
    double total_weight)
190
    double total_weight)
184
  {
191
  {
185
    this();
192
    this();
186
    this.id = id;
193
    this.id = id;
187
    setIdIsSet(true);
194
    setIdIsSet(true);
Line 199... Line 206...
199
    setUnit_priceIsSet(true);
206
    setUnit_priceIsSet(true);
200
    this.unit_weight = unit_weight;
207
    this.unit_weight = unit_weight;
201
    setUnit_weightIsSet(true);
208
    setUnit_weightIsSet(true);
202
    this.total_price = total_price;
209
    this.total_price = total_price;
203
    setTotal_priceIsSet(true);
210
    setTotal_priceIsSet(true);
-
 
211
    this.transfer_price = transfer_price;
-
 
212
    setTransfer_priceIsSet(true);
204
    this.total_weight = total_weight;
213
    this.total_weight = total_weight;
205
    setTotal_weightIsSet(true);
214
    setTotal_weightIsSet(true);
206
  }
215
  }
207
 
216
 
208
  /**
217
  /**
Line 233... Line 242...
233
    }
242
    }
234
    this.quantity = other.quantity;
243
    this.quantity = other.quantity;
235
    this.unit_price = other.unit_price;
244
    this.unit_price = other.unit_price;
236
    this.unit_weight = other.unit_weight;
245
    this.unit_weight = other.unit_weight;
237
    this.total_price = other.total_price;
246
    this.total_price = other.total_price;
-
 
247
    this.transfer_price = other.transfer_price;
238
    this.total_weight = other.total_weight;
248
    this.total_weight = other.total_weight;
239
  }
249
  }
240
 
250
 
241
  public LineItem deepCopy() {
251
  public LineItem deepCopy() {
242
    return new LineItem(this);
252
    return new LineItem(this);
Line 527... Line 537...
527
 
537
 
528
  public void setTotal_priceIsSet(boolean value) {
538
  public void setTotal_priceIsSet(boolean value) {
529
    __isset_bit_vector.set(__TOTAL_PRICE_ISSET_ID, value);
539
    __isset_bit_vector.set(__TOTAL_PRICE_ISSET_ID, value);
530
  }
540
  }
531
 
541
 
-
 
542
  public double getTransfer_price() {
-
 
543
    return this.transfer_price;
-
 
544
  }
-
 
545
 
-
 
546
  public LineItem setTransfer_price(double transfer_price) {
-
 
547
    this.transfer_price = transfer_price;
-
 
548
    setTransfer_priceIsSet(true);
-
 
549
    return this;
-
 
550
  }
-
 
551
 
-
 
552
  public void unsetTransfer_price() {
-
 
553
    __isset_bit_vector.clear(__TRANSFER_PRICE_ISSET_ID);
-
 
554
  }
-
 
555
 
-
 
556
  /** Returns true if field transfer_price is set (has been asigned a value) and false otherwise */
-
 
557
  public boolean isSetTransfer_price() {
-
 
558
    return __isset_bit_vector.get(__TRANSFER_PRICE_ISSET_ID);
-
 
559
  }
-
 
560
 
-
 
561
  public void setTransfer_priceIsSet(boolean value) {
-
 
562
    __isset_bit_vector.set(__TRANSFER_PRICE_ISSET_ID, value);
-
 
563
  }
-
 
564
 
532
  public double getTotal_weight() {
565
  public double getTotal_weight() {
533
    return this.total_weight;
566
    return this.total_weight;
534
  }
567
  }
535
 
568
 
536
  public LineItem setTotal_weight(double total_weight) {
569
  public LineItem setTotal_weight(double total_weight) {
Line 648... Line 681...
648
      } else {
681
      } else {
649
        setTotal_price((Double)value);
682
        setTotal_price((Double)value);
650
      }
683
      }
651
      break;
684
      break;
652
 
685
 
-
 
686
    case TRANSFER_PRICE:
-
 
687
      if (value == null) {
-
 
688
        unsetTransfer_price();
-
 
689
      } else {
-
 
690
        setTransfer_price((Double)value);
-
 
691
      }
-
 
692
      break;
-
 
693
 
653
    case TOTAL_WEIGHT:
694
    case TOTAL_WEIGHT:
654
      if (value == null) {
695
      if (value == null) {
655
        unsetTotal_weight();
696
        unsetTotal_weight();
656
      } else {
697
      } else {
657
        setTotal_weight((Double)value);
698
        setTotal_weight((Double)value);
Line 701... Line 742...
701
      return new Double(getUnit_weight());
742
      return new Double(getUnit_weight());
702
 
743
 
703
    case TOTAL_PRICE:
744
    case TOTAL_PRICE:
704
      return new Double(getTotal_price());
745
      return new Double(getTotal_price());
705
 
746
 
-
 
747
    case TRANSFER_PRICE:
-
 
748
      return new Double(getTransfer_price());
-
 
749
 
706
    case TOTAL_WEIGHT:
750
    case TOTAL_WEIGHT:
707
      return new Double(getTotal_weight());
751
      return new Double(getTotal_weight());
708
 
752
 
709
    }
753
    }
710
    throw new IllegalStateException();
754
    throw new IllegalStateException();
Line 739... Line 783...
739
      return isSetUnit_price();
783
      return isSetUnit_price();
740
    case UNIT_WEIGHT:
784
    case UNIT_WEIGHT:
741
      return isSetUnit_weight();
785
      return isSetUnit_weight();
742
    case TOTAL_PRICE:
786
    case TOTAL_PRICE:
743
      return isSetTotal_price();
787
      return isSetTotal_price();
-
 
788
    case TRANSFER_PRICE:
-
 
789
      return isSetTransfer_price();
744
    case TOTAL_WEIGHT:
790
    case TOTAL_WEIGHT:
745
      return isSetTotal_weight();
791
      return isSetTotal_weight();
746
    }
792
    }
747
    throw new IllegalStateException();
793
    throw new IllegalStateException();
748
  }
794
  }
Line 870... Line 916...
870
        return false;
916
        return false;
871
      if (this.total_price != that.total_price)
917
      if (this.total_price != that.total_price)
872
        return false;
918
        return false;
873
    }
919
    }
874
 
920
 
-
 
921
    boolean this_present_transfer_price = true;
-
 
922
    boolean that_present_transfer_price = true;
-
 
923
    if (this_present_transfer_price || that_present_transfer_price) {
-
 
924
      if (!(this_present_transfer_price && that_present_transfer_price))
-
 
925
        return false;
-
 
926
      if (this.transfer_price != that.transfer_price)
-
 
927
        return false;
-
 
928
    }
-
 
929
 
875
    boolean this_present_total_weight = true;
930
    boolean this_present_total_weight = true;
876
    boolean that_present_total_weight = true;
931
    boolean that_present_total_weight = true;
877
    if (this_present_total_weight || that_present_total_weight) {
932
    if (this_present_total_weight || that_present_total_weight) {
878
      if (!(this_present_total_weight && that_present_total_weight))
933
      if (!(this_present_total_weight && that_present_total_weight))
879
        return false;
934
        return false;
Line 991... Line 1046...
991
    }
1046
    }
992
    lastComparison = TBaseHelper.compareTo(total_price, typedOther.total_price);
1047
    lastComparison = TBaseHelper.compareTo(total_price, typedOther.total_price);
993
    if (lastComparison != 0) {
1048
    if (lastComparison != 0) {
994
      return lastComparison;
1049
      return lastComparison;
995
    }
1050
    }
-
 
1051
    lastComparison = Boolean.valueOf(isSetTransfer_price()).compareTo(isSetTransfer_price());
-
 
1052
    if (lastComparison != 0) {
-
 
1053
      return lastComparison;
-
 
1054
    }
-
 
1055
    lastComparison = TBaseHelper.compareTo(transfer_price, typedOther.transfer_price);
-
 
1056
    if (lastComparison != 0) {
-
 
1057
      return lastComparison;
-
 
1058
    }
996
    lastComparison = Boolean.valueOf(isSetTotal_weight()).compareTo(isSetTotal_weight());
1059
    lastComparison = Boolean.valueOf(isSetTotal_weight()).compareTo(isSetTotal_weight());
997
    if (lastComparison != 0) {
1060
    if (lastComparison != 0) {
998
      return lastComparison;
1061
      return lastComparison;
999
    }
1062
    }
1000
    lastComparison = TBaseHelper.compareTo(total_weight, typedOther.total_weight);
1063
    lastComparison = TBaseHelper.compareTo(total_weight, typedOther.total_weight);
Line 1106... Line 1169...
1106
              setTotal_priceIsSet(true);
1169
              setTotal_priceIsSet(true);
1107
            } else { 
1170
            } else { 
1108
              TProtocolUtil.skip(iprot, field.type);
1171
              TProtocolUtil.skip(iprot, field.type);
1109
            }
1172
            }
1110
            break;
1173
            break;
-
 
1174
          case TRANSFER_PRICE:
-
 
1175
            if (field.type == TType.DOUBLE) {
-
 
1176
              this.transfer_price = iprot.readDouble();
-
 
1177
              setTransfer_priceIsSet(true);
-
 
1178
            } else { 
-
 
1179
              TProtocolUtil.skip(iprot, field.type);
-
 
1180
            }
-
 
1181
            break;
1111
          case TOTAL_WEIGHT:
1182
          case TOTAL_WEIGHT:
1112
            if (field.type == TType.DOUBLE) {
1183
            if (field.type == TType.DOUBLE) {
1113
              this.total_weight = iprot.readDouble();
1184
              this.total_weight = iprot.readDouble();
1114
              setTotal_weightIsSet(true);
1185
              setTotal_weightIsSet(true);
1115
            } else { 
1186
            } else { 
Line 1174... Line 1245...
1174
    oprot.writeDouble(this.unit_weight);
1245
    oprot.writeDouble(this.unit_weight);
1175
    oprot.writeFieldEnd();
1246
    oprot.writeFieldEnd();
1176
    oprot.writeFieldBegin(TOTAL_PRICE_FIELD_DESC);
1247
    oprot.writeFieldBegin(TOTAL_PRICE_FIELD_DESC);
1177
    oprot.writeDouble(this.total_price);
1248
    oprot.writeDouble(this.total_price);
1178
    oprot.writeFieldEnd();
1249
    oprot.writeFieldEnd();
-
 
1250
    oprot.writeFieldBegin(TRANSFER_PRICE_FIELD_DESC);
-
 
1251
    oprot.writeDouble(this.transfer_price);
-
 
1252
    oprot.writeFieldEnd();
1179
    oprot.writeFieldBegin(TOTAL_WEIGHT_FIELD_DESC);
1253
    oprot.writeFieldBegin(TOTAL_WEIGHT_FIELD_DESC);
1180
    oprot.writeDouble(this.total_weight);
1254
    oprot.writeDouble(this.total_weight);
1181
    oprot.writeFieldEnd();
1255
    oprot.writeFieldEnd();
1182
    oprot.writeFieldStop();
1256
    oprot.writeFieldStop();
1183
    oprot.writeStructEnd();
1257
    oprot.writeStructEnd();
Line 1258... Line 1332...
1258
    if (!first) sb.append(", ");
1332
    if (!first) sb.append(", ");
1259
    sb.append("total_price:");
1333
    sb.append("total_price:");
1260
    sb.append(this.total_price);
1334
    sb.append(this.total_price);
1261
    first = false;
1335
    first = false;
1262
    if (!first) sb.append(", ");
1336
    if (!first) sb.append(", ");
-
 
1337
    sb.append("transfer_price:");
-
 
1338
    sb.append(this.transfer_price);
-
 
1339
    first = false;
-
 
1340
    if (!first) sb.append(", ");
1263
    sb.append("total_weight:");
1341
    sb.append("total_weight:");
1264
    sb.append(this.total_weight);
1342
    sb.append(this.total_weight);
1265
    first = false;
1343
    first = false;
1266
    sb.append(")");
1344
    sb.append(")");
1267
    return sb.toString();
1345
    return sb.toString();