Subversion Repositories SmartDukaan

Rev

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

Rev 4496 Rev 4754
Line 34... Line 34...
34
  private static final org.apache.thrift.protocol.TField QUANTITY_FIELD_DESC = new org.apache.thrift.protocol.TField("quantity", org.apache.thrift.protocol.TType.DOUBLE, (short)9);
34
  private static final org.apache.thrift.protocol.TField QUANTITY_FIELD_DESC = new org.apache.thrift.protocol.TField("quantity", org.apache.thrift.protocol.TType.DOUBLE, (short)9);
35
  private static final org.apache.thrift.protocol.TField UNFULFILLED_QUANTITY_FIELD_DESC = new org.apache.thrift.protocol.TField("unfulfilledQuantity", org.apache.thrift.protocol.TType.DOUBLE, (short)10);
35
  private static final org.apache.thrift.protocol.TField UNFULFILLED_QUANTITY_FIELD_DESC = new org.apache.thrift.protocol.TField("unfulfilledQuantity", org.apache.thrift.protocol.TType.DOUBLE, (short)10);
36
  private static final org.apache.thrift.protocol.TField CREATED_AT_FIELD_DESC = new org.apache.thrift.protocol.TField("createdAt", org.apache.thrift.protocol.TType.I64, (short)11);
36
  private static final org.apache.thrift.protocol.TField CREATED_AT_FIELD_DESC = new org.apache.thrift.protocol.TField("createdAt", org.apache.thrift.protocol.TType.I64, (short)11);
37
  private static final org.apache.thrift.protocol.TField UNIT_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("unitPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)12);
37
  private static final org.apache.thrift.protocol.TField UNIT_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("unitPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)12);
38
  private static final org.apache.thrift.protocol.TField FULFILLED_FIELD_DESC = new org.apache.thrift.protocol.TField("fulfilled", org.apache.thrift.protocol.TType.BOOL, (short)13);
38
  private static final org.apache.thrift.protocol.TField FULFILLED_FIELD_DESC = new org.apache.thrift.protocol.TField("fulfilled", org.apache.thrift.protocol.TType.BOOL, (short)13);
-
 
39
  private static final org.apache.thrift.protocol.TField COD_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("codCount", org.apache.thrift.protocol.TType.I64, (short)14);
39
 
40
 
40
  private long orderId; // required
41
  private long orderId; // required
41
  private long itemId; // required
42
  private long itemId; // required
42
  private String productGroup; // required
43
  private String productGroup; // required
43
  private String brand; // required
44
  private String brand; // required
Line 48... Line 49...
48
  private double quantity; // required
49
  private double quantity; // required
49
  private double unfulfilledQuantity; // required
50
  private double unfulfilledQuantity; // required
50
  private long createdAt; // required
51
  private long createdAt; // required
51
  private double unitPrice; // required
52
  private double unitPrice; // required
52
  private boolean fulfilled; // required
53
  private boolean fulfilled; // required
-
 
54
  private long codCount; // required
53
 
55
 
54
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
56
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
55
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
57
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
56
    ORDER_ID((short)1, "orderId"),
58
    ORDER_ID((short)1, "orderId"),
57
    ITEM_ID((short)2, "itemId"),
59
    ITEM_ID((short)2, "itemId"),
Line 63... Line 65...
63
    ITEM_NUMBER((short)8, "itemNumber"),
65
    ITEM_NUMBER((short)8, "itemNumber"),
64
    QUANTITY((short)9, "quantity"),
66
    QUANTITY((short)9, "quantity"),
65
    UNFULFILLED_QUANTITY((short)10, "unfulfilledQuantity"),
67
    UNFULFILLED_QUANTITY((short)10, "unfulfilledQuantity"),
66
    CREATED_AT((short)11, "createdAt"),
68
    CREATED_AT((short)11, "createdAt"),
67
    UNIT_PRICE((short)12, "unitPrice"),
69
    UNIT_PRICE((short)12, "unitPrice"),
68
    FULFILLED((short)13, "fulfilled");
70
    FULFILLED((short)13, "fulfilled"),
-
 
71
    COD_COUNT((short)14, "codCount");
69
 
72
 
70
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
73
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
71
 
74
 
72
    static {
75
    static {
73
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
76
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
Line 104... Line 107...
104
          return CREATED_AT;
107
          return CREATED_AT;
105
        case 12: // UNIT_PRICE
108
        case 12: // UNIT_PRICE
106
          return UNIT_PRICE;
109
          return UNIT_PRICE;
107
        case 13: // FULFILLED
110
        case 13: // FULFILLED
108
          return FULFILLED;
111
          return FULFILLED;
-
 
112
        case 14: // COD_COUNT
-
 
113
          return COD_COUNT;
109
        default:
114
        default:
110
          return null;
115
          return null;
111
      }
116
      }
112
    }
117
    }
113
 
118
 
Line 151... Line 156...
151
  private static final int __QUANTITY_ISSET_ID = 2;
156
  private static final int __QUANTITY_ISSET_ID = 2;
152
  private static final int __UNFULFILLEDQUANTITY_ISSET_ID = 3;
157
  private static final int __UNFULFILLEDQUANTITY_ISSET_ID = 3;
153
  private static final int __CREATEDAT_ISSET_ID = 4;
158
  private static final int __CREATEDAT_ISSET_ID = 4;
154
  private static final int __UNITPRICE_ISSET_ID = 5;
159
  private static final int __UNITPRICE_ISSET_ID = 5;
155
  private static final int __FULFILLED_ISSET_ID = 6;
160
  private static final int __FULFILLED_ISSET_ID = 6;
-
 
161
  private static final int __CODCOUNT_ISSET_ID = 7;
156
  private BitSet __isset_bit_vector = new BitSet(7);
162
  private BitSet __isset_bit_vector = new BitSet(8);
157
 
163
 
158
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
164
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
159
  static {
165
  static {
160
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
166
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
161
    tmpMap.put(_Fields.ORDER_ID, new org.apache.thrift.meta_data.FieldMetaData("orderId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
167
    tmpMap.put(_Fields.ORDER_ID, new org.apache.thrift.meta_data.FieldMetaData("orderId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
Line 182... Line 188...
182
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
188
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
183
    tmpMap.put(_Fields.UNIT_PRICE, new org.apache.thrift.meta_data.FieldMetaData("unitPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
189
    tmpMap.put(_Fields.UNIT_PRICE, new org.apache.thrift.meta_data.FieldMetaData("unitPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
184
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
190
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
185
    tmpMap.put(_Fields.FULFILLED, new org.apache.thrift.meta_data.FieldMetaData("fulfilled", org.apache.thrift.TFieldRequirementType.DEFAULT, 
191
    tmpMap.put(_Fields.FULFILLED, new org.apache.thrift.meta_data.FieldMetaData("fulfilled", org.apache.thrift.TFieldRequirementType.DEFAULT, 
186
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
192
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
-
 
193
    tmpMap.put(_Fields.COD_COUNT, new org.apache.thrift.meta_data.FieldMetaData("codCount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
194
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
187
    metaDataMap = Collections.unmodifiableMap(tmpMap);
195
    metaDataMap = Collections.unmodifiableMap(tmpMap);
188
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(LineItem.class, metaDataMap);
196
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(LineItem.class, metaDataMap);
189
  }
197
  }
190
 
198
 
191
  public LineItem() {
199
  public LineItem() {
Line 202... Line 210...
202
    String itemNumber,
210
    String itemNumber,
203
    double quantity,
211
    double quantity,
204
    double unfulfilledQuantity,
212
    double unfulfilledQuantity,
205
    long createdAt,
213
    long createdAt,
206
    double unitPrice,
214
    double unitPrice,
207
    boolean fulfilled)
215
    boolean fulfilled,
-
 
216
    long codCount)
208
  {
217
  {
209
    this();
218
    this();
210
    this.orderId = orderId;
219
    this.orderId = orderId;
211
    setOrderIdIsSet(true);
220
    setOrderIdIsSet(true);
212
    this.itemId = itemId;
221
    this.itemId = itemId;
Line 225... Line 234...
225
    setCreatedAtIsSet(true);
234
    setCreatedAtIsSet(true);
226
    this.unitPrice = unitPrice;
235
    this.unitPrice = unitPrice;
227
    setUnitPriceIsSet(true);
236
    setUnitPriceIsSet(true);
228
    this.fulfilled = fulfilled;
237
    this.fulfilled = fulfilled;
229
    setFulfilledIsSet(true);
238
    setFulfilledIsSet(true);
-
 
239
    this.codCount = codCount;
-
 
240
    setCodCountIsSet(true);
230
  }
241
  }
231
 
242
 
232
  /**
243
  /**
233
   * Performs a deep copy on <i>other</i>.
244
   * Performs a deep copy on <i>other</i>.
234
   */
245
   */
Line 258... Line 269...
258
    this.quantity = other.quantity;
269
    this.quantity = other.quantity;
259
    this.unfulfilledQuantity = other.unfulfilledQuantity;
270
    this.unfulfilledQuantity = other.unfulfilledQuantity;
260
    this.createdAt = other.createdAt;
271
    this.createdAt = other.createdAt;
261
    this.unitPrice = other.unitPrice;
272
    this.unitPrice = other.unitPrice;
262
    this.fulfilled = other.fulfilled;
273
    this.fulfilled = other.fulfilled;
-
 
274
    this.codCount = other.codCount;
263
  }
275
  }
264
 
276
 
265
  public LineItem deepCopy() {
277
  public LineItem deepCopy() {
266
    return new LineItem(this);
278
    return new LineItem(this);
267
  }
279
  }
Line 286... Line 298...
286
    this.createdAt = 0;
298
    this.createdAt = 0;
287
    setUnitPriceIsSet(false);
299
    setUnitPriceIsSet(false);
288
    this.unitPrice = 0.0;
300
    this.unitPrice = 0.0;
289
    setFulfilledIsSet(false);
301
    setFulfilledIsSet(false);
290
    this.fulfilled = false;
302
    this.fulfilled = false;
-
 
303
    setCodCountIsSet(false);
-
 
304
    this.codCount = 0;
291
  }
305
  }
292
 
306
 
293
  public long getOrderId() {
307
  public long getOrderId() {
294
    return this.orderId;
308
    return this.orderId;
295
  }
309
  }
Line 580... Line 594...
580
 
594
 
581
  public void setFulfilledIsSet(boolean value) {
595
  public void setFulfilledIsSet(boolean value) {
582
    __isset_bit_vector.set(__FULFILLED_ISSET_ID, value);
596
    __isset_bit_vector.set(__FULFILLED_ISSET_ID, value);
583
  }
597
  }
584
 
598
 
-
 
599
  public long getCodCount() {
-
 
600
    return this.codCount;
-
 
601
  }
-
 
602
 
-
 
603
  public void setCodCount(long codCount) {
-
 
604
    this.codCount = codCount;
-
 
605
    setCodCountIsSet(true);
-
 
606
  }
-
 
607
 
-
 
608
  public void unsetCodCount() {
-
 
609
    __isset_bit_vector.clear(__CODCOUNT_ISSET_ID);
-
 
610
  }
-
 
611
 
-
 
612
  /** Returns true if field codCount is set (has been assigned a value) and false otherwise */
-
 
613
  public boolean isSetCodCount() {
-
 
614
    return __isset_bit_vector.get(__CODCOUNT_ISSET_ID);
-
 
615
  }
-
 
616
 
-
 
617
  public void setCodCountIsSet(boolean value) {
-
 
618
    __isset_bit_vector.set(__CODCOUNT_ISSET_ID, value);
-
 
619
  }
-
 
620
 
585
  public void setFieldValue(_Fields field, Object value) {
621
  public void setFieldValue(_Fields field, Object value) {
586
    switch (field) {
622
    switch (field) {
587
    case ORDER_ID:
623
    case ORDER_ID:
588
      if (value == null) {
624
      if (value == null) {
589
        unsetOrderId();
625
        unsetOrderId();
Line 686... Line 722...
686
      } else {
722
      } else {
687
        setFulfilled((Boolean)value);
723
        setFulfilled((Boolean)value);
688
      }
724
      }
689
      break;
725
      break;
690
 
726
 
-
 
727
    case COD_COUNT:
-
 
728
      if (value == null) {
-
 
729
        unsetCodCount();
-
 
730
      } else {
-
 
731
        setCodCount((Long)value);
-
 
732
      }
-
 
733
      break;
-
 
734
 
691
    }
735
    }
692
  }
736
  }
693
 
737
 
694
  public Object getFieldValue(_Fields field) {
738
  public Object getFieldValue(_Fields field) {
695
    switch (field) {
739
    switch (field) {
Line 730... Line 774...
730
      return Double.valueOf(getUnitPrice());
774
      return Double.valueOf(getUnitPrice());
731
 
775
 
732
    case FULFILLED:
776
    case FULFILLED:
733
      return Boolean.valueOf(isFulfilled());
777
      return Boolean.valueOf(isFulfilled());
734
 
778
 
-
 
779
    case COD_COUNT:
-
 
780
      return Long.valueOf(getCodCount());
-
 
781
 
735
    }
782
    }
736
    throw new IllegalStateException();
783
    throw new IllegalStateException();
737
  }
784
  }
738
 
785
 
739
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
786
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
Line 767... Line 814...
767
      return isSetCreatedAt();
814
      return isSetCreatedAt();
768
    case UNIT_PRICE:
815
    case UNIT_PRICE:
769
      return isSetUnitPrice();
816
      return isSetUnitPrice();
770
    case FULFILLED:
817
    case FULFILLED:
771
      return isSetFulfilled();
818
      return isSetFulfilled();
-
 
819
    case COD_COUNT:
-
 
820
      return isSetCodCount();
772
    }
821
    }
773
    throw new IllegalStateException();
822
    throw new IllegalStateException();
774
  }
823
  }
775
 
824
 
776
  @Override
825
  @Override
Line 901... Line 950...
901
        return false;
950
        return false;
902
      if (this.fulfilled != that.fulfilled)
951
      if (this.fulfilled != that.fulfilled)
903
        return false;
952
        return false;
904
    }
953
    }
905
 
954
 
-
 
955
    boolean this_present_codCount = true;
-
 
956
    boolean that_present_codCount = true;
-
 
957
    if (this_present_codCount || that_present_codCount) {
-
 
958
      if (!(this_present_codCount && that_present_codCount))
-
 
959
        return false;
-
 
960
      if (this.codCount != that.codCount)
-
 
961
        return false;
-
 
962
    }
-
 
963
 
906
    return true;
964
    return true;
907
  }
965
  }
908
 
966
 
909
  @Override
967
  @Override
910
  public int hashCode() {
968
  public int hashCode() {
Line 1047... Line 1105...
1047
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fulfilled, typedOther.fulfilled);
1105
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fulfilled, typedOther.fulfilled);
1048
      if (lastComparison != 0) {
1106
      if (lastComparison != 0) {
1049
        return lastComparison;
1107
        return lastComparison;
1050
      }
1108
      }
1051
    }
1109
    }
-
 
1110
    lastComparison = Boolean.valueOf(isSetCodCount()).compareTo(typedOther.isSetCodCount());
-
 
1111
    if (lastComparison != 0) {
-
 
1112
      return lastComparison;
-
 
1113
    }
-
 
1114
    if (isSetCodCount()) {
-
 
1115
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.codCount, typedOther.codCount);
-
 
1116
      if (lastComparison != 0) {
-
 
1117
        return lastComparison;
-
 
1118
      }
-
 
1119
    }
1052
    return 0;
1120
    return 0;
1053
  }
1121
  }
1054
 
1122
 
1055
  public _Fields fieldForId(int fieldId) {
1123
  public _Fields fieldForId(int fieldId) {
1056
    return _Fields.findByThriftId(fieldId);
1124
    return _Fields.findByThriftId(fieldId);
Line 1162... Line 1230...
1162
            setFulfilledIsSet(true);
1230
            setFulfilledIsSet(true);
1163
          } else { 
1231
          } else { 
1164
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1232
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1165
          }
1233
          }
1166
          break;
1234
          break;
-
 
1235
        case 14: // COD_COUNT
-
 
1236
          if (field.type == org.apache.thrift.protocol.TType.I64) {
-
 
1237
            this.codCount = iprot.readI64();
-
 
1238
            setCodCountIsSet(true);
-
 
1239
          } else { 
-
 
1240
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
1241
          }
-
 
1242
          break;
1167
        default:
1243
        default:
1168
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1244
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1169
      }
1245
      }
1170
      iprot.readFieldEnd();
1246
      iprot.readFieldEnd();
1171
    }
1247
    }
Line 1226... Line 1302...
1226
    oprot.writeDouble(this.unitPrice);
1302
    oprot.writeDouble(this.unitPrice);
1227
    oprot.writeFieldEnd();
1303
    oprot.writeFieldEnd();
1228
    oprot.writeFieldBegin(FULFILLED_FIELD_DESC);
1304
    oprot.writeFieldBegin(FULFILLED_FIELD_DESC);
1229
    oprot.writeBool(this.fulfilled);
1305
    oprot.writeBool(this.fulfilled);
1230
    oprot.writeFieldEnd();
1306
    oprot.writeFieldEnd();
-
 
1307
    oprot.writeFieldBegin(COD_COUNT_FIELD_DESC);
-
 
1308
    oprot.writeI64(this.codCount);
-
 
1309
    oprot.writeFieldEnd();
1231
    oprot.writeFieldStop();
1310
    oprot.writeFieldStop();
1232
    oprot.writeStructEnd();
1311
    oprot.writeStructEnd();
1233
  }
1312
  }
1234
 
1313
 
1235
  @Override
1314
  @Override
Line 1310... Line 1389...
1310
    first = false;
1389
    first = false;
1311
    if (!first) sb.append(", ");
1390
    if (!first) sb.append(", ");
1312
    sb.append("fulfilled:");
1391
    sb.append("fulfilled:");
1313
    sb.append(this.fulfilled);
1392
    sb.append(this.fulfilled);
1314
    first = false;
1393
    first = false;
-
 
1394
    if (!first) sb.append(", ");
-
 
1395
    sb.append("codCount:");
-
 
1396
    sb.append(this.codCount);
-
 
1397
    first = false;
1315
    sb.append(")");
1398
    sb.append(")");
1316
    return sb.toString();
1399
    return sb.toString();
1317
  }
1400
  }
1318
 
1401
 
1319
  public void validate() throws org.apache.thrift.TException {
1402
  public void validate() throws org.apache.thrift.TException {