Subversion Repositories SmartDukaan

Rev

Rev 3430 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3430 Rev 4762
Line 24... Line 24...
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("VendorItemMapping");
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("VendorItemMapping");
25
 
25
 
26
  private static final org.apache.thrift.protocol.TField VENDOR_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("vendorId", org.apache.thrift.protocol.TType.I64, (short)1);
26
  private static final org.apache.thrift.protocol.TField VENDOR_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("vendorId", org.apache.thrift.protocol.TType.I64, (short)1);
27
  private static final org.apache.thrift.protocol.TField ITEM_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("itemKey", org.apache.thrift.protocol.TType.STRING, (short)2);
27
  private static final org.apache.thrift.protocol.TField ITEM_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("itemKey", org.apache.thrift.protocol.TType.STRING, (short)2);
28
  private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("itemId", org.apache.thrift.protocol.TType.I64, (short)3);
28
  private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("itemId", org.apache.thrift.protocol.TType.I64, (short)3);
29
  private static final org.apache.thrift.protocol.TField VENDOR_CATEGORY_FIELD_DESC = new org.apache.thrift.protocol.TField("vendorCategory", org.apache.thrift.protocol.TType.STRING, (short)4);
-
 
30
 
29
 
31
  private long vendorId; // required
30
  private long vendorId; // required
32
  private String itemKey; // required
31
  private String itemKey; // required
33
  private long itemId; // required
32
  private long itemId; // required
34
  private String vendorCategory; // required
-
 
35
 
33
 
36
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
34
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
37
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
35
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
38
    VENDOR_ID((short)1, "vendorId"),
36
    VENDOR_ID((short)1, "vendorId"),
39
    ITEM_KEY((short)2, "itemKey"),
37
    ITEM_KEY((short)2, "itemKey"),
40
    ITEM_ID((short)3, "itemId"),
38
    ITEM_ID((short)3, "itemId");
41
    VENDOR_CATEGORY((short)4, "vendorCategory");
-
 
42
 
39
 
43
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
40
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
44
 
41
 
45
    static {
42
    static {
46
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
43
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
Line 57... Line 54...
57
          return VENDOR_ID;
54
          return VENDOR_ID;
58
        case 2: // ITEM_KEY
55
        case 2: // ITEM_KEY
59
          return ITEM_KEY;
56
          return ITEM_KEY;
60
        case 3: // ITEM_ID
57
        case 3: // ITEM_ID
61
          return ITEM_ID;
58
          return ITEM_ID;
62
        case 4: // VENDOR_CATEGORY
-
 
63
          return VENDOR_CATEGORY;
-
 
64
        default:
59
        default:
65
          return null;
60
          return null;
66
      }
61
      }
67
    }
62
    }
68
 
63
 
Line 112... Line 107...
112
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
107
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
113
    tmpMap.put(_Fields.ITEM_KEY, new org.apache.thrift.meta_data.FieldMetaData("itemKey", org.apache.thrift.TFieldRequirementType.DEFAULT, 
108
    tmpMap.put(_Fields.ITEM_KEY, new org.apache.thrift.meta_data.FieldMetaData("itemKey", org.apache.thrift.TFieldRequirementType.DEFAULT, 
114
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
109
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
115
    tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("itemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
110
    tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("itemId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
116
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
111
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
117
    tmpMap.put(_Fields.VENDOR_CATEGORY, new org.apache.thrift.meta_data.FieldMetaData("vendorCategory", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
118
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-
 
119
    metaDataMap = Collections.unmodifiableMap(tmpMap);
112
    metaDataMap = Collections.unmodifiableMap(tmpMap);
120
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(VendorItemMapping.class, metaDataMap);
113
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(VendorItemMapping.class, metaDataMap);
121
  }
114
  }
122
 
115
 
123
  public VendorItemMapping() {
116
  public VendorItemMapping() {
124
  }
117
  }
125
 
118
 
126
  public VendorItemMapping(
119
  public VendorItemMapping(
127
    long vendorId,
120
    long vendorId,
128
    String itemKey,
121
    String itemKey,
129
    long itemId,
122
    long itemId)
130
    String vendorCategory)
-
 
131
  {
123
  {
132
    this();
124
    this();
133
    this.vendorId = vendorId;
125
    this.vendorId = vendorId;
134
    setVendorIdIsSet(true);
126
    setVendorIdIsSet(true);
135
    this.itemKey = itemKey;
127
    this.itemKey = itemKey;
136
    this.itemId = itemId;
128
    this.itemId = itemId;
137
    setItemIdIsSet(true);
129
    setItemIdIsSet(true);
138
    this.vendorCategory = vendorCategory;
-
 
139
  }
130
  }
140
 
131
 
141
  /**
132
  /**
142
   * Performs a deep copy on <i>other</i>.
133
   * Performs a deep copy on <i>other</i>.
143
   */
134
   */
Line 147... Line 138...
147
    this.vendorId = other.vendorId;
138
    this.vendorId = other.vendorId;
148
    if (other.isSetItemKey()) {
139
    if (other.isSetItemKey()) {
149
      this.itemKey = other.itemKey;
140
      this.itemKey = other.itemKey;
150
    }
141
    }
151
    this.itemId = other.itemId;
142
    this.itemId = other.itemId;
152
    if (other.isSetVendorCategory()) {
-
 
153
      this.vendorCategory = other.vendorCategory;
-
 
154
    }
-
 
155
  }
143
  }
156
 
144
 
157
  public VendorItemMapping deepCopy() {
145
  public VendorItemMapping deepCopy() {
158
    return new VendorItemMapping(this);
146
    return new VendorItemMapping(this);
159
  }
147
  }
Line 163... Line 151...
163
    setVendorIdIsSet(false);
151
    setVendorIdIsSet(false);
164
    this.vendorId = 0;
152
    this.vendorId = 0;
165
    this.itemKey = null;
153
    this.itemKey = null;
166
    setItemIdIsSet(false);
154
    setItemIdIsSet(false);
167
    this.itemId = 0;
155
    this.itemId = 0;
168
    this.vendorCategory = null;
-
 
169
  }
156
  }
170
 
157
 
171
  public long getVendorId() {
158
  public long getVendorId() {
172
    return this.vendorId;
159
    return this.vendorId;
173
  }
160
  }
Line 233... Line 220...
233
 
220
 
234
  public void setItemIdIsSet(boolean value) {
221
  public void setItemIdIsSet(boolean value) {
235
    __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
222
    __isset_bit_vector.set(__ITEMID_ISSET_ID, value);
236
  }
223
  }
237
 
224
 
238
  public String getVendorCategory() {
-
 
239
    return this.vendorCategory;
-
 
240
  }
-
 
241
 
-
 
242
  public void setVendorCategory(String vendorCategory) {
-
 
243
    this.vendorCategory = vendorCategory;
-
 
244
  }
-
 
245
 
-
 
246
  public void unsetVendorCategory() {
-
 
247
    this.vendorCategory = null;
-
 
248
  }
-
 
249
 
-
 
250
  /** Returns true if field vendorCategory is set (has been assigned a value) and false otherwise */
-
 
251
  public boolean isSetVendorCategory() {
-
 
252
    return this.vendorCategory != null;
-
 
253
  }
-
 
254
 
-
 
255
  public void setVendorCategoryIsSet(boolean value) {
-
 
256
    if (!value) {
-
 
257
      this.vendorCategory = null;
-
 
258
    }
-
 
259
  }
-
 
260
 
-
 
261
  public void setFieldValue(_Fields field, Object value) {
225
  public void setFieldValue(_Fields field, Object value) {
262
    switch (field) {
226
    switch (field) {
263
    case VENDOR_ID:
227
    case VENDOR_ID:
264
      if (value == null) {
228
      if (value == null) {
265
        unsetVendorId();
229
        unsetVendorId();
Line 282... Line 246...
282
      } else {
246
      } else {
283
        setItemId((Long)value);
247
        setItemId((Long)value);
284
      }
248
      }
285
      break;
249
      break;
286
 
250
 
287
    case VENDOR_CATEGORY:
-
 
288
      if (value == null) {
-
 
289
        unsetVendorCategory();
-
 
290
      } else {
-
 
291
        setVendorCategory((String)value);
-
 
292
      }
-
 
293
      break;
-
 
294
 
-
 
295
    }
251
    }
296
  }
252
  }
297
 
253
 
298
  public Object getFieldValue(_Fields field) {
254
  public Object getFieldValue(_Fields field) {
299
    switch (field) {
255
    switch (field) {
Line 304... Line 260...
304
      return getItemKey();
260
      return getItemKey();
305
 
261
 
306
    case ITEM_ID:
262
    case ITEM_ID:
307
      return Long.valueOf(getItemId());
263
      return Long.valueOf(getItemId());
308
 
264
 
309
    case VENDOR_CATEGORY:
-
 
310
      return getVendorCategory();
-
 
311
 
-
 
312
    }
265
    }
313
    throw new IllegalStateException();
266
    throw new IllegalStateException();
314
  }
267
  }
315
 
268
 
316
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
269
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
Line 324... Line 277...
324
      return isSetVendorId();
277
      return isSetVendorId();
325
    case ITEM_KEY:
278
    case ITEM_KEY:
326
      return isSetItemKey();
279
      return isSetItemKey();
327
    case ITEM_ID:
280
    case ITEM_ID:
328
      return isSetItemId();
281
      return isSetItemId();
329
    case VENDOR_CATEGORY:
-
 
330
      return isSetVendorCategory();
-
 
331
    }
282
    }
332
    throw new IllegalStateException();
283
    throw new IllegalStateException();
333
  }
284
  }
334
 
285
 
335
  @Override
286
  @Override
Line 370... Line 321...
370
        return false;
321
        return false;
371
      if (this.itemId != that.itemId)
322
      if (this.itemId != that.itemId)
372
        return false;
323
        return false;
373
    }
324
    }
374
 
325
 
375
    boolean this_present_vendorCategory = true && this.isSetVendorCategory();
-
 
376
    boolean that_present_vendorCategory = true && that.isSetVendorCategory();
-
 
377
    if (this_present_vendorCategory || that_present_vendorCategory) {
-
 
378
      if (!(this_present_vendorCategory && that_present_vendorCategory))
-
 
379
        return false;
-
 
380
      if (!this.vendorCategory.equals(that.vendorCategory))
-
 
381
        return false;
-
 
382
    }
-
 
383
 
-
 
384
    return true;
326
    return true;
385
  }
327
  }
386
 
328
 
387
  @Override
329
  @Override
388
  public int hashCode() {
330
  public int hashCode() {
Line 425... Line 367...
425
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemId, typedOther.itemId);
367
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemId, typedOther.itemId);
426
      if (lastComparison != 0) {
368
      if (lastComparison != 0) {
427
        return lastComparison;
369
        return lastComparison;
428
      }
370
      }
429
    }
371
    }
430
    lastComparison = Boolean.valueOf(isSetVendorCategory()).compareTo(typedOther.isSetVendorCategory());
-
 
431
    if (lastComparison != 0) {
-
 
432
      return lastComparison;
-
 
433
    }
-
 
434
    if (isSetVendorCategory()) {
-
 
435
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.vendorCategory, typedOther.vendorCategory);
-
 
436
      if (lastComparison != 0) {
-
 
437
        return lastComparison;
-
 
438
      }
-
 
439
    }
-
 
440
    return 0;
372
    return 0;
441
  }
373
  }
442
 
374
 
443
  public _Fields fieldForId(int fieldId) {
375
  public _Fields fieldForId(int fieldId) {
444
    return _Fields.findByThriftId(fieldId);
376
    return _Fields.findByThriftId(fieldId);
Line 475... Line 407...
475
            setItemIdIsSet(true);
407
            setItemIdIsSet(true);
476
          } else { 
408
          } else { 
477
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
409
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
478
          }
410
          }
479
          break;
411
          break;
480
        case 4: // VENDOR_CATEGORY
-
 
481
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
-
 
482
            this.vendorCategory = iprot.readString();
-
 
483
          } else { 
-
 
484
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
485
          }
-
 
486
          break;
-
 
487
        default:
412
        default:
488
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
413
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
489
      }
414
      }
490
      iprot.readFieldEnd();
415
      iprot.readFieldEnd();
491
    }
416
    }
Line 506... Line 431...
506
      oprot.writeFieldEnd();
431
      oprot.writeFieldEnd();
507
    }
432
    }
508
    oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
433
    oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
509
    oprot.writeI64(this.itemId);
434
    oprot.writeI64(this.itemId);
510
    oprot.writeFieldEnd();
435
    oprot.writeFieldEnd();
511
    if (this.vendorCategory != null) {
-
 
512
      oprot.writeFieldBegin(VENDOR_CATEGORY_FIELD_DESC);
-
 
513
      oprot.writeString(this.vendorCategory);
-
 
514
      oprot.writeFieldEnd();
-
 
515
    }
-
 
516
    oprot.writeFieldStop();
436
    oprot.writeFieldStop();
517
    oprot.writeStructEnd();
437
    oprot.writeStructEnd();
518
  }
438
  }
519
 
439
 
520
  @Override
440
  @Override
Line 535... Line 455...
535
    first = false;
455
    first = false;
536
    if (!first) sb.append(", ");
456
    if (!first) sb.append(", ");
537
    sb.append("itemId:");
457
    sb.append("itemId:");
538
    sb.append(this.itemId);
458
    sb.append(this.itemId);
539
    first = false;
459
    first = false;
540
    if (!first) sb.append(", ");
-
 
541
    sb.append("vendorCategory:");
-
 
542
    if (this.vendorCategory == null) {
-
 
543
      sb.append("null");
-
 
544
    } else {
-
 
545
      sb.append(this.vendorCategory);
-
 
546
    }
-
 
547
    first = false;
-
 
548
    sb.append(")");
460
    sb.append(")");
549
    return sb.toString();
461
    return sb.toString();
550
  }
462
  }
551
 
463
 
552
  public void validate() throws org.apache.thrift.TException {
464
  public void validate() throws org.apache.thrift.TException {