Subversion Repositories SmartDukaan

Rev

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

Rev 1221 Rev 1982
Line 57... Line 57...
57
  private static final TField OUTOFSTOCK_TIMESTAMP_FIELD_DESC = new TField("outofstock_timestamp", TType.I64, (short)29);
57
  private static final TField OUTOFSTOCK_TIMESTAMP_FIELD_DESC = new TField("outofstock_timestamp", TType.I64, (short)29);
58
  private static final TField JACKET_NUMBER_FIELD_DESC = new TField("jacket_number", TType.I64, (short)30);
58
  private static final TField JACKET_NUMBER_FIELD_DESC = new TField("jacket_number", TType.I64, (short)30);
59
  private static final TField RECEIVER_FIELD_DESC = new TField("receiver", TType.STRING, (short)31);
59
  private static final TField RECEIVER_FIELD_DESC = new TField("receiver", TType.STRING, (short)31);
60
  private static final TField BATCH_NO_FIELD_DESC = new TField("batchNo", TType.I64, (short)32);
60
  private static final TField BATCH_NO_FIELD_DESC = new TField("batchNo", TType.I64, (short)32);
61
  private static final TField SERIAL_NO_FIELD_DESC = new TField("serialNo", TType.I64, (short)33);
61
  private static final TField SERIAL_NO_FIELD_DESC = new TField("serialNo", TType.I64, (short)33);
-
 
62
  private static final TField DISCOUNTED_AMOUNT_FIELD_DESC = new TField("discounted_amount", TType.DOUBLE, (short)34);
62
 
63
 
63
  private long id;
64
  private long id;
64
  private long warehouse_id;
65
  private long warehouse_id;
65
  private List<LineItem> lineitems;
66
  private List<LineItem> lineitems;
66
  private long logistics_provider_id;
67
  private long logistics_provider_id;
Line 91... Line 92...
91
  private long outofstock_timestamp;
92
  private long outofstock_timestamp;
92
  private long jacket_number;
93
  private long jacket_number;
93
  private String receiver;
94
  private String receiver;
94
  private long batchNo;
95
  private long batchNo;
95
  private long serialNo;
96
  private long serialNo;
-
 
97
  private double discounted_amount;
96
 
98
 
97
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
99
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
98
  public enum _Fields implements TFieldIdEnum {
100
  public enum _Fields implements TFieldIdEnum {
99
    ID((short)1, "id"),
101
    ID((short)1, "id"),
100
    WAREHOUSE_ID((short)2, "warehouse_id"),
102
    WAREHOUSE_ID((short)2, "warehouse_id"),
Line 152... Line 154...
152
    DELIVERY_TIMESTAMP((short)28, "delivery_timestamp"),
154
    DELIVERY_TIMESTAMP((short)28, "delivery_timestamp"),
153
    OUTOFSTOCK_TIMESTAMP((short)29, "outofstock_timestamp"),
155
    OUTOFSTOCK_TIMESTAMP((short)29, "outofstock_timestamp"),
154
    JACKET_NUMBER((short)30, "jacket_number"),
156
    JACKET_NUMBER((short)30, "jacket_number"),
155
    RECEIVER((short)31, "receiver"),
157
    RECEIVER((short)31, "receiver"),
156
    BATCH_NO((short)32, "batchNo"),
158
    BATCH_NO((short)32, "batchNo"),
157
    SERIAL_NO((short)33, "serialNo");
159
    SERIAL_NO((short)33, "serialNo"),
-
 
160
    DISCOUNTED_AMOUNT((short)34, "discounted_amount");
158
 
161
 
159
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
162
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
160
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
163
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
161
 
164
 
162
    static {
165
    static {
Line 223... Line 226...
223
  private static final int __DELIVERY_TIMESTAMP_ISSET_ID = 12;
226
  private static final int __DELIVERY_TIMESTAMP_ISSET_ID = 12;
224
  private static final int __OUTOFSTOCK_TIMESTAMP_ISSET_ID = 13;
227
  private static final int __OUTOFSTOCK_TIMESTAMP_ISSET_ID = 13;
225
  private static final int __JACKET_NUMBER_ISSET_ID = 14;
228
  private static final int __JACKET_NUMBER_ISSET_ID = 14;
226
  private static final int __BATCHNO_ISSET_ID = 15;
229
  private static final int __BATCHNO_ISSET_ID = 15;
227
  private static final int __SERIALNO_ISSET_ID = 16;
230
  private static final int __SERIALNO_ISSET_ID = 16;
-
 
231
  private static final int __DISCOUNTED_AMOUNT_ISSET_ID = 17;
228
  private BitSet __isset_bit_vector = new BitSet(17);
232
  private BitSet __isset_bit_vector = new BitSet(18);
229
 
233
 
230
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
234
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
231
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
235
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
232
        new FieldValueMetaData(TType.I64)));
236
        new FieldValueMetaData(TType.I64)));
233
    put(_Fields.WAREHOUSE_ID, new FieldMetaData("warehouse_id", TFieldRequirementType.DEFAULT, 
237
    put(_Fields.WAREHOUSE_ID, new FieldMetaData("warehouse_id", TFieldRequirementType.DEFAULT, 
Line 293... Line 297...
293
        new FieldValueMetaData(TType.STRING)));
297
        new FieldValueMetaData(TType.STRING)));
294
    put(_Fields.BATCH_NO, new FieldMetaData("batchNo", TFieldRequirementType.DEFAULT, 
298
    put(_Fields.BATCH_NO, new FieldMetaData("batchNo", TFieldRequirementType.DEFAULT, 
295
        new FieldValueMetaData(TType.I64)));
299
        new FieldValueMetaData(TType.I64)));
296
    put(_Fields.SERIAL_NO, new FieldMetaData("serialNo", TFieldRequirementType.DEFAULT, 
300
    put(_Fields.SERIAL_NO, new FieldMetaData("serialNo", TFieldRequirementType.DEFAULT, 
297
        new FieldValueMetaData(TType.I64)));
301
        new FieldValueMetaData(TType.I64)));
-
 
302
    put(_Fields.DISCOUNTED_AMOUNT, new FieldMetaData("discounted_amount", TFieldRequirementType.DEFAULT, 
-
 
303
        new FieldValueMetaData(TType.DOUBLE)));
298
  }});
304
  }});
299
 
305
 
300
  static {
306
  static {
301
    FieldMetaData.addStructMetaDataMap(Order.class, metaDataMap);
307
    FieldMetaData.addStructMetaDataMap(Order.class, metaDataMap);
302
  }
308
  }
Line 335... Line 341...
335
    long delivery_timestamp,
341
    long delivery_timestamp,
336
    long outofstock_timestamp,
342
    long outofstock_timestamp,
337
    long jacket_number,
343
    long jacket_number,
338
    String receiver,
344
    String receiver,
339
    long batchNo,
345
    long batchNo,
340
    long serialNo)
346
    long serialNo,
-
 
347
    double discounted_amount)
341
  {
348
  {
342
    this();
349
    this();
343
    this.id = id;
350
    this.id = id;
344
    setIdIsSet(true);
351
    setIdIsSet(true);
345
    this.warehouse_id = warehouse_id;
352
    this.warehouse_id = warehouse_id;
Line 388... Line 395...
388
    this.receiver = receiver;
395
    this.receiver = receiver;
389
    this.batchNo = batchNo;
396
    this.batchNo = batchNo;
390
    setBatchNoIsSet(true);
397
    setBatchNoIsSet(true);
391
    this.serialNo = serialNo;
398
    this.serialNo = serialNo;
392
    setSerialNoIsSet(true);
399
    setSerialNoIsSet(true);
-
 
400
    this.discounted_amount = discounted_amount;
-
 
401
    setDiscounted_amountIsSet(true);
393
  }
402
  }
394
 
403
 
395
  /**
404
  /**
396
   * Performs a deep copy on <i>other</i>.
405
   * Performs a deep copy on <i>other</i>.
397
   */
406
   */
Line 465... Line 474...
465
    if (other.isSetReceiver()) {
474
    if (other.isSetReceiver()) {
466
      this.receiver = other.receiver;
475
      this.receiver = other.receiver;
467
    }
476
    }
468
    this.batchNo = other.batchNo;
477
    this.batchNo = other.batchNo;
469
    this.serialNo = other.serialNo;
478
    this.serialNo = other.serialNo;
-
 
479
    this.discounted_amount = other.discounted_amount;
470
  }
480
  }
471
 
481
 
472
  public Order deepCopy() {
482
  public Order deepCopy() {
473
    return new Order(this);
483
    return new Order(this);
474
  }
484
  }
Line 1318... Line 1328...
1318
 
1328
 
1319
  public void setSerialNoIsSet(boolean value) {
1329
  public void setSerialNoIsSet(boolean value) {
1320
    __isset_bit_vector.set(__SERIALNO_ISSET_ID, value);
1330
    __isset_bit_vector.set(__SERIALNO_ISSET_ID, value);
1321
  }
1331
  }
1322
 
1332
 
-
 
1333
  public double getDiscounted_amount() {
-
 
1334
    return this.discounted_amount;
-
 
1335
  }
-
 
1336
 
-
 
1337
  public Order setDiscounted_amount(double discounted_amount) {
-
 
1338
    this.discounted_amount = discounted_amount;
-
 
1339
    setDiscounted_amountIsSet(true);
-
 
1340
    return this;
-
 
1341
  }
-
 
1342
 
-
 
1343
  public void unsetDiscounted_amount() {
-
 
1344
    __isset_bit_vector.clear(__DISCOUNTED_AMOUNT_ISSET_ID);
-
 
1345
  }
-
 
1346
 
-
 
1347
  /** Returns true if field discounted_amount is set (has been asigned a value) and false otherwise */
-
 
1348
  public boolean isSetDiscounted_amount() {
-
 
1349
    return __isset_bit_vector.get(__DISCOUNTED_AMOUNT_ISSET_ID);
-
 
1350
  }
-
 
1351
 
-
 
1352
  public void setDiscounted_amountIsSet(boolean value) {
-
 
1353
    __isset_bit_vector.set(__DISCOUNTED_AMOUNT_ISSET_ID, value);
-
 
1354
  }
-
 
1355
 
1323
  public void setFieldValue(_Fields field, Object value) {
1356
  public void setFieldValue(_Fields field, Object value) {
1324
    switch (field) {
1357
    switch (field) {
1325
    case ID:
1358
    case ID:
1326
      if (value == null) {
1359
      if (value == null) {
1327
        unsetId();
1360
        unsetId();
Line 1584... Line 1617...
1584
      } else {
1617
      } else {
1585
        setSerialNo((Long)value);
1618
        setSerialNo((Long)value);
1586
      }
1619
      }
1587
      break;
1620
      break;
1588
 
1621
 
-
 
1622
    case DISCOUNTED_AMOUNT:
-
 
1623
      if (value == null) {
-
 
1624
        unsetDiscounted_amount();
-
 
1625
      } else {
-
 
1626
        setDiscounted_amount((Double)value);
-
 
1627
      }
-
 
1628
      break;
-
 
1629
 
1589
    }
1630
    }
1590
  }
1631
  }
1591
 
1632
 
1592
  public void setFieldValue(int fieldID, Object value) {
1633
  public void setFieldValue(int fieldID, Object value) {
1593
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
1634
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
Line 1692... Line 1733...
1692
      return new Long(getBatchNo());
1733
      return new Long(getBatchNo());
1693
 
1734
 
1694
    case SERIAL_NO:
1735
    case SERIAL_NO:
1695
      return new Long(getSerialNo());
1736
      return new Long(getSerialNo());
1696
 
1737
 
-
 
1738
    case DISCOUNTED_AMOUNT:
-
 
1739
      return new Double(getDiscounted_amount());
-
 
1740
 
1697
    }
1741
    }
1698
    throw new IllegalStateException();
1742
    throw new IllegalStateException();
1699
  }
1743
  }
1700
 
1744
 
1701
  public Object getFieldValue(int fieldId) {
1745
  public Object getFieldValue(int fieldId) {
Line 1769... Line 1813...
1769
      return isSetReceiver();
1813
      return isSetReceiver();
1770
    case BATCH_NO:
1814
    case BATCH_NO:
1771
      return isSetBatchNo();
1815
      return isSetBatchNo();
1772
    case SERIAL_NO:
1816
    case SERIAL_NO:
1773
      return isSetSerialNo();
1817
      return isSetSerialNo();
-
 
1818
    case DISCOUNTED_AMOUNT:
-
 
1819
      return isSetDiscounted_amount();
1774
    }
1820
    }
1775
    throw new IllegalStateException();
1821
    throw new IllegalStateException();
1776
  }
1822
  }
1777
 
1823
 
1778
  public boolean isSet(int fieldID) {
1824
  public boolean isSet(int fieldID) {
Line 2087... Line 2133...
2087
        return false;
2133
        return false;
2088
      if (this.serialNo != that.serialNo)
2134
      if (this.serialNo != that.serialNo)
2089
        return false;
2135
        return false;
2090
    }
2136
    }
2091
 
2137
 
-
 
2138
    boolean this_present_discounted_amount = true;
-
 
2139
    boolean that_present_discounted_amount = true;
-
 
2140
    if (this_present_discounted_amount || that_present_discounted_amount) {
-
 
2141
      if (!(this_present_discounted_amount && that_present_discounted_amount))
-
 
2142
        return false;
-
 
2143
      if (this.discounted_amount != that.discounted_amount)
-
 
2144
        return false;
-
 
2145
    }
-
 
2146
 
2092
    return true;
2147
    return true;
2093
  }
2148
  }
2094
 
2149
 
2095
  @Override
2150
  @Override
2096
  public int hashCode() {
2151
  public int hashCode() {
Line 2367... Line 2422...
2367
    }
2422
    }
2368
    lastComparison = TBaseHelper.compareTo(serialNo, typedOther.serialNo);
2423
    lastComparison = TBaseHelper.compareTo(serialNo, typedOther.serialNo);
2369
    if (lastComparison != 0) {
2424
    if (lastComparison != 0) {
2370
      return lastComparison;
2425
      return lastComparison;
2371
    }
2426
    }
-
 
2427
    lastComparison = Boolean.valueOf(isSetDiscounted_amount()).compareTo(isSetDiscounted_amount());
-
 
2428
    if (lastComparison != 0) {
-
 
2429
      return lastComparison;
-
 
2430
    }
-
 
2431
    lastComparison = TBaseHelper.compareTo(discounted_amount, typedOther.discounted_amount);
-
 
2432
    if (lastComparison != 0) {
-
 
2433
      return lastComparison;
-
 
2434
    }
2372
    return 0;
2435
    return 0;
2373
  }
2436
  }
2374
 
2437
 
2375
  public void read(TProtocol iprot) throws TException {
2438
  public void read(TProtocol iprot) throws TException {
2376
    TField field;
2439
    TField field;
Line 2643... Line 2706...
2643
              setSerialNoIsSet(true);
2706
              setSerialNoIsSet(true);
2644
            } else { 
2707
            } else { 
2645
              TProtocolUtil.skip(iprot, field.type);
2708
              TProtocolUtil.skip(iprot, field.type);
2646
            }
2709
            }
2647
            break;
2710
            break;
-
 
2711
          case DISCOUNTED_AMOUNT:
-
 
2712
            if (field.type == TType.DOUBLE) {
-
 
2713
              this.discounted_amount = iprot.readDouble();
-
 
2714
              setDiscounted_amountIsSet(true);
-
 
2715
            } else { 
-
 
2716
              TProtocolUtil.skip(iprot, field.type);
-
 
2717
            }
-
 
2718
            break;
2648
        }
2719
        }
2649
        iprot.readFieldEnd();
2720
        iprot.readFieldEnd();
2650
      }
2721
      }
2651
    }
2722
    }
2652
    iprot.readStructEnd();
2723
    iprot.readStructEnd();
Line 2793... Line 2864...
2793
    oprot.writeI64(this.batchNo);
2864
    oprot.writeI64(this.batchNo);
2794
    oprot.writeFieldEnd();
2865
    oprot.writeFieldEnd();
2795
    oprot.writeFieldBegin(SERIAL_NO_FIELD_DESC);
2866
    oprot.writeFieldBegin(SERIAL_NO_FIELD_DESC);
2796
    oprot.writeI64(this.serialNo);
2867
    oprot.writeI64(this.serialNo);
2797
    oprot.writeFieldEnd();
2868
    oprot.writeFieldEnd();
-
 
2869
    oprot.writeFieldBegin(DISCOUNTED_AMOUNT_FIELD_DESC);
-
 
2870
    oprot.writeDouble(this.discounted_amount);
-
 
2871
    oprot.writeFieldEnd();
2798
    oprot.writeFieldStop();
2872
    oprot.writeFieldStop();
2799
    oprot.writeStructEnd();
2873
    oprot.writeStructEnd();
2800
  }
2874
  }
2801
 
2875
 
2802
  @Override
2876
  @Override
Line 3005... Line 3079...
3005
    first = false;
3079
    first = false;
3006
    if (!first) sb.append(", ");
3080
    if (!first) sb.append(", ");
3007
    sb.append("serialNo:");
3081
    sb.append("serialNo:");
3008
    sb.append(this.serialNo);
3082
    sb.append(this.serialNo);
3009
    first = false;
3083
    first = false;
-
 
3084
    if (!first) sb.append(", ");
-
 
3085
    sb.append("discounted_amount:");
-
 
3086
    sb.append(this.discounted_amount);
-
 
3087
    first = false;
3010
    sb.append(")");
3088
    sb.append(")");
3011
    return sb.toString();
3089
    return sb.toString();
3012
  }
3090
  }
3013
 
3091
 
3014
  public void validate() throws TException {
3092
  public void validate() throws TException {