Subversion Repositories SmartDukaan

Rev

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

Rev 1022 Rev 1982
Line 38... Line 38...
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 TRANSFER_PRICE_FIELD_DESC = new TField("transfer_price", TType.DOUBLE, (short)13);
42
  private static final TField TOTAL_WEIGHT_FIELD_DESC = new TField("total_weight", TType.DOUBLE, (short)14);
42
  private static final TField TOTAL_WEIGHT_FIELD_DESC = new TField("total_weight", TType.DOUBLE, (short)14);
-
 
43
  private static final TField DISCOUNTED_PRICE_FIELD_DESC = new TField("discounted_price", TType.DOUBLE, (short)15);
43
 
44
 
44
  private long id;
45
  private long id;
45
  private long item_id;
46
  private long item_id;
46
  private String productGroup;
47
  private String productGroup;
47
  private String brand;
48
  private String brand;
Line 53... Line 54...
53
  private double unit_price;
54
  private double unit_price;
54
  private double unit_weight;
55
  private double unit_weight;
55
  private double total_price;
56
  private double total_price;
56
  private double transfer_price;
57
  private double transfer_price;
57
  private double total_weight;
58
  private double total_weight;
-
 
59
  private double discounted_price;
58
 
60
 
59
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
61
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
60
  public enum _Fields implements TFieldIdEnum {
62
  public enum _Fields implements TFieldIdEnum {
61
    ID((short)1, "id"),
63
    ID((short)1, "id"),
62
    ITEM_ID((short)2, "item_id"),
64
    ITEM_ID((short)2, "item_id"),
Line 69... Line 71...
69
    QUANTITY((short)9, "quantity"),
71
    QUANTITY((short)9, "quantity"),
70
    UNIT_PRICE((short)10, "unit_price"),
72
    UNIT_PRICE((short)10, "unit_price"),
71
    UNIT_WEIGHT((short)11, "unit_weight"),
73
    UNIT_WEIGHT((short)11, "unit_weight"),
72
    TOTAL_PRICE((short)12, "total_price"),
74
    TOTAL_PRICE((short)12, "total_price"),
73
    TRANSFER_PRICE((short)13, "transfer_price"),
75
    TRANSFER_PRICE((short)13, "transfer_price"),
74
    TOTAL_WEIGHT((short)14, "total_weight");
76
    TOTAL_WEIGHT((short)14, "total_weight"),
-
 
77
    DISCOUNTED_PRICE((short)15, "discounted_price");
75
 
78
 
76
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
79
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
77
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
80
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
78
 
81
 
79
    static {
82
    static {
Line 131... Line 134...
131
  private static final int __UNIT_PRICE_ISSET_ID = 3;
134
  private static final int __UNIT_PRICE_ISSET_ID = 3;
132
  private static final int __UNIT_WEIGHT_ISSET_ID = 4;
135
  private static final int __UNIT_WEIGHT_ISSET_ID = 4;
133
  private static final int __TOTAL_PRICE_ISSET_ID = 5;
136
  private static final int __TOTAL_PRICE_ISSET_ID = 5;
134
  private static final int __TRANSFER_PRICE_ISSET_ID = 6;
137
  private static final int __TRANSFER_PRICE_ISSET_ID = 6;
135
  private static final int __TOTAL_WEIGHT_ISSET_ID = 7;
138
  private static final int __TOTAL_WEIGHT_ISSET_ID = 7;
-
 
139
  private static final int __DISCOUNTED_PRICE_ISSET_ID = 8;
136
  private BitSet __isset_bit_vector = new BitSet(8);
140
  private BitSet __isset_bit_vector = new BitSet(9);
137
 
141
 
138
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
142
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
139
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
143
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
140
        new FieldValueMetaData(TType.I64)));
144
        new FieldValueMetaData(TType.I64)));
141
    put(_Fields.ITEM_ID, new FieldMetaData("item_id", TFieldRequirementType.DEFAULT, 
145
    put(_Fields.ITEM_ID, new FieldMetaData("item_id", TFieldRequirementType.DEFAULT, 
Line 162... Line 166...
162
        new FieldValueMetaData(TType.DOUBLE)));
166
        new FieldValueMetaData(TType.DOUBLE)));
163
    put(_Fields.TRANSFER_PRICE, new FieldMetaData("transfer_price", TFieldRequirementType.DEFAULT, 
167
    put(_Fields.TRANSFER_PRICE, new FieldMetaData("transfer_price", TFieldRequirementType.DEFAULT, 
164
        new FieldValueMetaData(TType.DOUBLE)));
168
        new FieldValueMetaData(TType.DOUBLE)));
165
    put(_Fields.TOTAL_WEIGHT, new FieldMetaData("total_weight", TFieldRequirementType.DEFAULT, 
169
    put(_Fields.TOTAL_WEIGHT, new FieldMetaData("total_weight", TFieldRequirementType.DEFAULT, 
166
        new FieldValueMetaData(TType.DOUBLE)));
170
        new FieldValueMetaData(TType.DOUBLE)));
-
 
171
    put(_Fields.DISCOUNTED_PRICE, new FieldMetaData("discounted_price", TFieldRequirementType.DEFAULT, 
-
 
172
        new FieldValueMetaData(TType.DOUBLE)));
167
  }});
173
  }});
168
 
174
 
169
  static {
175
  static {
170
    FieldMetaData.addStructMetaDataMap(LineItem.class, metaDataMap);
176
    FieldMetaData.addStructMetaDataMap(LineItem.class, metaDataMap);
171
  }
177
  }
Line 185... Line 191...
185
    double quantity,
191
    double quantity,
186
    double unit_price,
192
    double unit_price,
187
    double unit_weight,
193
    double unit_weight,
188
    double total_price,
194
    double total_price,
189
    double transfer_price,
195
    double transfer_price,
190
    double total_weight)
196
    double total_weight,
-
 
197
    double discounted_price)
191
  {
198
  {
192
    this();
199
    this();
193
    this.id = id;
200
    this.id = id;
194
    setIdIsSet(true);
201
    setIdIsSet(true);
195
    this.item_id = item_id;
202
    this.item_id = item_id;
Line 210... Line 217...
210
    setTotal_priceIsSet(true);
217
    setTotal_priceIsSet(true);
211
    this.transfer_price = transfer_price;
218
    this.transfer_price = transfer_price;
212
    setTransfer_priceIsSet(true);
219
    setTransfer_priceIsSet(true);
213
    this.total_weight = total_weight;
220
    this.total_weight = total_weight;
214
    setTotal_weightIsSet(true);
221
    setTotal_weightIsSet(true);
-
 
222
    this.discounted_price = discounted_price;
-
 
223
    setDiscounted_priceIsSet(true);
215
  }
224
  }
216
 
225
 
217
  /**
226
  /**
218
   * Performs a deep copy on <i>other</i>.
227
   * Performs a deep copy on <i>other</i>.
219
   */
228
   */
Line 244... Line 253...
244
    this.unit_price = other.unit_price;
253
    this.unit_price = other.unit_price;
245
    this.unit_weight = other.unit_weight;
254
    this.unit_weight = other.unit_weight;
246
    this.total_price = other.total_price;
255
    this.total_price = other.total_price;
247
    this.transfer_price = other.transfer_price;
256
    this.transfer_price = other.transfer_price;
248
    this.total_weight = other.total_weight;
257
    this.total_weight = other.total_weight;
-
 
258
    this.discounted_price = other.discounted_price;
249
  }
259
  }
250
 
260
 
251
  public LineItem deepCopy() {
261
  public LineItem deepCopy() {
252
    return new LineItem(this);
262
    return new LineItem(this);
253
  }
263
  }
Line 583... Line 593...
583
 
593
 
584
  public void setTotal_weightIsSet(boolean value) {
594
  public void setTotal_weightIsSet(boolean value) {
585
    __isset_bit_vector.set(__TOTAL_WEIGHT_ISSET_ID, value);
595
    __isset_bit_vector.set(__TOTAL_WEIGHT_ISSET_ID, value);
586
  }
596
  }
587
 
597
 
-
 
598
  public double getDiscounted_price() {
-
 
599
    return this.discounted_price;
-
 
600
  }
-
 
601
 
-
 
602
  public LineItem setDiscounted_price(double discounted_price) {
-
 
603
    this.discounted_price = discounted_price;
-
 
604
    setDiscounted_priceIsSet(true);
-
 
605
    return this;
-
 
606
  }
-
 
607
 
-
 
608
  public void unsetDiscounted_price() {
-
 
609
    __isset_bit_vector.clear(__DISCOUNTED_PRICE_ISSET_ID);
-
 
610
  }
-
 
611
 
-
 
612
  /** Returns true if field discounted_price is set (has been asigned a value) and false otherwise */
-
 
613
  public boolean isSetDiscounted_price() {
-
 
614
    return __isset_bit_vector.get(__DISCOUNTED_PRICE_ISSET_ID);
-
 
615
  }
-
 
616
 
-
 
617
  public void setDiscounted_priceIsSet(boolean value) {
-
 
618
    __isset_bit_vector.set(__DISCOUNTED_PRICE_ISSET_ID, value);
-
 
619
  }
-
 
620
 
588
  public void setFieldValue(_Fields field, Object value) {
621
  public void setFieldValue(_Fields field, Object value) {
589
    switch (field) {
622
    switch (field) {
590
    case ID:
623
    case ID:
591
      if (value == null) {
624
      if (value == null) {
592
        unsetId();
625
        unsetId();
Line 697... Line 730...
697
      } else {
730
      } else {
698
        setTotal_weight((Double)value);
731
        setTotal_weight((Double)value);
699
      }
732
      }
700
      break;
733
      break;
701
 
734
 
-
 
735
    case DISCOUNTED_PRICE:
-
 
736
      if (value == null) {
-
 
737
        unsetDiscounted_price();
-
 
738
      } else {
-
 
739
        setDiscounted_price((Double)value);
-
 
740
      }
-
 
741
      break;
-
 
742
 
702
    }
743
    }
703
  }
744
  }
704
 
745
 
705
  public void setFieldValue(int fieldID, Object value) {
746
  public void setFieldValue(int fieldID, Object value) {
706
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
747
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
Line 748... Line 789...
748
      return new Double(getTransfer_price());
789
      return new Double(getTransfer_price());
749
 
790
 
750
    case TOTAL_WEIGHT:
791
    case TOTAL_WEIGHT:
751
      return new Double(getTotal_weight());
792
      return new Double(getTotal_weight());
752
 
793
 
-
 
794
    case DISCOUNTED_PRICE:
-
 
795
      return new Double(getDiscounted_price());
-
 
796
 
753
    }
797
    }
754
    throw new IllegalStateException();
798
    throw new IllegalStateException();
755
  }
799
  }
756
 
800
 
757
  public Object getFieldValue(int fieldId) {
801
  public Object getFieldValue(int fieldId) {
Line 787... Line 831...
787
      return isSetTotal_price();
831
      return isSetTotal_price();
788
    case TRANSFER_PRICE:
832
    case TRANSFER_PRICE:
789
      return isSetTransfer_price();
833
      return isSetTransfer_price();
790
    case TOTAL_WEIGHT:
834
    case TOTAL_WEIGHT:
791
      return isSetTotal_weight();
835
      return isSetTotal_weight();
-
 
836
    case DISCOUNTED_PRICE:
-
 
837
      return isSetDiscounted_price();
792
    }
838
    }
793
    throw new IllegalStateException();
839
    throw new IllegalStateException();
794
  }
840
  }
795
 
841
 
796
  public boolean isSet(int fieldID) {
842
  public boolean isSet(int fieldID) {
Line 934... Line 980...
934
        return false;
980
        return false;
935
      if (this.total_weight != that.total_weight)
981
      if (this.total_weight != that.total_weight)
936
        return false;
982
        return false;
937
    }
983
    }
938
 
984
 
-
 
985
    boolean this_present_discounted_price = true;
-
 
986
    boolean that_present_discounted_price = true;
-
 
987
    if (this_present_discounted_price || that_present_discounted_price) {
-
 
988
      if (!(this_present_discounted_price && that_present_discounted_price))
-
 
989
        return false;
-
 
990
      if (this.discounted_price != that.discounted_price)
-
 
991
        return false;
-
 
992
    }
-
 
993
 
939
    return true;
994
    return true;
940
  }
995
  }
941
 
996
 
942
  @Override
997
  @Override
943
  public int hashCode() {
998
  public int hashCode() {
Line 1062... Line 1117...
1062
    }
1117
    }
1063
    lastComparison = TBaseHelper.compareTo(total_weight, typedOther.total_weight);
1118
    lastComparison = TBaseHelper.compareTo(total_weight, typedOther.total_weight);
1064
    if (lastComparison != 0) {
1119
    if (lastComparison != 0) {
1065
      return lastComparison;
1120
      return lastComparison;
1066
    }
1121
    }
-
 
1122
    lastComparison = Boolean.valueOf(isSetDiscounted_price()).compareTo(isSetDiscounted_price());
-
 
1123
    if (lastComparison != 0) {
-
 
1124
      return lastComparison;
-
 
1125
    }
-
 
1126
    lastComparison = TBaseHelper.compareTo(discounted_price, typedOther.discounted_price);
-
 
1127
    if (lastComparison != 0) {
-
 
1128
      return lastComparison;
-
 
1129
    }
1067
    return 0;
1130
    return 0;
1068
  }
1131
  }
1069
 
1132
 
1070
  public void read(TProtocol iprot) throws TException {
1133
  public void read(TProtocol iprot) throws TException {
1071
    TField field;
1134
    TField field;
Line 1185... Line 1248...
1185
              setTotal_weightIsSet(true);
1248
              setTotal_weightIsSet(true);
1186
            } else { 
1249
            } else { 
1187
              TProtocolUtil.skip(iprot, field.type);
1250
              TProtocolUtil.skip(iprot, field.type);
1188
            }
1251
            }
1189
            break;
1252
            break;
-
 
1253
          case DISCOUNTED_PRICE:
-
 
1254
            if (field.type == TType.DOUBLE) {
-
 
1255
              this.discounted_price = iprot.readDouble();
-
 
1256
              setDiscounted_priceIsSet(true);
-
 
1257
            } else { 
-
 
1258
              TProtocolUtil.skip(iprot, field.type);
-
 
1259
            }
-
 
1260
            break;
1190
        }
1261
        }
1191
        iprot.readFieldEnd();
1262
        iprot.readFieldEnd();
1192
      }
1263
      }
1193
    }
1264
    }
1194
    iprot.readStructEnd();
1265
    iprot.readStructEnd();
Line 1251... Line 1322...
1251
    oprot.writeDouble(this.transfer_price);
1322
    oprot.writeDouble(this.transfer_price);
1252
    oprot.writeFieldEnd();
1323
    oprot.writeFieldEnd();
1253
    oprot.writeFieldBegin(TOTAL_WEIGHT_FIELD_DESC);
1324
    oprot.writeFieldBegin(TOTAL_WEIGHT_FIELD_DESC);
1254
    oprot.writeDouble(this.total_weight);
1325
    oprot.writeDouble(this.total_weight);
1255
    oprot.writeFieldEnd();
1326
    oprot.writeFieldEnd();
-
 
1327
    oprot.writeFieldBegin(DISCOUNTED_PRICE_FIELD_DESC);
-
 
1328
    oprot.writeDouble(this.discounted_price);
-
 
1329
    oprot.writeFieldEnd();
1256
    oprot.writeFieldStop();
1330
    oprot.writeFieldStop();
1257
    oprot.writeStructEnd();
1331
    oprot.writeStructEnd();
1258
  }
1332
  }
1259
 
1333
 
1260
  @Override
1334
  @Override
Line 1339... Line 1413...
1339
    first = false;
1413
    first = false;
1340
    if (!first) sb.append(", ");
1414
    if (!first) sb.append(", ");
1341
    sb.append("total_weight:");
1415
    sb.append("total_weight:");
1342
    sb.append(this.total_weight);
1416
    sb.append(this.total_weight);
1343
    first = false;
1417
    first = false;
-
 
1418
    if (!first) sb.append(", ");
-
 
1419
    sb.append("discounted_price:");
-
 
1420
    sb.append(this.discounted_price);
-
 
1421
    first = false;
1344
    sb.append(")");
1422
    sb.append(")");
1345
    return sb.toString();
1423
    return sb.toString();
1346
  }
1424
  }
1347
 
1425
 
1348
  public void validate() throws TException {
1426
  public void validate() throws TException {