Subversion Repositories SmartDukaan

Rev

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

Rev 3430 Rev 4295
Line 54... Line 54...
54
  private static final org.apache.thrift.protocol.TField BEST_SELLING_RANK_FIELD_DESC = new org.apache.thrift.protocol.TField("bestSellingRank", org.apache.thrift.protocol.TType.I64, (short)29);
54
  private static final org.apache.thrift.protocol.TField BEST_SELLING_RANK_FIELD_DESC = new org.apache.thrift.protocol.TField("bestSellingRank", org.apache.thrift.protocol.TType.I64, (short)29);
55
  private static final org.apache.thrift.protocol.TField HOTSPOT_CATEGORY_FIELD_DESC = new org.apache.thrift.protocol.TField("hotspotCategory", org.apache.thrift.protocol.TType.STRING, (short)30);
55
  private static final org.apache.thrift.protocol.TField HOTSPOT_CATEGORY_FIELD_DESC = new org.apache.thrift.protocol.TField("hotspotCategory", org.apache.thrift.protocol.TType.STRING, (short)30);
56
  private static final org.apache.thrift.protocol.TField RISKY_FIELD_DESC = new org.apache.thrift.protocol.TField("risky", org.apache.thrift.protocol.TType.BOOL, (short)31);
56
  private static final org.apache.thrift.protocol.TField RISKY_FIELD_DESC = new org.apache.thrift.protocol.TField("risky", org.apache.thrift.protocol.TType.BOOL, (short)31);
57
  private static final org.apache.thrift.protocol.TField EXPECTED_DELAY_FIELD_DESC = new org.apache.thrift.protocol.TField("expectedDelay", org.apache.thrift.protocol.TType.I32, (short)32);
57
  private static final org.apache.thrift.protocol.TField EXPECTED_DELAY_FIELD_DESC = new org.apache.thrift.protocol.TField("expectedDelay", org.apache.thrift.protocol.TType.I32, (short)32);
58
  private static final org.apache.thrift.protocol.TField PREFERRED_WAREHOUSE_FIELD_DESC = new org.apache.thrift.protocol.TField("preferredWarehouse", org.apache.thrift.protocol.TType.STRING, (short)33);
58
  private static final org.apache.thrift.protocol.TField PREFERRED_WAREHOUSE_FIELD_DESC = new org.apache.thrift.protocol.TField("preferredWarehouse", org.apache.thrift.protocol.TType.STRING, (short)33);
-
 
59
  private static final org.apache.thrift.protocol.TField WARRANTY_PERIOD_FIELD_DESC = new org.apache.thrift.protocol.TField("warrantyPeriod", org.apache.thrift.protocol.TType.I32, (short)34);
59
 
60
 
60
  private long id; // required
61
  private long id; // required
61
  private String productGroup; // required
62
  private String productGroup; // required
62
  private String brand; // required
63
  private String brand; // required
63
  private String modelNumber; // required
64
  private String modelNumber; // required
Line 88... Line 89...
88
  private long bestSellingRank; // required
89
  private long bestSellingRank; // required
89
  private String hotspotCategory; // required
90
  private String hotspotCategory; // required
90
  private boolean risky; // required
91
  private boolean risky; // required
91
  private int expectedDelay; // required
92
  private int expectedDelay; // required
92
  private String preferredWarehouse; // required
93
  private String preferredWarehouse; // required
-
 
94
  private int warrantyPeriod; // required
93
 
95
 
94
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
96
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
95
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
97
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
96
    ID((short)1, "id"),
98
    ID((short)1, "id"),
97
    PRODUCT_GROUP((short)2, "productGroup"),
99
    PRODUCT_GROUP((short)2, "productGroup"),
Line 127... Line 129...
127
    UPDATED_ON((short)28, "updatedOn"),
129
    UPDATED_ON((short)28, "updatedOn"),
128
    BEST_SELLING_RANK((short)29, "bestSellingRank"),
130
    BEST_SELLING_RANK((short)29, "bestSellingRank"),
129
    HOTSPOT_CATEGORY((short)30, "hotspotCategory"),
131
    HOTSPOT_CATEGORY((short)30, "hotspotCategory"),
130
    RISKY((short)31, "risky"),
132
    RISKY((short)31, "risky"),
131
    EXPECTED_DELAY((short)32, "expectedDelay"),
133
    EXPECTED_DELAY((short)32, "expectedDelay"),
132
    PREFERRED_WAREHOUSE((short)33, "preferredWarehouse");
134
    PREFERRED_WAREHOUSE((short)33, "preferredWarehouse"),
-
 
135
    WARRANTY_PERIOD((short)34, "warrantyPeriod");
133
 
136
 
134
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
137
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
135
 
138
 
136
    static {
139
    static {
137
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
140
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
Line 208... Line 211...
208
          return RISKY;
211
          return RISKY;
209
        case 32: // EXPECTED_DELAY
212
        case 32: // EXPECTED_DELAY
210
          return EXPECTED_DELAY;
213
          return EXPECTED_DELAY;
211
        case 33: // PREFERRED_WAREHOUSE
214
        case 33: // PREFERRED_WAREHOUSE
212
          return PREFERRED_WAREHOUSE;
215
          return PREFERRED_WAREHOUSE;
-
 
216
        case 34: // WARRANTY_PERIOD
-
 
217
          return WARRANTY_PERIOD;
213
        default:
218
        default:
214
          return null;
219
          return null;
215
      }
220
      }
216
    }
221
    }
217
 
222
 
Line 267... Line 272...
267
  private static final int __DEFAULTFORENTITY_ISSET_ID = 14;
272
  private static final int __DEFAULTFORENTITY_ISSET_ID = 14;
268
  private static final int __UPDATEDON_ISSET_ID = 15;
273
  private static final int __UPDATEDON_ISSET_ID = 15;
269
  private static final int __BESTSELLINGRANK_ISSET_ID = 16;
274
  private static final int __BESTSELLINGRANK_ISSET_ID = 16;
270
  private static final int __RISKY_ISSET_ID = 17;
275
  private static final int __RISKY_ISSET_ID = 17;
271
  private static final int __EXPECTEDDELAY_ISSET_ID = 18;
276
  private static final int __EXPECTEDDELAY_ISSET_ID = 18;
-
 
277
  private static final int __WARRANTYPERIOD_ISSET_ID = 19;
272
  private BitSet __isset_bit_vector = new BitSet(19);
278
  private BitSet __isset_bit_vector = new BitSet(20);
273
 
279
 
274
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
280
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
275
  static {
281
  static {
276
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
282
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
277
    tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
283
    tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
Line 340... Line 346...
340
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
346
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
341
    tmpMap.put(_Fields.EXPECTED_DELAY, new org.apache.thrift.meta_data.FieldMetaData("expectedDelay", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
347
    tmpMap.put(_Fields.EXPECTED_DELAY, new org.apache.thrift.meta_data.FieldMetaData("expectedDelay", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
342
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
348
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
343
    tmpMap.put(_Fields.PREFERRED_WAREHOUSE, new org.apache.thrift.meta_data.FieldMetaData("preferredWarehouse", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
349
    tmpMap.put(_Fields.PREFERRED_WAREHOUSE, new org.apache.thrift.meta_data.FieldMetaData("preferredWarehouse", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
344
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
350
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-
 
351
    tmpMap.put(_Fields.WARRANTY_PERIOD, new org.apache.thrift.meta_data.FieldMetaData("warrantyPeriod", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
352
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
345
    metaDataMap = Collections.unmodifiableMap(tmpMap);
353
    metaDataMap = Collections.unmodifiableMap(tmpMap);
346
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Item.class, metaDataMap);
354
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Item.class, metaDataMap);
347
  }
355
  }
348
 
356
 
349
  public Item() {
357
  public Item() {
Line 368... Line 376...
368
    Map<String,String> otherInfo,
376
    Map<String,String> otherInfo,
369
    String bestDealText,
377
    String bestDealText,
370
    boolean defaultForEntity,
378
    boolean defaultForEntity,
371
    long updatedOn,
379
    long updatedOn,
372
    String hotspotCategory,
380
    String hotspotCategory,
373
    boolean risky)
381
    boolean risky,
-
 
382
    int warrantyPeriod)
374
  {
383
  {
375
    this();
384
    this();
376
    this.id = id;
385
    this.id = id;
377
    setIdIsSet(true);
386
    setIdIsSet(true);
378
    this.productGroup = productGroup;
387
    this.productGroup = productGroup;
Line 400... Line 409...
400
    this.updatedOn = updatedOn;
409
    this.updatedOn = updatedOn;
401
    setUpdatedOnIsSet(true);
410
    setUpdatedOnIsSet(true);
402
    this.hotspotCategory = hotspotCategory;
411
    this.hotspotCategory = hotspotCategory;
403
    this.risky = risky;
412
    this.risky = risky;
404
    setRiskyIsSet(true);
413
    setRiskyIsSet(true);
-
 
414
    this.warrantyPeriod = warrantyPeriod;
-
 
415
    setWarrantyPeriodIsSet(true);
405
  }
416
  }
406
 
417
 
407
  /**
418
  /**
408
   * Performs a deep copy on <i>other</i>.
419
   * Performs a deep copy on <i>other</i>.
409
   */
420
   */
Line 481... Line 492...
481
    this.risky = other.risky;
492
    this.risky = other.risky;
482
    this.expectedDelay = other.expectedDelay;
493
    this.expectedDelay = other.expectedDelay;
483
    if (other.isSetPreferredWarehouse()) {
494
    if (other.isSetPreferredWarehouse()) {
484
      this.preferredWarehouse = other.preferredWarehouse;
495
      this.preferredWarehouse = other.preferredWarehouse;
485
    }
496
    }
-
 
497
    this.warrantyPeriod = other.warrantyPeriod;
486
  }
498
  }
487
 
499
 
488
  public Item deepCopy() {
500
  public Item deepCopy() {
489
    return new Item(this);
501
    return new Item(this);
490
  }
502
  }
Line 541... Line 553...
541
    setRiskyIsSet(false);
553
    setRiskyIsSet(false);
542
    this.risky = false;
554
    this.risky = false;
543
    setExpectedDelayIsSet(false);
555
    setExpectedDelayIsSet(false);
544
    this.expectedDelay = 0;
556
    this.expectedDelay = 0;
545
    this.preferredWarehouse = null;
557
    this.preferredWarehouse = null;
-
 
558
    setWarrantyPeriodIsSet(false);
-
 
559
    this.warrantyPeriod = 0;
546
  }
560
  }
547
 
561
 
548
  public long getId() {
562
  public long getId() {
549
    return this.id;
563
    return this.id;
550
  }
564
  }
Line 1302... Line 1316...
1302
    if (!value) {
1316
    if (!value) {
1303
      this.preferredWarehouse = null;
1317
      this.preferredWarehouse = null;
1304
    }
1318
    }
1305
  }
1319
  }
1306
 
1320
 
-
 
1321
  public int getWarrantyPeriod() {
-
 
1322
    return this.warrantyPeriod;
-
 
1323
  }
-
 
1324
 
-
 
1325
  public void setWarrantyPeriod(int warrantyPeriod) {
-
 
1326
    this.warrantyPeriod = warrantyPeriod;
-
 
1327
    setWarrantyPeriodIsSet(true);
-
 
1328
  }
-
 
1329
 
-
 
1330
  public void unsetWarrantyPeriod() {
-
 
1331
    __isset_bit_vector.clear(__WARRANTYPERIOD_ISSET_ID);
-
 
1332
  }
-
 
1333
 
-
 
1334
  /** Returns true if field warrantyPeriod is set (has been assigned a value) and false otherwise */
-
 
1335
  public boolean isSetWarrantyPeriod() {
-
 
1336
    return __isset_bit_vector.get(__WARRANTYPERIOD_ISSET_ID);
-
 
1337
  }
-
 
1338
 
-
 
1339
  public void setWarrantyPeriodIsSet(boolean value) {
-
 
1340
    __isset_bit_vector.set(__WARRANTYPERIOD_ISSET_ID, value);
-
 
1341
  }
-
 
1342
 
1307
  public void setFieldValue(_Fields field, Object value) {
1343
  public void setFieldValue(_Fields field, Object value) {
1308
    switch (field) {
1344
    switch (field) {
1309
    case ID:
1345
    case ID:
1310
      if (value == null) {
1346
      if (value == null) {
1311
        unsetId();
1347
        unsetId();
Line 1568... Line 1604...
1568
      } else {
1604
      } else {
1569
        setPreferredWarehouse((String)value);
1605
        setPreferredWarehouse((String)value);
1570
      }
1606
      }
1571
      break;
1607
      break;
1572
 
1608
 
-
 
1609
    case WARRANTY_PERIOD:
-
 
1610
      if (value == null) {
-
 
1611
        unsetWarrantyPeriod();
-
 
1612
      } else {
-
 
1613
        setWarrantyPeriod((Integer)value);
-
 
1614
      }
-
 
1615
      break;
-
 
1616
 
1573
    }
1617
    }
1574
  }
1618
  }
1575
 
1619
 
1576
  public Object getFieldValue(_Fields field) {
1620
  public Object getFieldValue(_Fields field) {
1577
    switch (field) {
1621
    switch (field) {
Line 1672... Line 1716...
1672
      return Integer.valueOf(getExpectedDelay());
1716
      return Integer.valueOf(getExpectedDelay());
1673
 
1717
 
1674
    case PREFERRED_WAREHOUSE:
1718
    case PREFERRED_WAREHOUSE:
1675
      return getPreferredWarehouse();
1719
      return getPreferredWarehouse();
1676
 
1720
 
-
 
1721
    case WARRANTY_PERIOD:
-
 
1722
      return Integer.valueOf(getWarrantyPeriod());
-
 
1723
 
1677
    }
1724
    }
1678
    throw new IllegalStateException();
1725
    throw new IllegalStateException();
1679
  }
1726
  }
1680
 
1727
 
1681
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
1728
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
Line 1749... Line 1796...
1749
      return isSetRisky();
1796
      return isSetRisky();
1750
    case EXPECTED_DELAY:
1797
    case EXPECTED_DELAY:
1751
      return isSetExpectedDelay();
1798
      return isSetExpectedDelay();
1752
    case PREFERRED_WAREHOUSE:
1799
    case PREFERRED_WAREHOUSE:
1753
      return isSetPreferredWarehouse();
1800
      return isSetPreferredWarehouse();
-
 
1801
    case WARRANTY_PERIOD:
-
 
1802
      return isSetWarrantyPeriod();
1754
    }
1803
    }
1755
    throw new IllegalStateException();
1804
    throw new IllegalStateException();
1756
  }
1805
  }
1757
 
1806
 
1758
  @Override
1807
  @Override
Line 2063... Line 2112...
2063
        return false;
2112
        return false;
2064
      if (!this.preferredWarehouse.equals(that.preferredWarehouse))
2113
      if (!this.preferredWarehouse.equals(that.preferredWarehouse))
2065
        return false;
2114
        return false;
2066
    }
2115
    }
2067
 
2116
 
-
 
2117
    boolean this_present_warrantyPeriod = true;
-
 
2118
    boolean that_present_warrantyPeriod = true;
-
 
2119
    if (this_present_warrantyPeriod || that_present_warrantyPeriod) {
-
 
2120
      if (!(this_present_warrantyPeriod && that_present_warrantyPeriod))
-
 
2121
        return false;
-
 
2122
      if (this.warrantyPeriod != that.warrantyPeriod)
-
 
2123
        return false;
-
 
2124
    }
-
 
2125
 
2068
    return true;
2126
    return true;
2069
  }
2127
  }
2070
 
2128
 
2071
  @Override
2129
  @Override
2072
  public int hashCode() {
2130
  public int hashCode() {
Line 2409... Line 2467...
2409
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.preferredWarehouse, typedOther.preferredWarehouse);
2467
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.preferredWarehouse, typedOther.preferredWarehouse);
2410
      if (lastComparison != 0) {
2468
      if (lastComparison != 0) {
2411
        return lastComparison;
2469
        return lastComparison;
2412
      }
2470
      }
2413
    }
2471
    }
-
 
2472
    lastComparison = Boolean.valueOf(isSetWarrantyPeriod()).compareTo(typedOther.isSetWarrantyPeriod());
-
 
2473
    if (lastComparison != 0) {
-
 
2474
      return lastComparison;
-
 
2475
    }
-
 
2476
    if (isSetWarrantyPeriod()) {
-
 
2477
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.warrantyPeriod, typedOther.warrantyPeriod);
-
 
2478
      if (lastComparison != 0) {
-
 
2479
        return lastComparison;
-
 
2480
      }
-
 
2481
    }
2414
    return 0;
2482
    return 0;
2415
  }
2483
  }
2416
 
2484
 
2417
  public _Fields fieldForId(int fieldId) {
2485
  public _Fields fieldForId(int fieldId) {
2418
    return _Fields.findByThriftId(fieldId);
2486
    return _Fields.findByThriftId(fieldId);
Line 2689... Line 2757...
2689
            this.preferredWarehouse = iprot.readString();
2757
            this.preferredWarehouse = iprot.readString();
2690
          } else { 
2758
          } else { 
2691
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2759
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2692
          }
2760
          }
2693
          break;
2761
          break;
-
 
2762
        case 34: // WARRANTY_PERIOD
-
 
2763
          if (field.type == org.apache.thrift.protocol.TType.I32) {
-
 
2764
            this.warrantyPeriod = iprot.readI32();
-
 
2765
            setWarrantyPeriodIsSet(true);
-
 
2766
          } else { 
-
 
2767
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
2768
          }
-
 
2769
          break;
2694
        default:
2770
        default:
2695
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2771
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2696
      }
2772
      }
2697
      iprot.readFieldEnd();
2773
      iprot.readFieldEnd();
2698
    }
2774
    }
Line 2861... Line 2937...
2861
        oprot.writeFieldBegin(PREFERRED_WAREHOUSE_FIELD_DESC);
2937
        oprot.writeFieldBegin(PREFERRED_WAREHOUSE_FIELD_DESC);
2862
        oprot.writeString(this.preferredWarehouse);
2938
        oprot.writeString(this.preferredWarehouse);
2863
        oprot.writeFieldEnd();
2939
        oprot.writeFieldEnd();
2864
      }
2940
      }
2865
    }
2941
    }
-
 
2942
    oprot.writeFieldBegin(WARRANTY_PERIOD_FIELD_DESC);
-
 
2943
    oprot.writeI32(this.warrantyPeriod);
-
 
2944
    oprot.writeFieldEnd();
2866
    oprot.writeFieldStop();
2945
    oprot.writeFieldStop();
2867
    oprot.writeStructEnd();
2946
    oprot.writeStructEnd();
2868
  }
2947
  }
2869
 
2948
 
2870
  @Override
2949
  @Override
Line 3081... Line 3160...
3081
      } else {
3160
      } else {
3082
        sb.append(this.preferredWarehouse);
3161
        sb.append(this.preferredWarehouse);
3083
      }
3162
      }
3084
      first = false;
3163
      first = false;
3085
    }
3164
    }
-
 
3165
    if (!first) sb.append(", ");
-
 
3166
    sb.append("warrantyPeriod:");
-
 
3167
    sb.append(this.warrantyPeriod);
-
 
3168
    first = false;
3086
    sb.append(")");
3169
    sb.append(")");
3087
    return sb.toString();
3170
    return sb.toString();
3088
  }
3171
  }
3089
 
3172
 
3090
  public void validate() throws org.apache.thrift.TException {
3173
  public void validate() throws org.apache.thrift.TException {