Subversion Repositories SmartDukaan

Rev

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

Rev 3430 Rev 8707
Line 24... Line 24...
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Coupon");
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Coupon");
25
 
25
 
26
  private static final org.apache.thrift.protocol.TField COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)1);
26
  private static final org.apache.thrift.protocol.TField COUPON_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("couponCode", org.apache.thrift.protocol.TType.STRING, (short)1);
27
  private static final org.apache.thrift.protocol.TField PROMOTION_FIELD_DESC = new org.apache.thrift.protocol.TField("promotion", org.apache.thrift.protocol.TType.STRUCT, (short)2);
27
  private static final org.apache.thrift.protocol.TField PROMOTION_FIELD_DESC = new org.apache.thrift.protocol.TField("promotion", org.apache.thrift.protocol.TType.STRUCT, (short)2);
28
  private static final org.apache.thrift.protocol.TField ARGUMENTS_FIELD_DESC = new org.apache.thrift.protocol.TField("arguments", org.apache.thrift.protocol.TType.STRING, (short)3);
28
  private static final org.apache.thrift.protocol.TField ARGUMENTS_FIELD_DESC = new org.apache.thrift.protocol.TField("arguments", org.apache.thrift.protocol.TType.STRING, (short)3);
-
 
29
  private static final org.apache.thrift.protocol.TField COUPON_CATEGORY_FIELD_DESC = new org.apache.thrift.protocol.TField("coupon_category", org.apache.thrift.protocol.TType.I32, (short)4);
29
 
30
 
30
  private String couponCode; // required
31
  private String couponCode; // required
31
  private Promotion promotion; // required
32
  private Promotion promotion; // required
32
  private String arguments; // required
33
  private String arguments; // required
-
 
34
  private CouponCategory coupon_category; // required
33
 
35
 
34
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
36
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
35
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
37
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
36
    COUPON_CODE((short)1, "couponCode"),
38
    COUPON_CODE((short)1, "couponCode"),
37
    PROMOTION((short)2, "promotion"),
39
    PROMOTION((short)2, "promotion"),
38
    ARGUMENTS((short)3, "arguments");
40
    ARGUMENTS((short)3, "arguments"),
-
 
41
    /**
-
 
42
     * 
-
 
43
     * @see CouponCategory
-
 
44
     */
-
 
45
    COUPON_CATEGORY((short)4, "coupon_category");
39
 
46
 
40
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
47
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
41
 
48
 
42
    static {
49
    static {
43
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
50
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
Line 54... Line 61...
54
          return COUPON_CODE;
61
          return COUPON_CODE;
55
        case 2: // PROMOTION
62
        case 2: // PROMOTION
56
          return PROMOTION;
63
          return PROMOTION;
57
        case 3: // ARGUMENTS
64
        case 3: // ARGUMENTS
58
          return ARGUMENTS;
65
          return ARGUMENTS;
-
 
66
        case 4: // COUPON_CATEGORY
-
 
67
          return COUPON_CATEGORY;
59
        default:
68
        default:
60
          return null;
69
          return null;
61
      }
70
      }
62
    }
71
    }
63
 
72
 
Line 104... Line 113...
104
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
113
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
105
    tmpMap.put(_Fields.PROMOTION, new org.apache.thrift.meta_data.FieldMetaData("promotion", org.apache.thrift.TFieldRequirementType.DEFAULT, 
114
    tmpMap.put(_Fields.PROMOTION, new org.apache.thrift.meta_data.FieldMetaData("promotion", org.apache.thrift.TFieldRequirementType.DEFAULT, 
106
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Promotion.class)));
115
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Promotion.class)));
107
    tmpMap.put(_Fields.ARGUMENTS, new org.apache.thrift.meta_data.FieldMetaData("arguments", org.apache.thrift.TFieldRequirementType.DEFAULT, 
116
    tmpMap.put(_Fields.ARGUMENTS, new org.apache.thrift.meta_data.FieldMetaData("arguments", org.apache.thrift.TFieldRequirementType.DEFAULT, 
108
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
117
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
-
 
118
    tmpMap.put(_Fields.COUPON_CATEGORY, new org.apache.thrift.meta_data.FieldMetaData("coupon_category", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
119
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, CouponCategory.class)));
109
    metaDataMap = Collections.unmodifiableMap(tmpMap);
120
    metaDataMap = Collections.unmodifiableMap(tmpMap);
110
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Coupon.class, metaDataMap);
121
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Coupon.class, metaDataMap);
111
  }
122
  }
112
 
123
 
113
  public Coupon() {
124
  public Coupon() {
114
  }
125
  }
115
 
126
 
116
  public Coupon(
127
  public Coupon(
117
    String couponCode,
128
    String couponCode,
118
    Promotion promotion,
129
    Promotion promotion,
119
    String arguments)
130
    String arguments,
-
 
131
    CouponCategory coupon_category)
120
  {
132
  {
121
    this();
133
    this();
122
    this.couponCode = couponCode;
134
    this.couponCode = couponCode;
123
    this.promotion = promotion;
135
    this.promotion = promotion;
124
    this.arguments = arguments;
136
    this.arguments = arguments;
-
 
137
    this.coupon_category = coupon_category;
125
  }
138
  }
126
 
139
 
127
  /**
140
  /**
128
   * Performs a deep copy on <i>other</i>.
141
   * Performs a deep copy on <i>other</i>.
129
   */
142
   */
Line 135... Line 148...
135
      this.promotion = new Promotion(other.promotion);
148
      this.promotion = new Promotion(other.promotion);
136
    }
149
    }
137
    if (other.isSetArguments()) {
150
    if (other.isSetArguments()) {
138
      this.arguments = other.arguments;
151
      this.arguments = other.arguments;
139
    }
152
    }
-
 
153
    if (other.isSetCoupon_category()) {
-
 
154
      this.coupon_category = other.coupon_category;
-
 
155
    }
140
  }
156
  }
141
 
157
 
142
  public Coupon deepCopy() {
158
  public Coupon deepCopy() {
143
    return new Coupon(this);
159
    return new Coupon(this);
144
  }
160
  }
Line 146... Line 162...
146
  @Override
162
  @Override
147
  public void clear() {
163
  public void clear() {
148
    this.couponCode = null;
164
    this.couponCode = null;
149
    this.promotion = null;
165
    this.promotion = null;
150
    this.arguments = null;
166
    this.arguments = null;
-
 
167
    this.coupon_category = null;
151
  }
168
  }
152
 
169
 
153
  public String getCouponCode() {
170
  public String getCouponCode() {
154
    return this.couponCode;
171
    return this.couponCode;
155
  }
172
  }
Line 217... Line 234...
217
    if (!value) {
234
    if (!value) {
218
      this.arguments = null;
235
      this.arguments = null;
219
    }
236
    }
220
  }
237
  }
221
 
238
 
-
 
239
  /**
-
 
240
   * 
-
 
241
   * @see CouponCategory
-
 
242
   */
-
 
243
  public CouponCategory getCoupon_category() {
-
 
244
    return this.coupon_category;
-
 
245
  }
-
 
246
 
-
 
247
  /**
-
 
248
   * 
-
 
249
   * @see CouponCategory
-
 
250
   */
-
 
251
  public void setCoupon_category(CouponCategory coupon_category) {
-
 
252
    this.coupon_category = coupon_category;
-
 
253
  }
-
 
254
 
-
 
255
  public void unsetCoupon_category() {
-
 
256
    this.coupon_category = null;
-
 
257
  }
-
 
258
 
-
 
259
  /** Returns true if field coupon_category is set (has been assigned a value) and false otherwise */
-
 
260
  public boolean isSetCoupon_category() {
-
 
261
    return this.coupon_category != null;
-
 
262
  }
-
 
263
 
-
 
264
  public void setCoupon_categoryIsSet(boolean value) {
-
 
265
    if (!value) {
-
 
266
      this.coupon_category = null;
-
 
267
    }
-
 
268
  }
-
 
269
 
222
  public void setFieldValue(_Fields field, Object value) {
270
  public void setFieldValue(_Fields field, Object value) {
223
    switch (field) {
271
    switch (field) {
224
    case COUPON_CODE:
272
    case COUPON_CODE:
225
      if (value == null) {
273
      if (value == null) {
226
        unsetCouponCode();
274
        unsetCouponCode();
Line 243... Line 291...
243
      } else {
291
      } else {
244
        setArguments((String)value);
292
        setArguments((String)value);
245
      }
293
      }
246
      break;
294
      break;
247
 
295
 
-
 
296
    case COUPON_CATEGORY:
-
 
297
      if (value == null) {
-
 
298
        unsetCoupon_category();
-
 
299
      } else {
-
 
300
        setCoupon_category((CouponCategory)value);
-
 
301
      }
-
 
302
      break;
-
 
303
 
248
    }
304
    }
249
  }
305
  }
250
 
306
 
251
  public Object getFieldValue(_Fields field) {
307
  public Object getFieldValue(_Fields field) {
252
    switch (field) {
308
    switch (field) {
Line 257... Line 313...
257
      return getPromotion();
313
      return getPromotion();
258
 
314
 
259
    case ARGUMENTS:
315
    case ARGUMENTS:
260
      return getArguments();
316
      return getArguments();
261
 
317
 
-
 
318
    case COUPON_CATEGORY:
-
 
319
      return getCoupon_category();
-
 
320
 
262
    }
321
    }
263
    throw new IllegalStateException();
322
    throw new IllegalStateException();
264
  }
323
  }
265
 
324
 
266
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
325
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
Line 274... Line 333...
274
      return isSetCouponCode();
333
      return isSetCouponCode();
275
    case PROMOTION:
334
    case PROMOTION:
276
      return isSetPromotion();
335
      return isSetPromotion();
277
    case ARGUMENTS:
336
    case ARGUMENTS:
278
      return isSetArguments();
337
      return isSetArguments();
-
 
338
    case COUPON_CATEGORY:
-
 
339
      return isSetCoupon_category();
279
    }
340
    }
280
    throw new IllegalStateException();
341
    throw new IllegalStateException();
281
  }
342
  }
282
 
343
 
283
  @Override
344
  @Override
Line 318... Line 379...
318
        return false;
379
        return false;
319
      if (!this.arguments.equals(that.arguments))
380
      if (!this.arguments.equals(that.arguments))
320
        return false;
381
        return false;
321
    }
382
    }
322
 
383
 
-
 
384
    boolean this_present_coupon_category = true && this.isSetCoupon_category();
-
 
385
    boolean that_present_coupon_category = true && that.isSetCoupon_category();
-
 
386
    if (this_present_coupon_category || that_present_coupon_category) {
-
 
387
      if (!(this_present_coupon_category && that_present_coupon_category))
-
 
388
        return false;
-
 
389
      if (!this.coupon_category.equals(that.coupon_category))
-
 
390
        return false;
-
 
391
    }
-
 
392
 
323
    return true;
393
    return true;
324
  }
394
  }
325
 
395
 
326
  @Override
396
  @Override
327
  public int hashCode() {
397
  public int hashCode() {
Line 364... Line 434...
364
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.arguments, typedOther.arguments);
434
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.arguments, typedOther.arguments);
365
      if (lastComparison != 0) {
435
      if (lastComparison != 0) {
366
        return lastComparison;
436
        return lastComparison;
367
      }
437
      }
368
    }
438
    }
-
 
439
    lastComparison = Boolean.valueOf(isSetCoupon_category()).compareTo(typedOther.isSetCoupon_category());
-
 
440
    if (lastComparison != 0) {
-
 
441
      return lastComparison;
-
 
442
    }
-
 
443
    if (isSetCoupon_category()) {
-
 
444
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.coupon_category, typedOther.coupon_category);
-
 
445
      if (lastComparison != 0) {
-
 
446
        return lastComparison;
-
 
447
      }
-
 
448
    }
369
    return 0;
449
    return 0;
370
  }
450
  }
371
 
451
 
372
  public _Fields fieldForId(int fieldId) {
452
  public _Fields fieldForId(int fieldId) {
373
    return _Fields.findByThriftId(fieldId);
453
    return _Fields.findByThriftId(fieldId);
Line 403... Line 483...
403
            this.arguments = iprot.readString();
483
            this.arguments = iprot.readString();
404
          } else { 
484
          } else { 
405
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
485
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
406
          }
486
          }
407
          break;
487
          break;
-
 
488
        case 4: // COUPON_CATEGORY
-
 
489
          if (field.type == org.apache.thrift.protocol.TType.I32) {
-
 
490
            this.coupon_category = CouponCategory.findByValue(iprot.readI32());
-
 
491
          } else { 
-
 
492
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
493
          }
-
 
494
          break;
408
        default:
495
        default:
409
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
496
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
410
      }
497
      }
411
      iprot.readFieldEnd();
498
      iprot.readFieldEnd();
412
    }
499
    }
Line 431... Line 518...
431
    if (this.arguments != null) {
518
    if (this.arguments != null) {
432
      oprot.writeFieldBegin(ARGUMENTS_FIELD_DESC);
519
      oprot.writeFieldBegin(ARGUMENTS_FIELD_DESC);
433
      oprot.writeString(this.arguments);
520
      oprot.writeString(this.arguments);
434
      oprot.writeFieldEnd();
521
      oprot.writeFieldEnd();
435
    }
522
    }
-
 
523
    if (this.coupon_category != null) {
-
 
524
      oprot.writeFieldBegin(COUPON_CATEGORY_FIELD_DESC);
-
 
525
      oprot.writeI32(this.coupon_category.getValue());
-
 
526
      oprot.writeFieldEnd();
-
 
527
    }
436
    oprot.writeFieldStop();
528
    oprot.writeFieldStop();
437
    oprot.writeStructEnd();
529
    oprot.writeStructEnd();
438
  }
530
  }
439
 
531
 
440
  @Override
532
  @Override
Line 463... Line 555...
463
      sb.append("null");
555
      sb.append("null");
464
    } else {
556
    } else {
465
      sb.append(this.arguments);
557
      sb.append(this.arguments);
466
    }
558
    }
467
    first = false;
559
    first = false;
-
 
560
    if (!first) sb.append(", ");
-
 
561
    sb.append("coupon_category:");
-
 
562
    if (this.coupon_category == null) {
-
 
563
      sb.append("null");
-
 
564
    } else {
-
 
565
      sb.append(this.coupon_category);
-
 
566
    }
-
 
567
    first = false;
468
    sb.append(")");
568
    sb.append(")");
469
    return sb.toString();
569
    return sb.toString();
470
  }
570
  }
471
 
571
 
472
  public void validate() throws org.apache.thrift.TException {
572
  public void validate() throws org.apache.thrift.TException {