Subversion Repositories SmartDukaan

Rev

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

Rev 2364 Rev 2383
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
 
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 long imei_number;
-
 
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
    IMEI_NUMBER((short)15, "imei_number");
-
 
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 __IMEI_NUMBER_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.IMEI_NUMBER, new FieldMetaData("imei_number", TFieldRequirementType.OPTIONAL, 
-
 
172
        new FieldValueMetaData(TType.I64)));
-
 
173
  }});
167
  }});
174
 
168
 
175
  static {
169
  static {
176
    FieldMetaData.addStructMetaDataMap(LineItem.class, metaDataMap);
170
    FieldMetaData.addStructMetaDataMap(LineItem.class, metaDataMap);
177
  }
171
  }
Line 250... Line 244...
250
    this.unit_price = other.unit_price;
244
    this.unit_price = other.unit_price;
251
    this.unit_weight = other.unit_weight;
245
    this.unit_weight = other.unit_weight;
252
    this.total_price = other.total_price;
246
    this.total_price = other.total_price;
253
    this.transfer_price = other.transfer_price;
247
    this.transfer_price = other.transfer_price;
254
    this.total_weight = other.total_weight;
248
    this.total_weight = other.total_weight;
255
    this.imei_number = other.imei_number;
-
 
256
  }
249
  }
257
 
250
 
258
  public LineItem deepCopy() {
251
  public LineItem deepCopy() {
259
    return new LineItem(this);
252
    return new LineItem(this);
260
  }
253
  }
Line 590... Line 583...
590
 
583
 
591
  public void setTotal_weightIsSet(boolean value) {
584
  public void setTotal_weightIsSet(boolean value) {
592
    __isset_bit_vector.set(__TOTAL_WEIGHT_ISSET_ID, value);
585
    __isset_bit_vector.set(__TOTAL_WEIGHT_ISSET_ID, value);
593
  }
586
  }
594
 
587
 
595
  public long getImei_number() {
-
 
596
    return this.imei_number;
-
 
597
  }
-
 
598
 
-
 
599
  public LineItem setImei_number(long imei_number) {
-
 
600
    this.imei_number = imei_number;
-
 
601
    setImei_numberIsSet(true);
-
 
602
    return this;
-
 
603
  }
-
 
604
 
-
 
605
  public void unsetImei_number() {
-
 
606
    __isset_bit_vector.clear(__IMEI_NUMBER_ISSET_ID);
-
 
607
  }
-
 
608
 
-
 
609
  /** Returns true if field imei_number is set (has been asigned a value) and false otherwise */
-
 
610
  public boolean isSetImei_number() {
-
 
611
    return __isset_bit_vector.get(__IMEI_NUMBER_ISSET_ID);
-
 
612
  }
-
 
613
 
-
 
614
  public void setImei_numberIsSet(boolean value) {
-
 
615
    __isset_bit_vector.set(__IMEI_NUMBER_ISSET_ID, value);
-
 
616
  }
-
 
617
 
-
 
618
  public void setFieldValue(_Fields field, Object value) {
588
  public void setFieldValue(_Fields field, Object value) {
619
    switch (field) {
589
    switch (field) {
620
    case ID:
590
    case ID:
621
      if (value == null) {
591
      if (value == null) {
622
        unsetId();
592
        unsetId();
Line 727... Line 697...
727
      } else {
697
      } else {
728
        setTotal_weight((Double)value);
698
        setTotal_weight((Double)value);
729
      }
699
      }
730
      break;
700
      break;
731
 
701
 
732
    case IMEI_NUMBER:
-
 
733
      if (value == null) {
-
 
734
        unsetImei_number();
-
 
735
      } else {
-
 
736
        setImei_number((Long)value);
-
 
737
      }
-
 
738
      break;
-
 
739
 
-
 
740
    }
702
    }
741
  }
703
  }
742
 
704
 
743
  public void setFieldValue(int fieldID, Object value) {
705
  public void setFieldValue(int fieldID, Object value) {
744
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
706
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
Line 786... Line 748...
786
      return new Double(getTransfer_price());
748
      return new Double(getTransfer_price());
787
 
749
 
788
    case TOTAL_WEIGHT:
750
    case TOTAL_WEIGHT:
789
      return new Double(getTotal_weight());
751
      return new Double(getTotal_weight());
790
 
752
 
791
    case IMEI_NUMBER:
-
 
792
      return new Long(getImei_number());
-
 
793
 
-
 
794
    }
753
    }
795
    throw new IllegalStateException();
754
    throw new IllegalStateException();
796
  }
755
  }
797
 
756
 
798
  public Object getFieldValue(int fieldId) {
757
  public Object getFieldValue(int fieldId) {
Line 828... Line 787...
828
      return isSetTotal_price();
787
      return isSetTotal_price();
829
    case TRANSFER_PRICE:
788
    case TRANSFER_PRICE:
830
      return isSetTransfer_price();
789
      return isSetTransfer_price();
831
    case TOTAL_WEIGHT:
790
    case TOTAL_WEIGHT:
832
      return isSetTotal_weight();
791
      return isSetTotal_weight();
833
    case IMEI_NUMBER:
-
 
834
      return isSetImei_number();
-
 
835
    }
792
    }
836
    throw new IllegalStateException();
793
    throw new IllegalStateException();
837
  }
794
  }
838
 
795
 
839
  public boolean isSet(int fieldID) {
796
  public boolean isSet(int fieldID) {
Line 977... Line 934...
977
        return false;
934
        return false;
978
      if (this.total_weight != that.total_weight)
935
      if (this.total_weight != that.total_weight)
979
        return false;
936
        return false;
980
    }
937
    }
981
 
938
 
982
    boolean this_present_imei_number = true && this.isSetImei_number();
-
 
983
    boolean that_present_imei_number = true && that.isSetImei_number();
-
 
984
    if (this_present_imei_number || that_present_imei_number) {
-
 
985
      if (!(this_present_imei_number && that_present_imei_number))
-
 
986
        return false;
-
 
987
      if (this.imei_number != that.imei_number)
-
 
988
        return false;
-
 
989
    }
-
 
990
 
-
 
991
    return true;
939
    return true;
992
  }
940
  }
993
 
941
 
994
  @Override
942
  @Override
995
  public int hashCode() {
943
  public int hashCode() {
Line 1114... Line 1062...
1114
    }
1062
    }
1115
    lastComparison = TBaseHelper.compareTo(total_weight, typedOther.total_weight);
1063
    lastComparison = TBaseHelper.compareTo(total_weight, typedOther.total_weight);
1116
    if (lastComparison != 0) {
1064
    if (lastComparison != 0) {
1117
      return lastComparison;
1065
      return lastComparison;
1118
    }
1066
    }
1119
    lastComparison = Boolean.valueOf(isSetImei_number()).compareTo(isSetImei_number());
-
 
1120
    if (lastComparison != 0) {
-
 
1121
      return lastComparison;
-
 
1122
    }
-
 
1123
    lastComparison = TBaseHelper.compareTo(imei_number, typedOther.imei_number);
-
 
1124
    if (lastComparison != 0) {
-
 
1125
      return lastComparison;
-
 
1126
    }
-
 
1127
    return 0;
1067
    return 0;
1128
  }
1068
  }
1129
 
1069
 
1130
  public void read(TProtocol iprot) throws TException {
1070
  public void read(TProtocol iprot) throws TException {
1131
    TField field;
1071
    TField field;
Line 1245... Line 1185...
1245
              setTotal_weightIsSet(true);
1185
              setTotal_weightIsSet(true);
1246
            } else { 
1186
            } else { 
1247
              TProtocolUtil.skip(iprot, field.type);
1187
              TProtocolUtil.skip(iprot, field.type);
1248
            }
1188
            }
1249
            break;
1189
            break;
1250
          case IMEI_NUMBER:
-
 
1251
            if (field.type == TType.I64) {
-
 
1252
              this.imei_number = iprot.readI64();
-
 
1253
              setImei_numberIsSet(true);
-
 
1254
            } else { 
-
 
1255
              TProtocolUtil.skip(iprot, field.type);
-
 
1256
            }
-
 
1257
            break;
-
 
1258
        }
1190
        }
1259
        iprot.readFieldEnd();
1191
        iprot.readFieldEnd();
1260
      }
1192
      }
1261
    }
1193
    }
1262
    iprot.readStructEnd();
1194
    iprot.readStructEnd();
Line 1319... Line 1251...
1319
    oprot.writeDouble(this.transfer_price);
1251
    oprot.writeDouble(this.transfer_price);
1320
    oprot.writeFieldEnd();
1252
    oprot.writeFieldEnd();
1321
    oprot.writeFieldBegin(TOTAL_WEIGHT_FIELD_DESC);
1253
    oprot.writeFieldBegin(TOTAL_WEIGHT_FIELD_DESC);
1322
    oprot.writeDouble(this.total_weight);
1254
    oprot.writeDouble(this.total_weight);
1323
    oprot.writeFieldEnd();
1255
    oprot.writeFieldEnd();
1324
    if (isSetImei_number()) {
-
 
1325
      oprot.writeFieldBegin(IMEI_NUMBER_FIELD_DESC);
-
 
1326
      oprot.writeI64(this.imei_number);
-
 
1327
      oprot.writeFieldEnd();
-
 
1328
    }
-
 
1329
    oprot.writeFieldStop();
1256
    oprot.writeFieldStop();
1330
    oprot.writeStructEnd();
1257
    oprot.writeStructEnd();
1331
  }
1258
  }
1332
 
1259
 
1333
  @Override
1260
  @Override
Line 1412... Line 1339...
1412
    first = false;
1339
    first = false;
1413
    if (!first) sb.append(", ");
1340
    if (!first) sb.append(", ");
1414
    sb.append("total_weight:");
1341
    sb.append("total_weight:");
1415
    sb.append(this.total_weight);
1342
    sb.append(this.total_weight);
1416
    first = false;
1343
    first = false;
1417
    if (isSetImei_number()) {
-
 
1418
      if (!first) sb.append(", ");
-
 
1419
      sb.append("imei_number:");
-
 
1420
      sb.append(this.imei_number);
-
 
1421
      first = false;
-
 
1422
    }
-
 
1423
    sb.append(")");
1344
    sb.append(")");
1424
    return sb.toString();
1345
    return sb.toString();
1425
  }
1346
  }
1426
 
1347
 
1427
  public void validate() throws TException {
1348
  public void validate() throws TException {