Subversion Repositories SmartDukaan

Rev

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

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