Subversion Repositories SmartDukaan

Rev

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

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