Subversion Repositories SmartDukaan

Rev

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

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