Subversion Repositories SmartDukaan

Rev

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

Rev 2383 Rev 2779
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 IMEI_NUMBER_FIELD_DESC = new TField("imei_number", TType.I64, (short)15);
-
 
44
  private static final TField ITEM_NUMBER_FIELD_DESC = new TField("item_number", TType.STRING, (short)16);
43
 
45
 
44
  private long id;
46
  private long id;
45
  private long item_id;
47
  private long item_id;
46
  private String productGroup;
48
  private String productGroup;
47
  private String brand;
49
  private String brand;
Line 53... Line 55...
53
  private double unit_price;
55
  private double unit_price;
54
  private double unit_weight;
56
  private double unit_weight;
55
  private double total_price;
57
  private double total_price;
56
  private double transfer_price;
58
  private double transfer_price;
57
  private double total_weight;
59
  private double total_weight;
-
 
60
  private long imei_number;
-
 
61
  private String item_number;
58
 
62
 
59
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
63
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
60
  public enum _Fields implements TFieldIdEnum {
64
  public enum _Fields implements TFieldIdEnum {
61
    ID((short)1, "id"),
65
    ID((short)1, "id"),
62
    ITEM_ID((short)2, "item_id"),
66
    ITEM_ID((short)2, "item_id"),
Line 69... Line 73...
69
    QUANTITY((short)9, "quantity"),
73
    QUANTITY((short)9, "quantity"),
70
    UNIT_PRICE((short)10, "unit_price"),
74
    UNIT_PRICE((short)10, "unit_price"),
71
    UNIT_WEIGHT((short)11, "unit_weight"),
75
    UNIT_WEIGHT((short)11, "unit_weight"),
72
    TOTAL_PRICE((short)12, "total_price"),
76
    TOTAL_PRICE((short)12, "total_price"),
73
    TRANSFER_PRICE((short)13, "transfer_price"),
77
    TRANSFER_PRICE((short)13, "transfer_price"),
74
    TOTAL_WEIGHT((short)14, "total_weight");
78
    TOTAL_WEIGHT((short)14, "total_weight"),
-
 
79
    IMEI_NUMBER((short)15, "imei_number"),
-
 
80
    ITEM_NUMBER((short)16, "item_number");
75
 
81
 
76
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
82
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
77
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
83
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
78
 
84
 
79
    static {
85
    static {
Line 131... Line 137...
131
  private static final int __UNIT_PRICE_ISSET_ID = 3;
137
  private static final int __UNIT_PRICE_ISSET_ID = 3;
132
  private static final int __UNIT_WEIGHT_ISSET_ID = 4;
138
  private static final int __UNIT_WEIGHT_ISSET_ID = 4;
133
  private static final int __TOTAL_PRICE_ISSET_ID = 5;
139
  private static final int __TOTAL_PRICE_ISSET_ID = 5;
134
  private static final int __TRANSFER_PRICE_ISSET_ID = 6;
140
  private static final int __TRANSFER_PRICE_ISSET_ID = 6;
135
  private static final int __TOTAL_WEIGHT_ISSET_ID = 7;
141
  private static final int __TOTAL_WEIGHT_ISSET_ID = 7;
-
 
142
  private static final int __IMEI_NUMBER_ISSET_ID = 8;
136
  private BitSet __isset_bit_vector = new BitSet(8);
143
  private BitSet __isset_bit_vector = new BitSet(9);
137
 
144
 
138
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
145
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
139
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
146
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
140
        new FieldValueMetaData(TType.I64)));
147
        new FieldValueMetaData(TType.I64)));
141
    put(_Fields.ITEM_ID, new FieldMetaData("item_id", TFieldRequirementType.DEFAULT, 
148
    put(_Fields.ITEM_ID, new FieldMetaData("item_id", TFieldRequirementType.DEFAULT, 
Line 162... Line 169...
162
        new FieldValueMetaData(TType.DOUBLE)));
169
        new FieldValueMetaData(TType.DOUBLE)));
163
    put(_Fields.TRANSFER_PRICE, new FieldMetaData("transfer_price", TFieldRequirementType.DEFAULT, 
170
    put(_Fields.TRANSFER_PRICE, new FieldMetaData("transfer_price", TFieldRequirementType.DEFAULT, 
164
        new FieldValueMetaData(TType.DOUBLE)));
171
        new FieldValueMetaData(TType.DOUBLE)));
165
    put(_Fields.TOTAL_WEIGHT, new FieldMetaData("total_weight", TFieldRequirementType.DEFAULT, 
172
    put(_Fields.TOTAL_WEIGHT, new FieldMetaData("total_weight", TFieldRequirementType.DEFAULT, 
166
        new FieldValueMetaData(TType.DOUBLE)));
173
        new FieldValueMetaData(TType.DOUBLE)));
-
 
174
    put(_Fields.IMEI_NUMBER, new FieldMetaData("imei_number", TFieldRequirementType.OPTIONAL, 
-
 
175
        new FieldValueMetaData(TType.I64)));
-
 
176
    put(_Fields.ITEM_NUMBER, new FieldMetaData("item_number", TFieldRequirementType.OPTIONAL, 
-
 
177
        new FieldValueMetaData(TType.STRING)));
167
  }});
178
  }});
168
 
179
 
169
  static {
180
  static {
170
    FieldMetaData.addStructMetaDataMap(LineItem.class, metaDataMap);
181
    FieldMetaData.addStructMetaDataMap(LineItem.class, metaDataMap);
171
  }
182
  }
Line 244... Line 255...
244
    this.unit_price = other.unit_price;
255
    this.unit_price = other.unit_price;
245
    this.unit_weight = other.unit_weight;
256
    this.unit_weight = other.unit_weight;
246
    this.total_price = other.total_price;
257
    this.total_price = other.total_price;
247
    this.transfer_price = other.transfer_price;
258
    this.transfer_price = other.transfer_price;
248
    this.total_weight = other.total_weight;
259
    this.total_weight = other.total_weight;
-
 
260
    this.imei_number = other.imei_number;
-
 
261
    if (other.isSetItem_number()) {
-
 
262
      this.item_number = other.item_number;
-
 
263
    }
249
  }
264
  }
250
 
265
 
251
  public LineItem deepCopy() {
266
  public LineItem deepCopy() {
252
    return new LineItem(this);
267
    return new LineItem(this);
253
  }
268
  }
Line 583... Line 598...
583
 
598
 
584
  public void setTotal_weightIsSet(boolean value) {
599
  public void setTotal_weightIsSet(boolean value) {
585
    __isset_bit_vector.set(__TOTAL_WEIGHT_ISSET_ID, value);
600
    __isset_bit_vector.set(__TOTAL_WEIGHT_ISSET_ID, value);
586
  }
601
  }
587
 
602
 
-
 
603
  public long getImei_number() {
-
 
604
    return this.imei_number;
-
 
605
  }
-
 
606
 
-
 
607
  public LineItem setImei_number(long imei_number) {
-
 
608
    this.imei_number = imei_number;
-
 
609
    setImei_numberIsSet(true);
-
 
610
    return this;
-
 
611
  }
-
 
612
 
-
 
613
  public void unsetImei_number() {
-
 
614
    __isset_bit_vector.clear(__IMEI_NUMBER_ISSET_ID);
-
 
615
  }
-
 
616
 
-
 
617
  /** Returns true if field imei_number is set (has been asigned a value) and false otherwise */
-
 
618
  public boolean isSetImei_number() {
-
 
619
    return __isset_bit_vector.get(__IMEI_NUMBER_ISSET_ID);
-
 
620
  }
-
 
621
 
-
 
622
  public void setImei_numberIsSet(boolean value) {
-
 
623
    __isset_bit_vector.set(__IMEI_NUMBER_ISSET_ID, value);
-
 
624
  }
-
 
625
 
-
 
626
  public String getItem_number() {
-
 
627
    return this.item_number;
-
 
628
  }
-
 
629
 
-
 
630
  public LineItem setItem_number(String item_number) {
-
 
631
    this.item_number = item_number;
-
 
632
    return this;
-
 
633
  }
-
 
634
 
-
 
635
  public void unsetItem_number() {
-
 
636
    this.item_number = null;
-
 
637
  }
-
 
638
 
-
 
639
  /** Returns true if field item_number is set (has been asigned a value) and false otherwise */
-
 
640
  public boolean isSetItem_number() {
-
 
641
    return this.item_number != null;
-
 
642
  }
-
 
643
 
-
 
644
  public void setItem_numberIsSet(boolean value) {
-
 
645
    if (!value) {
-
 
646
      this.item_number = null;
-
 
647
    }
-
 
648
  }
-
 
649
 
588
  public void setFieldValue(_Fields field, Object value) {
650
  public void setFieldValue(_Fields field, Object value) {
589
    switch (field) {
651
    switch (field) {
590
    case ID:
652
    case ID:
591
      if (value == null) {
653
      if (value == null) {
592
        unsetId();
654
        unsetId();
Line 697... Line 759...
697
      } else {
759
      } else {
698
        setTotal_weight((Double)value);
760
        setTotal_weight((Double)value);
699
      }
761
      }
700
      break;
762
      break;
701
 
763
 
-
 
764
    case IMEI_NUMBER:
-
 
765
      if (value == null) {
-
 
766
        unsetImei_number();
-
 
767
      } else {
-
 
768
        setImei_number((Long)value);
-
 
769
      }
-
 
770
      break;
-
 
771
 
-
 
772
    case ITEM_NUMBER:
-
 
773
      if (value == null) {
-
 
774
        unsetItem_number();
-
 
775
      } else {
-
 
776
        setItem_number((String)value);
-
 
777
      }
-
 
778
      break;
-
 
779
 
702
    }
780
    }
703
  }
781
  }
704
 
782
 
705
  public void setFieldValue(int fieldID, Object value) {
783
  public void setFieldValue(int fieldID, Object value) {
706
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
784
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
Line 748... Line 826...
748
      return new Double(getTransfer_price());
826
      return new Double(getTransfer_price());
749
 
827
 
750
    case TOTAL_WEIGHT:
828
    case TOTAL_WEIGHT:
751
      return new Double(getTotal_weight());
829
      return new Double(getTotal_weight());
752
 
830
 
-
 
831
    case IMEI_NUMBER:
-
 
832
      return new Long(getImei_number());
-
 
833
 
-
 
834
    case ITEM_NUMBER:
-
 
835
      return getItem_number();
-
 
836
 
753
    }
837
    }
754
    throw new IllegalStateException();
838
    throw new IllegalStateException();
755
  }
839
  }
756
 
840
 
757
  public Object getFieldValue(int fieldId) {
841
  public Object getFieldValue(int fieldId) {
Line 787... Line 871...
787
      return isSetTotal_price();
871
      return isSetTotal_price();
788
    case TRANSFER_PRICE:
872
    case TRANSFER_PRICE:
789
      return isSetTransfer_price();
873
      return isSetTransfer_price();
790
    case TOTAL_WEIGHT:
874
    case TOTAL_WEIGHT:
791
      return isSetTotal_weight();
875
      return isSetTotal_weight();
-
 
876
    case IMEI_NUMBER:
-
 
877
      return isSetImei_number();
-
 
878
    case ITEM_NUMBER:
-
 
879
      return isSetItem_number();
792
    }
880
    }
793
    throw new IllegalStateException();
881
    throw new IllegalStateException();
794
  }
882
  }
795
 
883
 
796
  public boolean isSet(int fieldID) {
884
  public boolean isSet(int fieldID) {
Line 934... Line 1022...
934
        return false;
1022
        return false;
935
      if (this.total_weight != that.total_weight)
1023
      if (this.total_weight != that.total_weight)
936
        return false;
1024
        return false;
937
    }
1025
    }
938
 
1026
 
-
 
1027
    boolean this_present_imei_number = true && this.isSetImei_number();
-
 
1028
    boolean that_present_imei_number = true && that.isSetImei_number();
-
 
1029
    if (this_present_imei_number || that_present_imei_number) {
-
 
1030
      if (!(this_present_imei_number && that_present_imei_number))
-
 
1031
        return false;
-
 
1032
      if (this.imei_number != that.imei_number)
-
 
1033
        return false;
-
 
1034
    }
-
 
1035
 
-
 
1036
    boolean this_present_item_number = true && this.isSetItem_number();
-
 
1037
    boolean that_present_item_number = true && that.isSetItem_number();
-
 
1038
    if (this_present_item_number || that_present_item_number) {
-
 
1039
      if (!(this_present_item_number && that_present_item_number))
-
 
1040
        return false;
-
 
1041
      if (!this.item_number.equals(that.item_number))
-
 
1042
        return false;
-
 
1043
    }
-
 
1044
 
939
    return true;
1045
    return true;
940
  }
1046
  }
941
 
1047
 
942
  @Override
1048
  @Override
943
  public int hashCode() {
1049
  public int hashCode() {
Line 1062... Line 1168...
1062
    }
1168
    }
1063
    lastComparison = TBaseHelper.compareTo(total_weight, typedOther.total_weight);
1169
    lastComparison = TBaseHelper.compareTo(total_weight, typedOther.total_weight);
1064
    if (lastComparison != 0) {
1170
    if (lastComparison != 0) {
1065
      return lastComparison;
1171
      return lastComparison;
1066
    }
1172
    }
-
 
1173
    lastComparison = Boolean.valueOf(isSetImei_number()).compareTo(isSetImei_number());
-
 
1174
    if (lastComparison != 0) {
-
 
1175
      return lastComparison;
-
 
1176
    }
-
 
1177
    lastComparison = TBaseHelper.compareTo(imei_number, typedOther.imei_number);
-
 
1178
    if (lastComparison != 0) {
-
 
1179
      return lastComparison;
-
 
1180
    }
-
 
1181
    lastComparison = Boolean.valueOf(isSetItem_number()).compareTo(isSetItem_number());
-
 
1182
    if (lastComparison != 0) {
-
 
1183
      return lastComparison;
-
 
1184
    }
-
 
1185
    lastComparison = TBaseHelper.compareTo(item_number, typedOther.item_number);
-
 
1186
    if (lastComparison != 0) {
-
 
1187
      return lastComparison;
-
 
1188
    }
1067
    return 0;
1189
    return 0;
1068
  }
1190
  }
1069
 
1191
 
1070
  public void read(TProtocol iprot) throws TException {
1192
  public void read(TProtocol iprot) throws TException {
1071
    TField field;
1193
    TField field;
Line 1185... Line 1307...
1185
              setTotal_weightIsSet(true);
1307
              setTotal_weightIsSet(true);
1186
            } else { 
1308
            } else { 
1187
              TProtocolUtil.skip(iprot, field.type);
1309
              TProtocolUtil.skip(iprot, field.type);
1188
            }
1310
            }
1189
            break;
1311
            break;
-
 
1312
          case IMEI_NUMBER:
-
 
1313
            if (field.type == TType.I64) {
-
 
1314
              this.imei_number = iprot.readI64();
-
 
1315
              setImei_numberIsSet(true);
-
 
1316
            } else { 
-
 
1317
              TProtocolUtil.skip(iprot, field.type);
-
 
1318
            }
-
 
1319
            break;
-
 
1320
          case ITEM_NUMBER:
-
 
1321
            if (field.type == TType.STRING) {
-
 
1322
              this.item_number = iprot.readString();
-
 
1323
            } else { 
-
 
1324
              TProtocolUtil.skip(iprot, field.type);
-
 
1325
            }
-
 
1326
            break;
1190
        }
1327
        }
1191
        iprot.readFieldEnd();
1328
        iprot.readFieldEnd();
1192
      }
1329
      }
1193
    }
1330
    }
1194
    iprot.readStructEnd();
1331
    iprot.readStructEnd();
Line 1251... Line 1388...
1251
    oprot.writeDouble(this.transfer_price);
1388
    oprot.writeDouble(this.transfer_price);
1252
    oprot.writeFieldEnd();
1389
    oprot.writeFieldEnd();
1253
    oprot.writeFieldBegin(TOTAL_WEIGHT_FIELD_DESC);
1390
    oprot.writeFieldBegin(TOTAL_WEIGHT_FIELD_DESC);
1254
    oprot.writeDouble(this.total_weight);
1391
    oprot.writeDouble(this.total_weight);
1255
    oprot.writeFieldEnd();
1392
    oprot.writeFieldEnd();
-
 
1393
    if (isSetImei_number()) {
-
 
1394
      oprot.writeFieldBegin(IMEI_NUMBER_FIELD_DESC);
-
 
1395
      oprot.writeI64(this.imei_number);
-
 
1396
      oprot.writeFieldEnd();
-
 
1397
    }
-
 
1398
    if (this.item_number != null) {
-
 
1399
      if (isSetItem_number()) {
-
 
1400
        oprot.writeFieldBegin(ITEM_NUMBER_FIELD_DESC);
-
 
1401
        oprot.writeString(this.item_number);
-
 
1402
        oprot.writeFieldEnd();
-
 
1403
      }
-
 
1404
    }
1256
    oprot.writeFieldStop();
1405
    oprot.writeFieldStop();
1257
    oprot.writeStructEnd();
1406
    oprot.writeStructEnd();
1258
  }
1407
  }
1259
 
1408
 
1260
  @Override
1409
  @Override
Line 1339... Line 1488...
1339
    first = false;
1488
    first = false;
1340
    if (!first) sb.append(", ");
1489
    if (!first) sb.append(", ");
1341
    sb.append("total_weight:");
1490
    sb.append("total_weight:");
1342
    sb.append(this.total_weight);
1491
    sb.append(this.total_weight);
1343
    first = false;
1492
    first = false;
-
 
1493
    if (isSetImei_number()) {
-
 
1494
      if (!first) sb.append(", ");
-
 
1495
      sb.append("imei_number:");
-
 
1496
      sb.append(this.imei_number);
-
 
1497
      first = false;
-
 
1498
    }
-
 
1499
    if (isSetItem_number()) {
-
 
1500
      if (!first) sb.append(", ");
-
 
1501
      sb.append("item_number:");
-
 
1502
      if (this.item_number == null) {
-
 
1503
        sb.append("null");
-
 
1504
      } else {
-
 
1505
        sb.append(this.item_number);
-
 
1506
      }
-
 
1507
      first = false;
-
 
1508
    }
1344
    sb.append(")");
1509
    sb.append(")");
1345
    return sb.toString();
1510
    return sb.toString();
1346
  }
1511
  }
1347
 
1512
 
1348
  public void validate() throws TException {
1513
  public void validate() throws TException {