Subversion Repositories SmartDukaan

Rev

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

Rev 4762 Rev 5110
Line 54... Line 54...
54
  private static final org.apache.thrift.protocol.TField PREFERRED_WAREHOUSE_FIELD_DESC = new org.apache.thrift.protocol.TField("preferredWarehouse", org.apache.thrift.protocol.TType.I64, (short)29);
54
  private static final org.apache.thrift.protocol.TField PREFERRED_WAREHOUSE_FIELD_DESC = new org.apache.thrift.protocol.TField("preferredWarehouse", org.apache.thrift.protocol.TType.I64, (short)29);
55
  private static final org.apache.thrift.protocol.TField DEFAULT_WAREHOUSE_FIELD_DESC = new org.apache.thrift.protocol.TField("defaultWarehouse", org.apache.thrift.protocol.TType.I64, (short)30);
55
  private static final org.apache.thrift.protocol.TField DEFAULT_WAREHOUSE_FIELD_DESC = new org.apache.thrift.protocol.TField("defaultWarehouse", org.apache.thrift.protocol.TType.I64, (short)30);
56
  private static final org.apache.thrift.protocol.TField IS_WAREHOUSE_PREFERENCE_STICKY_FIELD_DESC = new org.apache.thrift.protocol.TField("isWarehousePreferenceSticky", org.apache.thrift.protocol.TType.BOOL, (short)31);
56
  private static final org.apache.thrift.protocol.TField IS_WAREHOUSE_PREFERENCE_STICKY_FIELD_DESC = new org.apache.thrift.protocol.TField("isWarehousePreferenceSticky", org.apache.thrift.protocol.TType.BOOL, (short)31);
57
  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)32);
57
  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)32);
58
  private static final org.apache.thrift.protocol.TField PREFERRED_VENDOR_FIELD_DESC = new org.apache.thrift.protocol.TField("preferredVendor", org.apache.thrift.protocol.TType.I64, (short)33);
58
  private static final org.apache.thrift.protocol.TField PREFERRED_VENDOR_FIELD_DESC = new org.apache.thrift.protocol.TField("preferredVendor", org.apache.thrift.protocol.TType.I64, (short)33);
-
 
59
  private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", 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 preferredWarehouse; // required
89
  private long preferredWarehouse; // required
89
  private long defaultWarehouse; // required
90
  private long defaultWarehouse; // required
90
  private boolean isWarehousePreferenceSticky; // required
91
  private boolean isWarehousePreferenceSticky; // required
91
  private int warrantyPeriod; // required
92
  private int warrantyPeriod; // required
92
  private long preferredVendor; // required
93
  private long preferredVendor; // required
-
 
94
  private ItemType type; // 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
    EXPECTED_DELAY((short)28, "expectedDelay"),
129
    EXPECTED_DELAY((short)28, "expectedDelay"),
128
    PREFERRED_WAREHOUSE((short)29, "preferredWarehouse"),
130
    PREFERRED_WAREHOUSE((short)29, "preferredWarehouse"),
129
    DEFAULT_WAREHOUSE((short)30, "defaultWarehouse"),
131
    DEFAULT_WAREHOUSE((short)30, "defaultWarehouse"),
130
    IS_WAREHOUSE_PREFERENCE_STICKY((short)31, "isWarehousePreferenceSticky"),
132
    IS_WAREHOUSE_PREFERENCE_STICKY((short)31, "isWarehousePreferenceSticky"),
131
    WARRANTY_PERIOD((short)32, "warrantyPeriod"),
133
    WARRANTY_PERIOD((short)32, "warrantyPeriod"),
132
    PREFERRED_VENDOR((short)33, "preferredVendor");
134
    PREFERRED_VENDOR((short)33, "preferredVendor"),
-
 
135
    /**
-
 
136
     * 
-
 
137
     * @see ItemType
-
 
138
     */
-
 
139
    TYPE((short)34, "type");
133
 
140
 
134
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
141
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
135
 
142
 
136
    static {
143
    static {
137
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
144
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
Line 208... Line 215...
208
          return IS_WAREHOUSE_PREFERENCE_STICKY;
215
          return IS_WAREHOUSE_PREFERENCE_STICKY;
209
        case 32: // WARRANTY_PERIOD
216
        case 32: // WARRANTY_PERIOD
210
          return WARRANTY_PERIOD;
217
          return WARRANTY_PERIOD;
211
        case 33: // PREFERRED_VENDOR
218
        case 33: // PREFERRED_VENDOR
212
          return PREFERRED_VENDOR;
219
          return PREFERRED_VENDOR;
-
 
220
        case 34: // TYPE
-
 
221
          return TYPE;
213
        default:
222
        default:
214
          return null;
223
          return null;
215
      }
224
      }
216
    }
225
    }
217
 
226
 
Line 342... Line 351...
342
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
351
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
343
    tmpMap.put(_Fields.WARRANTY_PERIOD, new org.apache.thrift.meta_data.FieldMetaData("warrantyPeriod", org.apache.thrift.TFieldRequirementType.DEFAULT, 
352
    tmpMap.put(_Fields.WARRANTY_PERIOD, new org.apache.thrift.meta_data.FieldMetaData("warrantyPeriod", org.apache.thrift.TFieldRequirementType.DEFAULT, 
344
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
353
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
345
    tmpMap.put(_Fields.PREFERRED_VENDOR, new org.apache.thrift.meta_data.FieldMetaData("preferredVendor", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
354
    tmpMap.put(_Fields.PREFERRED_VENDOR, new org.apache.thrift.meta_data.FieldMetaData("preferredVendor", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
346
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
355
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
-
 
356
    tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
357
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ItemType.class)));
347
    metaDataMap = Collections.unmodifiableMap(tmpMap);
358
    metaDataMap = Collections.unmodifiableMap(tmpMap);
348
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Item.class, metaDataMap);
359
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Item.class, metaDataMap);
349
  }
360
  }
350
 
361
 
351
  public Item() {
362
  public Item() {
Line 370... Line 381...
370
    Map<String,String> otherInfo,
381
    Map<String,String> otherInfo,
371
    String bestDealText,
382
    String bestDealText,
372
    boolean defaultForEntity,
383
    boolean defaultForEntity,
373
    long updatedOn,
384
    long updatedOn,
374
    boolean risky,
385
    boolean risky,
375
    int warrantyPeriod)
386
    int warrantyPeriod,
-
 
387
    ItemType type)
376
  {
388
  {
377
    this();
389
    this();
378
    this.id = id;
390
    this.id = id;
379
    setIdIsSet(true);
391
    setIdIsSet(true);
380
    this.productGroup = productGroup;
392
    this.productGroup = productGroup;
Line 403... Line 415...
403
    setUpdatedOnIsSet(true);
415
    setUpdatedOnIsSet(true);
404
    this.risky = risky;
416
    this.risky = risky;
405
    setRiskyIsSet(true);
417
    setRiskyIsSet(true);
406
    this.warrantyPeriod = warrantyPeriod;
418
    this.warrantyPeriod = warrantyPeriod;
407
    setWarrantyPeriodIsSet(true);
419
    setWarrantyPeriodIsSet(true);
-
 
420
    this.type = type;
408
  }
421
  }
409
 
422
 
410
  /**
423
  /**
411
   * Performs a deep copy on <i>other</i>.
424
   * Performs a deep copy on <i>other</i>.
412
   */
425
   */
Line 480... Line 493...
480
    this.preferredWarehouse = other.preferredWarehouse;
493
    this.preferredWarehouse = other.preferredWarehouse;
481
    this.defaultWarehouse = other.defaultWarehouse;
494
    this.defaultWarehouse = other.defaultWarehouse;
482
    this.isWarehousePreferenceSticky = other.isWarehousePreferenceSticky;
495
    this.isWarehousePreferenceSticky = other.isWarehousePreferenceSticky;
483
    this.warrantyPeriod = other.warrantyPeriod;
496
    this.warrantyPeriod = other.warrantyPeriod;
484
    this.preferredVendor = other.preferredVendor;
497
    this.preferredVendor = other.preferredVendor;
-
 
498
    if (other.isSetType()) {
-
 
499
      this.type = other.type;
-
 
500
    }
485
  }
501
  }
486
 
502
 
487
  public Item deepCopy() {
503
  public Item deepCopy() {
488
    return new Item(this);
504
    return new Item(this);
489
  }
505
  }
Line 542... Line 558...
542
    this.isWarehousePreferenceSticky = false;
558
    this.isWarehousePreferenceSticky = false;
543
    setWarrantyPeriodIsSet(false);
559
    setWarrantyPeriodIsSet(false);
544
    this.warrantyPeriod = 0;
560
    this.warrantyPeriod = 0;
545
    setPreferredVendorIsSet(false);
561
    setPreferredVendorIsSet(false);
546
    this.preferredVendor = 0;
562
    this.preferredVendor = 0;
-
 
563
    this.type = null;
547
  }
564
  }
548
 
565
 
549
  public long getId() {
566
  public long getId() {
550
    return this.id;
567
    return this.id;
551
  }
568
  }
Line 1301... Line 1318...
1301
 
1318
 
1302
  public void setPreferredVendorIsSet(boolean value) {
1319
  public void setPreferredVendorIsSet(boolean value) {
1303
    __isset_bit_vector.set(__PREFERREDVENDOR_ISSET_ID, value);
1320
    __isset_bit_vector.set(__PREFERREDVENDOR_ISSET_ID, value);
1304
  }
1321
  }
1305
 
1322
 
-
 
1323
  /**
-
 
1324
   * 
-
 
1325
   * @see ItemType
-
 
1326
   */
-
 
1327
  public ItemType getType() {
-
 
1328
    return this.type;
-
 
1329
  }
-
 
1330
 
-
 
1331
  /**
-
 
1332
   * 
-
 
1333
   * @see ItemType
-
 
1334
   */
-
 
1335
  public void setType(ItemType type) {
-
 
1336
    this.type = type;
-
 
1337
  }
-
 
1338
 
-
 
1339
  public void unsetType() {
-
 
1340
    this.type = null;
-
 
1341
  }
-
 
1342
 
-
 
1343
  /** Returns true if field type is set (has been assigned a value) and false otherwise */
-
 
1344
  public boolean isSetType() {
-
 
1345
    return this.type != null;
-
 
1346
  }
-
 
1347
 
-
 
1348
  public void setTypeIsSet(boolean value) {
-
 
1349
    if (!value) {
-
 
1350
      this.type = null;
-
 
1351
    }
-
 
1352
  }
-
 
1353
 
1306
  public void setFieldValue(_Fields field, Object value) {
1354
  public void setFieldValue(_Fields field, Object value) {
1307
    switch (field) {
1355
    switch (field) {
1308
    case ID:
1356
    case ID:
1309
      if (value == null) {
1357
      if (value == null) {
1310
        unsetId();
1358
        unsetId();
Line 1567... Line 1615...
1567
      } else {
1615
      } else {
1568
        setPreferredVendor((Long)value);
1616
        setPreferredVendor((Long)value);
1569
      }
1617
      }
1570
      break;
1618
      break;
1571
 
1619
 
-
 
1620
    case TYPE:
-
 
1621
      if (value == null) {
-
 
1622
        unsetType();
-
 
1623
      } else {
-
 
1624
        setType((ItemType)value);
-
 
1625
      }
-
 
1626
      break;
-
 
1627
 
1572
    }
1628
    }
1573
  }
1629
  }
1574
 
1630
 
1575
  public Object getFieldValue(_Fields field) {
1631
  public Object getFieldValue(_Fields field) {
1576
    switch (field) {
1632
    switch (field) {
Line 1671... Line 1727...
1671
      return Integer.valueOf(getWarrantyPeriod());
1727
      return Integer.valueOf(getWarrantyPeriod());
1672
 
1728
 
1673
    case PREFERRED_VENDOR:
1729
    case PREFERRED_VENDOR:
1674
      return Long.valueOf(getPreferredVendor());
1730
      return Long.valueOf(getPreferredVendor());
1675
 
1731
 
-
 
1732
    case TYPE:
-
 
1733
      return getType();
-
 
1734
 
1676
    }
1735
    }
1677
    throw new IllegalStateException();
1736
    throw new IllegalStateException();
1678
  }
1737
  }
1679
 
1738
 
1680
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
1739
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
Line 1748... Line 1807...
1748
      return isSetIsWarehousePreferenceSticky();
1807
      return isSetIsWarehousePreferenceSticky();
1749
    case WARRANTY_PERIOD:
1808
    case WARRANTY_PERIOD:
1750
      return isSetWarrantyPeriod();
1809
      return isSetWarrantyPeriod();
1751
    case PREFERRED_VENDOR:
1810
    case PREFERRED_VENDOR:
1752
      return isSetPreferredVendor();
1811
      return isSetPreferredVendor();
-
 
1812
    case TYPE:
-
 
1813
      return isSetType();
1753
    }
1814
    }
1754
    throw new IllegalStateException();
1815
    throw new IllegalStateException();
1755
  }
1816
  }
1756
 
1817
 
1757
  @Override
1818
  @Override
Line 2062... Line 2123...
2062
        return false;
2123
        return false;
2063
      if (this.preferredVendor != that.preferredVendor)
2124
      if (this.preferredVendor != that.preferredVendor)
2064
        return false;
2125
        return false;
2065
    }
2126
    }
2066
 
2127
 
-
 
2128
    boolean this_present_type = true && this.isSetType();
-
 
2129
    boolean that_present_type = true && that.isSetType();
-
 
2130
    if (this_present_type || that_present_type) {
-
 
2131
      if (!(this_present_type && that_present_type))
-
 
2132
        return false;
-
 
2133
      if (!this.type.equals(that.type))
-
 
2134
        return false;
-
 
2135
    }
-
 
2136
 
2067
    return true;
2137
    return true;
2068
  }
2138
  }
2069
 
2139
 
2070
  @Override
2140
  @Override
2071
  public int hashCode() {
2141
  public int hashCode() {
Line 2408... Line 2478...
2408
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.preferredVendor, typedOther.preferredVendor);
2478
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.preferredVendor, typedOther.preferredVendor);
2409
      if (lastComparison != 0) {
2479
      if (lastComparison != 0) {
2410
        return lastComparison;
2480
        return lastComparison;
2411
      }
2481
      }
2412
    }
2482
    }
-
 
2483
    lastComparison = Boolean.valueOf(isSetType()).compareTo(typedOther.isSetType());
-
 
2484
    if (lastComparison != 0) {
-
 
2485
      return lastComparison;
-
 
2486
    }
-
 
2487
    if (isSetType()) {
-
 
2488
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, typedOther.type);
-
 
2489
      if (lastComparison != 0) {
-
 
2490
        return lastComparison;
-
 
2491
      }
-
 
2492
    }
2413
    return 0;
2493
    return 0;
2414
  }
2494
  }
2415
 
2495
 
2416
  public _Fields fieldForId(int fieldId) {
2496
  public _Fields fieldForId(int fieldId) {
2417
    return _Fields.findByThriftId(fieldId);
2497
    return _Fields.findByThriftId(fieldId);
Line 2690... Line 2770...
2690
            setPreferredVendorIsSet(true);
2770
            setPreferredVendorIsSet(true);
2691
          } else { 
2771
          } else { 
2692
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2772
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2693
          }
2773
          }
2694
          break;
2774
          break;
-
 
2775
        case 34: // TYPE
-
 
2776
          if (field.type == org.apache.thrift.protocol.TType.I32) {
-
 
2777
            this.type = ItemType.findByValue(iprot.readI32());
-
 
2778
          } else { 
-
 
2779
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
2780
          }
-
 
2781
          break;
2695
        default:
2782
        default:
2696
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2783
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
2697
      }
2784
      }
2698
      iprot.readFieldEnd();
2785
      iprot.readFieldEnd();
2699
    }
2786
    }
Line 2858... Line 2945...
2858
    if (isSetPreferredVendor()) {
2945
    if (isSetPreferredVendor()) {
2859
      oprot.writeFieldBegin(PREFERRED_VENDOR_FIELD_DESC);
2946
      oprot.writeFieldBegin(PREFERRED_VENDOR_FIELD_DESC);
2860
      oprot.writeI64(this.preferredVendor);
2947
      oprot.writeI64(this.preferredVendor);
2861
      oprot.writeFieldEnd();
2948
      oprot.writeFieldEnd();
2862
    }
2949
    }
-
 
2950
    if (this.type != null) {
-
 
2951
      oprot.writeFieldBegin(TYPE_FIELD_DESC);
-
 
2952
      oprot.writeI32(this.type.getValue());
-
 
2953
      oprot.writeFieldEnd();
-
 
2954
    }
2863
    oprot.writeFieldStop();
2955
    oprot.writeFieldStop();
2864
    oprot.writeStructEnd();
2956
    oprot.writeStructEnd();
2865
  }
2957
  }
2866
 
2958
 
2867
  @Override
2959
  @Override
Line 3070... Line 3162...
3070
      if (!first) sb.append(", ");
3162
      if (!first) sb.append(", ");
3071
      sb.append("preferredVendor:");
3163
      sb.append("preferredVendor:");
3072
      sb.append(this.preferredVendor);
3164
      sb.append(this.preferredVendor);
3073
      first = false;
3165
      first = false;
3074
    }
3166
    }
-
 
3167
    if (!first) sb.append(", ");
-
 
3168
    sb.append("type:");
-
 
3169
    if (this.type == null) {
-
 
3170
      sb.append("null");
-
 
3171
    } else {
-
 
3172
      sb.append(this.type);
-
 
3173
    }
-
 
3174
    first = false;
3075
    sb.append(")");
3175
    sb.append(")");
3076
    return sb.toString();
3176
    return sb.toString();
3077
  }
3177
  }
3078
 
3178
 
3079
  public void validate() throws org.apache.thrift.TException {
3179
  public void validate() throws org.apache.thrift.TException {