Subversion Repositories SmartDukaan

Rev

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

Rev 18728 Rev 18739
Line 39... Line 39...
39
  private static final org.apache.thrift.protocol.TField COD_AVAILABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("codAvailable", org.apache.thrift.protocol.TType.I64, (short)11);
39
  private static final org.apache.thrift.protocol.TField COD_AVAILABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("codAvailable", org.apache.thrift.protocol.TType.I64, (short)11);
40
  private static final org.apache.thrift.protocol.TField TAGLINE_FIELD_DESC = new org.apache.thrift.protocol.TField("tagline", org.apache.thrift.protocol.TType.STRING, (short)12);
40
  private static final org.apache.thrift.protocol.TField TAGLINE_FIELD_DESC = new org.apache.thrift.protocol.TField("tagline", org.apache.thrift.protocol.TType.STRING, (short)12);
41
  private static final org.apache.thrift.protocol.TField OFFER_FIELD_DESC = new org.apache.thrift.protocol.TField("offer", org.apache.thrift.protocol.TType.STRING, (short)13);
41
  private static final org.apache.thrift.protocol.TField OFFER_FIELD_DESC = new org.apache.thrift.protocol.TField("offer", org.apache.thrift.protocol.TType.STRING, (short)13);
42
  private static final org.apache.thrift.protocol.TField GROSS_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("gross_price", org.apache.thrift.protocol.TType.DOUBLE, (short)14);
42
  private static final org.apache.thrift.protocol.TField GROSS_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("gross_price", org.apache.thrift.protocol.TType.DOUBLE, (short)14);
43
  private static final org.apache.thrift.protocol.TField CHEAPEST_BULK_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("cheapestBulkPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)15);
43
  private static final org.apache.thrift.protocol.TField CHEAPEST_BULK_PRICE_FIELD_DESC = new org.apache.thrift.protocol.TField("cheapestBulkPrice", org.apache.thrift.protocol.TType.DOUBLE, (short)15);
-
 
44
  private static final org.apache.thrift.protocol.TField PACK_QUANTITY_FIELD_DESC = new org.apache.thrift.protocol.TField("packQuantity", org.apache.thrift.protocol.TType.I64, (short)16);
44
 
45
 
45
  private long _id; // required
46
  private long _id; // required
46
  private double available_price; // required
47
  private double available_price; // required
47
  private String marketPlaceUrl; // required
48
  private String marketPlaceUrl; // required
48
  private long in_stock; // required
49
  private long in_stock; // required
Line 55... Line 56...
55
  private long codAvailable; // required
56
  private long codAvailable; // required
56
  private String tagline; // required
57
  private String tagline; // required
57
  private String offer; // required
58
  private String offer; // required
58
  private double gross_price; // required
59
  private double gross_price; // required
59
  private double cheapestBulkPrice; // required
60
  private double cheapestBulkPrice; // required
-
 
61
  private long packQuantity; // required
60
 
62
 
61
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
63
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
62
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
64
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
63
    _ID((short)1, "_id"),
65
    _ID((short)1, "_id"),
64
    AVAILABLE_PRICE((short)2, "available_price"),
66
    AVAILABLE_PRICE((short)2, "available_price"),
Line 72... Line 74...
72
    COUPON((short)10, "coupon"),
74
    COUPON((short)10, "coupon"),
73
    COD_AVAILABLE((short)11, "codAvailable"),
75
    COD_AVAILABLE((short)11, "codAvailable"),
74
    TAGLINE((short)12, "tagline"),
76
    TAGLINE((short)12, "tagline"),
75
    OFFER((short)13, "offer"),
77
    OFFER((short)13, "offer"),
76
    GROSS_PRICE((short)14, "gross_price"),
78
    GROSS_PRICE((short)14, "gross_price"),
77
    CHEAPEST_BULK_PRICE((short)15, "cheapestBulkPrice");
79
    CHEAPEST_BULK_PRICE((short)15, "cheapestBulkPrice"),
-
 
80
    PACK_QUANTITY((short)16, "packQuantity");
78
 
81
 
79
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
82
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
80
 
83
 
81
    static {
84
    static {
82
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
85
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
Line 117... Line 120...
117
          return OFFER;
120
          return OFFER;
118
        case 14: // GROSS_PRICE
121
        case 14: // GROSS_PRICE
119
          return GROSS_PRICE;
122
          return GROSS_PRICE;
120
        case 15: // CHEAPEST_BULK_PRICE
123
        case 15: // CHEAPEST_BULK_PRICE
121
          return CHEAPEST_BULK_PRICE;
124
          return CHEAPEST_BULK_PRICE;
-
 
125
        case 16: // PACK_QUANTITY
-
 
126
          return PACK_QUANTITY;
122
        default:
127
        default:
123
          return null;
128
          return null;
124
      }
129
      }
125
    }
130
    }
126
 
131
 
Line 166... Line 171...
166
  private static final int __CASH_BACK_TYPE_ISSET_ID = 4;
171
  private static final int __CASH_BACK_TYPE_ISSET_ID = 4;
167
  private static final int __CASH_BACK_ISSET_ID = 5;
172
  private static final int __CASH_BACK_ISSET_ID = 5;
168
  private static final int __CODAVAILABLE_ISSET_ID = 6;
173
  private static final int __CODAVAILABLE_ISSET_ID = 6;
169
  private static final int __GROSS_PRICE_ISSET_ID = 7;
174
  private static final int __GROSS_PRICE_ISSET_ID = 7;
170
  private static final int __CHEAPESTBULKPRICE_ISSET_ID = 8;
175
  private static final int __CHEAPESTBULKPRICE_ISSET_ID = 8;
-
 
176
  private static final int __PACKQUANTITY_ISSET_ID = 9;
171
  private BitSet __isset_bit_vector = new BitSet(9);
177
  private BitSet __isset_bit_vector = new BitSet(10);
172
 
178
 
173
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
179
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
174
  static {
180
  static {
175
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
181
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
176
    tmpMap.put(_Fields._ID, new org.apache.thrift.meta_data.FieldMetaData("_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
182
    tmpMap.put(_Fields._ID, new org.apache.thrift.meta_data.FieldMetaData("_id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
Line 201... Line 207...
201
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
207
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
202
    tmpMap.put(_Fields.GROSS_PRICE, new org.apache.thrift.meta_data.FieldMetaData("gross_price", org.apache.thrift.TFieldRequirementType.DEFAULT, 
208
    tmpMap.put(_Fields.GROSS_PRICE, new org.apache.thrift.meta_data.FieldMetaData("gross_price", org.apache.thrift.TFieldRequirementType.DEFAULT, 
203
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
209
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
204
    tmpMap.put(_Fields.CHEAPEST_BULK_PRICE, new org.apache.thrift.meta_data.FieldMetaData("cheapestBulkPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
210
    tmpMap.put(_Fields.CHEAPEST_BULK_PRICE, new org.apache.thrift.meta_data.FieldMetaData("cheapestBulkPrice", org.apache.thrift.TFieldRequirementType.DEFAULT, 
205
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
211
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
-
 
212
    tmpMap.put(_Fields.PACK_QUANTITY, new org.apache.thrift.meta_data.FieldMetaData("packQuantity", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
213
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
206
    metaDataMap = Collections.unmodifiableMap(tmpMap);
214
    metaDataMap = Collections.unmodifiableMap(tmpMap);
207
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(LivePricing.class, metaDataMap);
215
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(LivePricing.class, metaDataMap);
208
  }
216
  }
209
 
217
 
210
  public LivePricing() {
218
  public LivePricing() {
Line 223... Line 231...
223
    String coupon,
231
    String coupon,
224
    long codAvailable,
232
    long codAvailable,
225
    String tagline,
233
    String tagline,
226
    String offer,
234
    String offer,
227
    double gross_price,
235
    double gross_price,
228
    double cheapestBulkPrice)
236
    double cheapestBulkPrice,
-
 
237
    long packQuantity)
229
  {
238
  {
230
    this();
239
    this();
231
    this._id = _id;
240
    this._id = _id;
232
    set_idIsSet(true);
241
    set_idIsSet(true);
233
    this.available_price = available_price;
242
    this.available_price = available_price;
Line 250... Line 259...
250
    this.offer = offer;
259
    this.offer = offer;
251
    this.gross_price = gross_price;
260
    this.gross_price = gross_price;
252
    setGross_priceIsSet(true);
261
    setGross_priceIsSet(true);
253
    this.cheapestBulkPrice = cheapestBulkPrice;
262
    this.cheapestBulkPrice = cheapestBulkPrice;
254
    setCheapestBulkPriceIsSet(true);
263
    setCheapestBulkPriceIsSet(true);
-
 
264
    this.packQuantity = packQuantity;
-
 
265
    setPackQuantityIsSet(true);
255
  }
266
  }
256
 
267
 
257
  /**
268
  /**
258
   * Performs a deep copy on <i>other</i>.
269
   * Performs a deep copy on <i>other</i>.
259
   */
270
   */
Line 285... Line 296...
285
    if (other.isSetOffer()) {
296
    if (other.isSetOffer()) {
286
      this.offer = other.offer;
297
      this.offer = other.offer;
287
    }
298
    }
288
    this.gross_price = other.gross_price;
299
    this.gross_price = other.gross_price;
289
    this.cheapestBulkPrice = other.cheapestBulkPrice;
300
    this.cheapestBulkPrice = other.cheapestBulkPrice;
-
 
301
    this.packQuantity = other.packQuantity;
290
  }
302
  }
291
 
303
 
292
  public LivePricing deepCopy() {
304
  public LivePricing deepCopy() {
293
    return new LivePricing(this);
305
    return new LivePricing(this);
294
  }
306
  }
Line 317... Line 329...
317
    this.offer = null;
329
    this.offer = null;
318
    setGross_priceIsSet(false);
330
    setGross_priceIsSet(false);
319
    this.gross_price = 0.0;
331
    this.gross_price = 0.0;
320
    setCheapestBulkPriceIsSet(false);
332
    setCheapestBulkPriceIsSet(false);
321
    this.cheapestBulkPrice = 0.0;
333
    this.cheapestBulkPrice = 0.0;
-
 
334
    setPackQuantityIsSet(false);
-
 
335
    this.packQuantity = 0;
322
  }
336
  }
323
 
337
 
324
  public long get_id() {
338
  public long get_id() {
325
    return this._id;
339
    return this._id;
326
  }
340
  }
Line 655... Line 669...
655
 
669
 
656
  public void setCheapestBulkPriceIsSet(boolean value) {
670
  public void setCheapestBulkPriceIsSet(boolean value) {
657
    __isset_bit_vector.set(__CHEAPESTBULKPRICE_ISSET_ID, value);
671
    __isset_bit_vector.set(__CHEAPESTBULKPRICE_ISSET_ID, value);
658
  }
672
  }
659
 
673
 
-
 
674
  public long getPackQuantity() {
-
 
675
    return this.packQuantity;
-
 
676
  }
-
 
677
 
-
 
678
  public void setPackQuantity(long packQuantity) {
-
 
679
    this.packQuantity = packQuantity;
-
 
680
    setPackQuantityIsSet(true);
-
 
681
  }
-
 
682
 
-
 
683
  public void unsetPackQuantity() {
-
 
684
    __isset_bit_vector.clear(__PACKQUANTITY_ISSET_ID);
-
 
685
  }
-
 
686
 
-
 
687
  /** Returns true if field packQuantity is set (has been assigned a value) and false otherwise */
-
 
688
  public boolean isSetPackQuantity() {
-
 
689
    return __isset_bit_vector.get(__PACKQUANTITY_ISSET_ID);
-
 
690
  }
-
 
691
 
-
 
692
  public void setPackQuantityIsSet(boolean value) {
-
 
693
    __isset_bit_vector.set(__PACKQUANTITY_ISSET_ID, value);
-
 
694
  }
-
 
695
 
660
  public void setFieldValue(_Fields field, Object value) {
696
  public void setFieldValue(_Fields field, Object value) {
661
    switch (field) {
697
    switch (field) {
662
    case _ID:
698
    case _ID:
663
      if (value == null) {
699
      if (value == null) {
664
        unset_id();
700
        unset_id();
Line 777... Line 813...
777
      } else {
813
      } else {
778
        setCheapestBulkPrice((Double)value);
814
        setCheapestBulkPrice((Double)value);
779
      }
815
      }
780
      break;
816
      break;
781
 
817
 
-
 
818
    case PACK_QUANTITY:
-
 
819
      if (value == null) {
-
 
820
        unsetPackQuantity();
-
 
821
      } else {
-
 
822
        setPackQuantity((Long)value);
-
 
823
      }
-
 
824
      break;
-
 
825
 
782
    }
826
    }
783
  }
827
  }
784
 
828
 
785
  public Object getFieldValue(_Fields field) {
829
  public Object getFieldValue(_Fields field) {
786
    switch (field) {
830
    switch (field) {
Line 827... Line 871...
827
      return Double.valueOf(getGross_price());
871
      return Double.valueOf(getGross_price());
828
 
872
 
829
    case CHEAPEST_BULK_PRICE:
873
    case CHEAPEST_BULK_PRICE:
830
      return Double.valueOf(getCheapestBulkPrice());
874
      return Double.valueOf(getCheapestBulkPrice());
831
 
875
 
-
 
876
    case PACK_QUANTITY:
-
 
877
      return Long.valueOf(getPackQuantity());
-
 
878
 
832
    }
879
    }
833
    throw new IllegalStateException();
880
    throw new IllegalStateException();
834
  }
881
  }
835
 
882
 
836
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
883
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
Line 868... Line 915...
868
      return isSetOffer();
915
      return isSetOffer();
869
    case GROSS_PRICE:
916
    case GROSS_PRICE:
870
      return isSetGross_price();
917
      return isSetGross_price();
871
    case CHEAPEST_BULK_PRICE:
918
    case CHEAPEST_BULK_PRICE:
872
      return isSetCheapestBulkPrice();
919
      return isSetCheapestBulkPrice();
-
 
920
    case PACK_QUANTITY:
-
 
921
      return isSetPackQuantity();
873
    }
922
    }
874
    throw new IllegalStateException();
923
    throw new IllegalStateException();
875
  }
924
  }
876
 
925
 
877
  @Override
926
  @Override
Line 1020... Line 1069...
1020
        return false;
1069
        return false;
1021
      if (this.cheapestBulkPrice != that.cheapestBulkPrice)
1070
      if (this.cheapestBulkPrice != that.cheapestBulkPrice)
1022
        return false;
1071
        return false;
1023
    }
1072
    }
1024
 
1073
 
-
 
1074
    boolean this_present_packQuantity = true;
-
 
1075
    boolean that_present_packQuantity = true;
-
 
1076
    if (this_present_packQuantity || that_present_packQuantity) {
-
 
1077
      if (!(this_present_packQuantity && that_present_packQuantity))
-
 
1078
        return false;
-
 
1079
      if (this.packQuantity != that.packQuantity)
-
 
1080
        return false;
-
 
1081
    }
-
 
1082
 
1025
    return true;
1083
    return true;
1026
  }
1084
  }
1027
 
1085
 
1028
  @Override
1086
  @Override
1029
  public int hashCode() {
1087
  public int hashCode() {
Line 1186... Line 1244...
1186
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cheapestBulkPrice, typedOther.cheapestBulkPrice);
1244
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cheapestBulkPrice, typedOther.cheapestBulkPrice);
1187
      if (lastComparison != 0) {
1245
      if (lastComparison != 0) {
1188
        return lastComparison;
1246
        return lastComparison;
1189
      }
1247
      }
1190
    }
1248
    }
-
 
1249
    lastComparison = Boolean.valueOf(isSetPackQuantity()).compareTo(typedOther.isSetPackQuantity());
-
 
1250
    if (lastComparison != 0) {
-
 
1251
      return lastComparison;
-
 
1252
    }
-
 
1253
    if (isSetPackQuantity()) {
-
 
1254
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.packQuantity, typedOther.packQuantity);
-
 
1255
      if (lastComparison != 0) {
-
 
1256
        return lastComparison;
-
 
1257
      }
-
 
1258
    }
1191
    return 0;
1259
    return 0;
1192
  }
1260
  }
1193
 
1261
 
1194
  public _Fields fieldForId(int fieldId) {
1262
  public _Fields fieldForId(int fieldId) {
1195
    return _Fields.findByThriftId(fieldId);
1263
    return _Fields.findByThriftId(fieldId);
Line 1317... Line 1385...
1317
            setCheapestBulkPriceIsSet(true);
1385
            setCheapestBulkPriceIsSet(true);
1318
          } else { 
1386
          } else { 
1319
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1387
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1320
          }
1388
          }
1321
          break;
1389
          break;
-
 
1390
        case 16: // PACK_QUANTITY
-
 
1391
          if (field.type == org.apache.thrift.protocol.TType.I64) {
-
 
1392
            this.packQuantity = iprot.readI64();
-
 
1393
            setPackQuantityIsSet(true);
-
 
1394
          } else { 
-
 
1395
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
1396
          }
-
 
1397
          break;
1322
        default:
1398
        default:
1323
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1399
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
1324
      }
1400
      }
1325
      iprot.readFieldEnd();
1401
      iprot.readFieldEnd();
1326
    }
1402
    }
Line 1387... Line 1463...
1387
    oprot.writeDouble(this.gross_price);
1463
    oprot.writeDouble(this.gross_price);
1388
    oprot.writeFieldEnd();
1464
    oprot.writeFieldEnd();
1389
    oprot.writeFieldBegin(CHEAPEST_BULK_PRICE_FIELD_DESC);
1465
    oprot.writeFieldBegin(CHEAPEST_BULK_PRICE_FIELD_DESC);
1390
    oprot.writeDouble(this.cheapestBulkPrice);
1466
    oprot.writeDouble(this.cheapestBulkPrice);
1391
    oprot.writeFieldEnd();
1467
    oprot.writeFieldEnd();
-
 
1468
    oprot.writeFieldBegin(PACK_QUANTITY_FIELD_DESC);
-
 
1469
    oprot.writeI64(this.packQuantity);
-
 
1470
    oprot.writeFieldEnd();
1392
    oprot.writeFieldStop();
1471
    oprot.writeFieldStop();
1393
    oprot.writeStructEnd();
1472
    oprot.writeStructEnd();
1394
  }
1473
  }
1395
 
1474
 
1396
  @Override
1475
  @Override
Line 1479... Line 1558...
1479
    first = false;
1558
    first = false;
1480
    if (!first) sb.append(", ");
1559
    if (!first) sb.append(", ");
1481
    sb.append("cheapestBulkPrice:");
1560
    sb.append("cheapestBulkPrice:");
1482
    sb.append(this.cheapestBulkPrice);
1561
    sb.append(this.cheapestBulkPrice);
1483
    first = false;
1562
    first = false;
-
 
1563
    if (!first) sb.append(", ");
-
 
1564
    sb.append("packQuantity:");
-
 
1565
    sb.append(this.packQuantity);
-
 
1566
    first = false;
1484
    sb.append(")");
1567
    sb.append(")");
1485
    return sb.toString();
1568
    return sb.toString();
1486
  }
1569
  }
1487
 
1570
 
1488
  public void validate() throws org.apache.thrift.TException {
1571
  public void validate() throws org.apache.thrift.TException {