Subversion Repositories SmartDukaan

Rev

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

Rev 6467 Rev 6821
Line 26... Line 26...
26
  private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I64, (short)1);
26
  private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I64, (short)1);
27
  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)2);
27
  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)2);
28
  private static final org.apache.thrift.protocol.TField AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("amount", org.apache.thrift.protocol.TType.I64, (short)3);
28
  private static final org.apache.thrift.protocol.TField AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("amount", org.apache.thrift.protocol.TType.I64, (short)3);
29
  private static final org.apache.thrift.protocol.TField RETURN_TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("returnTimestamp", org.apache.thrift.protocol.TType.I64, (short)4);
29
  private static final org.apache.thrift.protocol.TField RETURN_TIMESTAMP_FIELD_DESC = new org.apache.thrift.protocol.TField("returnTimestamp", org.apache.thrift.protocol.TType.I64, (short)4);
30
  private static final org.apache.thrift.protocol.TField IS_SETTLED_FIELD_DESC = new org.apache.thrift.protocol.TField("isSettled", org.apache.thrift.protocol.TType.BOOL, (short)5);
30
  private static final org.apache.thrift.protocol.TField IS_SETTLED_FIELD_DESC = new org.apache.thrift.protocol.TField("isSettled", org.apache.thrift.protocol.TType.BOOL, (short)5);
-
 
31
  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)6);
31
 
32
 
32
  private long id; // required
33
  private long id; // required
33
  private long vendorId; // required
34
  private long vendorId; // required
34
  private long amount; // required
35
  private long amount; // required
35
  private long returnTimestamp; // required
36
  private long returnTimestamp; // required
36
  private boolean isSettled; // required
37
  private boolean isSettled; // required
-
 
38
  private PurchaseReturnType type; // required
37
 
39
 
38
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
40
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
39
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
41
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
40
    ID((short)1, "id"),
42
    ID((short)1, "id"),
41
    VENDOR_ID((short)2, "vendorId"),
43
    VENDOR_ID((short)2, "vendorId"),
42
    AMOUNT((short)3, "amount"),
44
    AMOUNT((short)3, "amount"),
43
    RETURN_TIMESTAMP((short)4, "returnTimestamp"),
45
    RETURN_TIMESTAMP((short)4, "returnTimestamp"),
44
    IS_SETTLED((short)5, "isSettled");
46
    IS_SETTLED((short)5, "isSettled"),
-
 
47
    /**
-
 
48
     * 
-
 
49
     * @see PurchaseReturnType
-
 
50
     */
-
 
51
    TYPE((short)6, "type");
45
 
52
 
46
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
53
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
47
 
54
 
48
    static {
55
    static {
49
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
56
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
Line 64... Line 71...
64
          return AMOUNT;
71
          return AMOUNT;
65
        case 4: // RETURN_TIMESTAMP
72
        case 4: // RETURN_TIMESTAMP
66
          return RETURN_TIMESTAMP;
73
          return RETURN_TIMESTAMP;
67
        case 5: // IS_SETTLED
74
        case 5: // IS_SETTLED
68
          return IS_SETTLED;
75
          return IS_SETTLED;
-
 
76
        case 6: // TYPE
-
 
77
          return TYPE;
69
        default:
78
        default:
70
          return null;
79
          return null;
71
      }
80
      }
72
    }
81
    }
73
 
82
 
Line 124... Line 133...
124
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
133
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
125
    tmpMap.put(_Fields.RETURN_TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("returnTimestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, 
134
    tmpMap.put(_Fields.RETURN_TIMESTAMP, new org.apache.thrift.meta_data.FieldMetaData("returnTimestamp", org.apache.thrift.TFieldRequirementType.DEFAULT, 
126
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
135
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
127
    tmpMap.put(_Fields.IS_SETTLED, new org.apache.thrift.meta_data.FieldMetaData("isSettled", org.apache.thrift.TFieldRequirementType.DEFAULT, 
136
    tmpMap.put(_Fields.IS_SETTLED, new org.apache.thrift.meta_data.FieldMetaData("isSettled", org.apache.thrift.TFieldRequirementType.DEFAULT, 
128
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
137
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
-
 
138
    tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
139
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, PurchaseReturnType.class)));
129
    metaDataMap = Collections.unmodifiableMap(tmpMap);
140
    metaDataMap = Collections.unmodifiableMap(tmpMap);
130
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PurchaseReturn.class, metaDataMap);
141
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PurchaseReturn.class, metaDataMap);
131
  }
142
  }
132
 
143
 
133
  public PurchaseReturn() {
144
  public PurchaseReturn() {
Line 136... Line 147...
136
  public PurchaseReturn(
147
  public PurchaseReturn(
137
    long id,
148
    long id,
138
    long vendorId,
149
    long vendorId,
139
    long amount,
150
    long amount,
140
    long returnTimestamp,
151
    long returnTimestamp,
141
    boolean isSettled)
152
    boolean isSettled,
-
 
153
    PurchaseReturnType type)
142
  {
154
  {
143
    this();
155
    this();
144
    this.id = id;
156
    this.id = id;
145
    setIdIsSet(true);
157
    setIdIsSet(true);
146
    this.vendorId = vendorId;
158
    this.vendorId = vendorId;
Line 149... Line 161...
149
    setAmountIsSet(true);
161
    setAmountIsSet(true);
150
    this.returnTimestamp = returnTimestamp;
162
    this.returnTimestamp = returnTimestamp;
151
    setReturnTimestampIsSet(true);
163
    setReturnTimestampIsSet(true);
152
    this.isSettled = isSettled;
164
    this.isSettled = isSettled;
153
    setIsSettledIsSet(true);
165
    setIsSettledIsSet(true);
-
 
166
    this.type = type;
154
  }
167
  }
155
 
168
 
156
  /**
169
  /**
157
   * Performs a deep copy on <i>other</i>.
170
   * Performs a deep copy on <i>other</i>.
158
   */
171
   */
Line 162... Line 175...
162
    this.id = other.id;
175
    this.id = other.id;
163
    this.vendorId = other.vendorId;
176
    this.vendorId = other.vendorId;
164
    this.amount = other.amount;
177
    this.amount = other.amount;
165
    this.returnTimestamp = other.returnTimestamp;
178
    this.returnTimestamp = other.returnTimestamp;
166
    this.isSettled = other.isSettled;
179
    this.isSettled = other.isSettled;
-
 
180
    if (other.isSetType()) {
-
 
181
      this.type = other.type;
-
 
182
    }
167
  }
183
  }
168
 
184
 
169
  public PurchaseReturn deepCopy() {
185
  public PurchaseReturn deepCopy() {
170
    return new PurchaseReturn(this);
186
    return new PurchaseReturn(this);
171
  }
187
  }
Line 180... Line 196...
180
    this.amount = 0;
196
    this.amount = 0;
181
    setReturnTimestampIsSet(false);
197
    setReturnTimestampIsSet(false);
182
    this.returnTimestamp = 0;
198
    this.returnTimestamp = 0;
183
    setIsSettledIsSet(false);
199
    setIsSettledIsSet(false);
184
    this.isSettled = false;
200
    this.isSettled = false;
-
 
201
    this.type = null;
185
  }
202
  }
186
 
203
 
187
  public long getId() {
204
  public long getId() {
188
    return this.id;
205
    return this.id;
189
  }
206
  }
Line 292... Line 309...
292
 
309
 
293
  public void setIsSettledIsSet(boolean value) {
310
  public void setIsSettledIsSet(boolean value) {
294
    __isset_bit_vector.set(__ISSETTLED_ISSET_ID, value);
311
    __isset_bit_vector.set(__ISSETTLED_ISSET_ID, value);
295
  }
312
  }
296
 
313
 
-
 
314
  /**
-
 
315
   * 
-
 
316
   * @see PurchaseReturnType
-
 
317
   */
-
 
318
  public PurchaseReturnType getType() {
-
 
319
    return this.type;
-
 
320
  }
-
 
321
 
-
 
322
  /**
-
 
323
   * 
-
 
324
   * @see PurchaseReturnType
-
 
325
   */
-
 
326
  public void setType(PurchaseReturnType type) {
-
 
327
    this.type = type;
-
 
328
  }
-
 
329
 
-
 
330
  public void unsetType() {
-
 
331
    this.type = null;
-
 
332
  }
-
 
333
 
-
 
334
  /** Returns true if field type is set (has been assigned a value) and false otherwise */
-
 
335
  public boolean isSetType() {
-
 
336
    return this.type != null;
-
 
337
  }
-
 
338
 
-
 
339
  public void setTypeIsSet(boolean value) {
-
 
340
    if (!value) {
-
 
341
      this.type = null;
-
 
342
    }
-
 
343
  }
-
 
344
 
297
  public void setFieldValue(_Fields field, Object value) {
345
  public void setFieldValue(_Fields field, Object value) {
298
    switch (field) {
346
    switch (field) {
299
    case ID:
347
    case ID:
300
      if (value == null) {
348
      if (value == null) {
301
        unsetId();
349
        unsetId();
Line 334... Line 382...
334
      } else {
382
      } else {
335
        setIsSettled((Boolean)value);
383
        setIsSettled((Boolean)value);
336
      }
384
      }
337
      break;
385
      break;
338
 
386
 
-
 
387
    case TYPE:
-
 
388
      if (value == null) {
-
 
389
        unsetType();
-
 
390
      } else {
-
 
391
        setType((PurchaseReturnType)value);
-
 
392
      }
-
 
393
      break;
-
 
394
 
339
    }
395
    }
340
  }
396
  }
341
 
397
 
342
  public Object getFieldValue(_Fields field) {
398
  public Object getFieldValue(_Fields field) {
343
    switch (field) {
399
    switch (field) {
Line 354... Line 410...
354
      return Long.valueOf(getReturnTimestamp());
410
      return Long.valueOf(getReturnTimestamp());
355
 
411
 
356
    case IS_SETTLED:
412
    case IS_SETTLED:
357
      return Boolean.valueOf(isIsSettled());
413
      return Boolean.valueOf(isIsSettled());
358
 
414
 
-
 
415
    case TYPE:
-
 
416
      return getType();
-
 
417
 
359
    }
418
    }
360
    throw new IllegalStateException();
419
    throw new IllegalStateException();
361
  }
420
  }
362
 
421
 
363
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
422
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
Line 375... Line 434...
375
      return isSetAmount();
434
      return isSetAmount();
376
    case RETURN_TIMESTAMP:
435
    case RETURN_TIMESTAMP:
377
      return isSetReturnTimestamp();
436
      return isSetReturnTimestamp();
378
    case IS_SETTLED:
437
    case IS_SETTLED:
379
      return isSetIsSettled();
438
      return isSetIsSettled();
-
 
439
    case TYPE:
-
 
440
      return isSetType();
380
    }
441
    }
381
    throw new IllegalStateException();
442
    throw new IllegalStateException();
382
  }
443
  }
383
 
444
 
384
  @Override
445
  @Override
Line 437... Line 498...
437
        return false;
498
        return false;
438
      if (this.isSettled != that.isSettled)
499
      if (this.isSettled != that.isSettled)
439
        return false;
500
        return false;
440
    }
501
    }
441
 
502
 
-
 
503
    boolean this_present_type = true && this.isSetType();
-
 
504
    boolean that_present_type = true && that.isSetType();
-
 
505
    if (this_present_type || that_present_type) {
-
 
506
      if (!(this_present_type && that_present_type))
-
 
507
        return false;
-
 
508
      if (!this.type.equals(that.type))
-
 
509
        return false;
-
 
510
    }
-
 
511
 
442
    return true;
512
    return true;
443
  }
513
  }
444
 
514
 
445
  @Override
515
  @Override
446
  public int hashCode() {
516
  public int hashCode() {
Line 503... Line 573...
503
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isSettled, typedOther.isSettled);
573
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isSettled, typedOther.isSettled);
504
      if (lastComparison != 0) {
574
      if (lastComparison != 0) {
505
        return lastComparison;
575
        return lastComparison;
506
      }
576
      }
507
    }
577
    }
-
 
578
    lastComparison = Boolean.valueOf(isSetType()).compareTo(typedOther.isSetType());
-
 
579
    if (lastComparison != 0) {
-
 
580
      return lastComparison;
-
 
581
    }
-
 
582
    if (isSetType()) {
-
 
583
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, typedOther.type);
-
 
584
      if (lastComparison != 0) {
-
 
585
        return lastComparison;
-
 
586
      }
-
 
587
    }
508
    return 0;
588
    return 0;
509
  }
589
  }
510
 
590
 
511
  public _Fields fieldForId(int fieldId) {
591
  public _Fields fieldForId(int fieldId) {
512
    return _Fields.findByThriftId(fieldId);
592
    return _Fields.findByThriftId(fieldId);
Line 560... Line 640...
560
            setIsSettledIsSet(true);
640
            setIsSettledIsSet(true);
561
          } else { 
641
          } else { 
562
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
642
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
563
          }
643
          }
564
          break;
644
          break;
-
 
645
        case 6: // TYPE
-
 
646
          if (field.type == org.apache.thrift.protocol.TType.I32) {
-
 
647
            this.type = PurchaseReturnType.findByValue(iprot.readI32());
-
 
648
          } else { 
-
 
649
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
650
          }
-
 
651
          break;
565
        default:
652
        default:
566
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
653
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
567
      }
654
      }
568
      iprot.readFieldEnd();
655
      iprot.readFieldEnd();
569
    }
656
    }
Line 588... Line 675...
588
    oprot.writeI64(this.returnTimestamp);
675
    oprot.writeI64(this.returnTimestamp);
589
    oprot.writeFieldEnd();
676
    oprot.writeFieldEnd();
590
    oprot.writeFieldBegin(IS_SETTLED_FIELD_DESC);
677
    oprot.writeFieldBegin(IS_SETTLED_FIELD_DESC);
591
    oprot.writeBool(this.isSettled);
678
    oprot.writeBool(this.isSettled);
592
    oprot.writeFieldEnd();
679
    oprot.writeFieldEnd();
-
 
680
    if (this.type != null) {
-
 
681
      oprot.writeFieldBegin(TYPE_FIELD_DESC);
-
 
682
      oprot.writeI32(this.type.getValue());
-
 
683
      oprot.writeFieldEnd();
-
 
684
    }
593
    oprot.writeFieldStop();
685
    oprot.writeFieldStop();
594
    oprot.writeStructEnd();
686
    oprot.writeStructEnd();
595
  }
687
  }
596
 
688
 
597
  @Override
689
  @Override
Line 616... Line 708...
616
    first = false;
708
    first = false;
617
    if (!first) sb.append(", ");
709
    if (!first) sb.append(", ");
618
    sb.append("isSettled:");
710
    sb.append("isSettled:");
619
    sb.append(this.isSettled);
711
    sb.append(this.isSettled);
620
    first = false;
712
    first = false;
-
 
713
    if (!first) sb.append(", ");
-
 
714
    sb.append("type:");
-
 
715
    if (this.type == null) {
-
 
716
      sb.append("null");
-
 
717
    } else {
-
 
718
      sb.append(this.type);
-
 
719
    }
-
 
720
    first = false;
621
    sb.append(")");
721
    sb.append(")");
622
    return sb.toString();
722
    return sb.toString();
623
  }
723
  }
624
 
724
 
625
  public void validate() throws org.apache.thrift.TException {
725
  public void validate() throws org.apache.thrift.TException {