Subversion Repositories SmartDukaan

Rev

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

Rev 6821 Rev 10864
Line 27... Line 27...
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
  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);
-
 
32
  private static final org.apache.thrift.protocol.TField RETURN_INVENTORY_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("returnInventoryType", org.apache.thrift.protocol.TType.I32, (short)7);
32
 
33
 
33
  private long id; // required
34
  private long id; // required
34
  private long vendorId; // required
35
  private long vendorId; // required
35
  private long amount; // required
36
  private long amount; // required
36
  private long returnTimestamp; // required
37
  private long returnTimestamp; // required
37
  private boolean isSettled; // required
38
  private boolean isSettled; // required
38
  private PurchaseReturnType type; // required
39
  private PurchaseReturnType type; // required
-
 
40
  private PurchaseReturnInventoryType returnInventoryType; // required
39
 
41
 
40
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
42
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
41
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
43
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
42
    ID((short)1, "id"),
44
    ID((short)1, "id"),
43
    VENDOR_ID((short)2, "vendorId"),
45
    VENDOR_ID((short)2, "vendorId"),
Line 46... Line 48...
46
    IS_SETTLED((short)5, "isSettled"),
48
    IS_SETTLED((short)5, "isSettled"),
47
    /**
49
    /**
48
     * 
50
     * 
49
     * @see PurchaseReturnType
51
     * @see PurchaseReturnType
50
     */
52
     */
51
    TYPE((short)6, "type");
53
    TYPE((short)6, "type"),
-
 
54
    /**
-
 
55
     * 
-
 
56
     * @see PurchaseReturnInventoryType
-
 
57
     */
-
 
58
    RETURN_INVENTORY_TYPE((short)7, "returnInventoryType");
52
 
59
 
53
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
60
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
54
 
61
 
55
    static {
62
    static {
56
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
63
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
Line 73... Line 80...
73
          return RETURN_TIMESTAMP;
80
          return RETURN_TIMESTAMP;
74
        case 5: // IS_SETTLED
81
        case 5: // IS_SETTLED
75
          return IS_SETTLED;
82
          return IS_SETTLED;
76
        case 6: // TYPE
83
        case 6: // TYPE
77
          return TYPE;
84
          return TYPE;
-
 
85
        case 7: // RETURN_INVENTORY_TYPE
-
 
86
          return RETURN_INVENTORY_TYPE;
78
        default:
87
        default:
79
          return null;
88
          return null;
80
      }
89
      }
81
    }
90
    }
82
 
91
 
Line 135... Line 144...
135
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
144
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
136
    tmpMap.put(_Fields.IS_SETTLED, new org.apache.thrift.meta_data.FieldMetaData("isSettled", org.apache.thrift.TFieldRequirementType.DEFAULT, 
145
    tmpMap.put(_Fields.IS_SETTLED, new org.apache.thrift.meta_data.FieldMetaData("isSettled", org.apache.thrift.TFieldRequirementType.DEFAULT, 
137
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
146
        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, 
147
    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)));
148
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, PurchaseReturnType.class)));
-
 
149
    tmpMap.put(_Fields.RETURN_INVENTORY_TYPE, new org.apache.thrift.meta_data.FieldMetaData("returnInventoryType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
-
 
150
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, PurchaseReturnInventoryType.class)));
140
    metaDataMap = Collections.unmodifiableMap(tmpMap);
151
    metaDataMap = Collections.unmodifiableMap(tmpMap);
141
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PurchaseReturn.class, metaDataMap);
152
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PurchaseReturn.class, metaDataMap);
142
  }
153
  }
143
 
154
 
144
  public PurchaseReturn() {
155
  public PurchaseReturn() {
Line 148... Line 159...
148
    long id,
159
    long id,
149
    long vendorId,
160
    long vendorId,
150
    long amount,
161
    long amount,
151
    long returnTimestamp,
162
    long returnTimestamp,
152
    boolean isSettled,
163
    boolean isSettled,
153
    PurchaseReturnType type)
164
    PurchaseReturnType type,
-
 
165
    PurchaseReturnInventoryType returnInventoryType)
154
  {
166
  {
155
    this();
167
    this();
156
    this.id = id;
168
    this.id = id;
157
    setIdIsSet(true);
169
    setIdIsSet(true);
158
    this.vendorId = vendorId;
170
    this.vendorId = vendorId;
Line 162... Line 174...
162
    this.returnTimestamp = returnTimestamp;
174
    this.returnTimestamp = returnTimestamp;
163
    setReturnTimestampIsSet(true);
175
    setReturnTimestampIsSet(true);
164
    this.isSettled = isSettled;
176
    this.isSettled = isSettled;
165
    setIsSettledIsSet(true);
177
    setIsSettledIsSet(true);
166
    this.type = type;
178
    this.type = type;
-
 
179
    this.returnInventoryType = returnInventoryType;
167
  }
180
  }
168
 
181
 
169
  /**
182
  /**
170
   * Performs a deep copy on <i>other</i>.
183
   * Performs a deep copy on <i>other</i>.
171
   */
184
   */
Line 178... Line 191...
178
    this.returnTimestamp = other.returnTimestamp;
191
    this.returnTimestamp = other.returnTimestamp;
179
    this.isSettled = other.isSettled;
192
    this.isSettled = other.isSettled;
180
    if (other.isSetType()) {
193
    if (other.isSetType()) {
181
      this.type = other.type;
194
      this.type = other.type;
182
    }
195
    }
-
 
196
    if (other.isSetReturnInventoryType()) {
-
 
197
      this.returnInventoryType = other.returnInventoryType;
-
 
198
    }
183
  }
199
  }
184
 
200
 
185
  public PurchaseReturn deepCopy() {
201
  public PurchaseReturn deepCopy() {
186
    return new PurchaseReturn(this);
202
    return new PurchaseReturn(this);
187
  }
203
  }
Line 197... Line 213...
197
    setReturnTimestampIsSet(false);
213
    setReturnTimestampIsSet(false);
198
    this.returnTimestamp = 0;
214
    this.returnTimestamp = 0;
199
    setIsSettledIsSet(false);
215
    setIsSettledIsSet(false);
200
    this.isSettled = false;
216
    this.isSettled = false;
201
    this.type = null;
217
    this.type = null;
-
 
218
    this.returnInventoryType = null;
202
  }
219
  }
203
 
220
 
204
  public long getId() {
221
  public long getId() {
205
    return this.id;
222
    return this.id;
206
  }
223
  }
Line 340... Line 357...
340
    if (!value) {
357
    if (!value) {
341
      this.type = null;
358
      this.type = null;
342
    }
359
    }
343
  }
360
  }
344
 
361
 
-
 
362
  /**
-
 
363
   * 
-
 
364
   * @see PurchaseReturnInventoryType
-
 
365
   */
-
 
366
  public PurchaseReturnInventoryType getReturnInventoryType() {
-
 
367
    return this.returnInventoryType;
-
 
368
  }
-
 
369
 
-
 
370
  /**
-
 
371
   * 
-
 
372
   * @see PurchaseReturnInventoryType
-
 
373
   */
-
 
374
  public void setReturnInventoryType(PurchaseReturnInventoryType returnInventoryType) {
-
 
375
    this.returnInventoryType = returnInventoryType;
-
 
376
  }
-
 
377
 
-
 
378
  public void unsetReturnInventoryType() {
-
 
379
    this.returnInventoryType = null;
-
 
380
  }
-
 
381
 
-
 
382
  /** Returns true if field returnInventoryType is set (has been assigned a value) and false otherwise */
-
 
383
  public boolean isSetReturnInventoryType() {
-
 
384
    return this.returnInventoryType != null;
-
 
385
  }
-
 
386
 
-
 
387
  public void setReturnInventoryTypeIsSet(boolean value) {
-
 
388
    if (!value) {
-
 
389
      this.returnInventoryType = null;
-
 
390
    }
-
 
391
  }
-
 
392
 
345
  public void setFieldValue(_Fields field, Object value) {
393
  public void setFieldValue(_Fields field, Object value) {
346
    switch (field) {
394
    switch (field) {
347
    case ID:
395
    case ID:
348
      if (value == null) {
396
      if (value == null) {
349
        unsetId();
397
        unsetId();
Line 390... Line 438...
390
      } else {
438
      } else {
391
        setType((PurchaseReturnType)value);
439
        setType((PurchaseReturnType)value);
392
      }
440
      }
393
      break;
441
      break;
394
 
442
 
-
 
443
    case RETURN_INVENTORY_TYPE:
-
 
444
      if (value == null) {
-
 
445
        unsetReturnInventoryType();
-
 
446
      } else {
-
 
447
        setReturnInventoryType((PurchaseReturnInventoryType)value);
-
 
448
      }
-
 
449
      break;
-
 
450
 
395
    }
451
    }
396
  }
452
  }
397
 
453
 
398
  public Object getFieldValue(_Fields field) {
454
  public Object getFieldValue(_Fields field) {
399
    switch (field) {
455
    switch (field) {
Line 413... Line 469...
413
      return Boolean.valueOf(isIsSettled());
469
      return Boolean.valueOf(isIsSettled());
414
 
470
 
415
    case TYPE:
471
    case TYPE:
416
      return getType();
472
      return getType();
417
 
473
 
-
 
474
    case RETURN_INVENTORY_TYPE:
-
 
475
      return getReturnInventoryType();
-
 
476
 
418
    }
477
    }
419
    throw new IllegalStateException();
478
    throw new IllegalStateException();
420
  }
479
  }
421
 
480
 
422
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
481
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
Line 436... Line 495...
436
      return isSetReturnTimestamp();
495
      return isSetReturnTimestamp();
437
    case IS_SETTLED:
496
    case IS_SETTLED:
438
      return isSetIsSettled();
497
      return isSetIsSettled();
439
    case TYPE:
498
    case TYPE:
440
      return isSetType();
499
      return isSetType();
-
 
500
    case RETURN_INVENTORY_TYPE:
-
 
501
      return isSetReturnInventoryType();
441
    }
502
    }
442
    throw new IllegalStateException();
503
    throw new IllegalStateException();
443
  }
504
  }
444
 
505
 
445
  @Override
506
  @Override
Line 507... Line 568...
507
        return false;
568
        return false;
508
      if (!this.type.equals(that.type))
569
      if (!this.type.equals(that.type))
509
        return false;
570
        return false;
510
    }
571
    }
511
 
572
 
-
 
573
    boolean this_present_returnInventoryType = true && this.isSetReturnInventoryType();
-
 
574
    boolean that_present_returnInventoryType = true && that.isSetReturnInventoryType();
-
 
575
    if (this_present_returnInventoryType || that_present_returnInventoryType) {
-
 
576
      if (!(this_present_returnInventoryType && that_present_returnInventoryType))
-
 
577
        return false;
-
 
578
      if (!this.returnInventoryType.equals(that.returnInventoryType))
-
 
579
        return false;
-
 
580
    }
-
 
581
 
512
    return true;
582
    return true;
513
  }
583
  }
514
 
584
 
515
  @Override
585
  @Override
516
  public int hashCode() {
586
  public int hashCode() {
Line 583... Line 653...
583
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, typedOther.type);
653
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, typedOther.type);
584
      if (lastComparison != 0) {
654
      if (lastComparison != 0) {
585
        return lastComparison;
655
        return lastComparison;
586
      }
656
      }
587
    }
657
    }
-
 
658
    lastComparison = Boolean.valueOf(isSetReturnInventoryType()).compareTo(typedOther.isSetReturnInventoryType());
-
 
659
    if (lastComparison != 0) {
-
 
660
      return lastComparison;
-
 
661
    }
-
 
662
    if (isSetReturnInventoryType()) {
-
 
663
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.returnInventoryType, typedOther.returnInventoryType);
-
 
664
      if (lastComparison != 0) {
-
 
665
        return lastComparison;
-
 
666
      }
-
 
667
    }
588
    return 0;
668
    return 0;
589
  }
669
  }
590
 
670
 
591
  public _Fields fieldForId(int fieldId) {
671
  public _Fields fieldForId(int fieldId) {
592
    return _Fields.findByThriftId(fieldId);
672
    return _Fields.findByThriftId(fieldId);
Line 647... Line 727...
647
            this.type = PurchaseReturnType.findByValue(iprot.readI32());
727
            this.type = PurchaseReturnType.findByValue(iprot.readI32());
648
          } else { 
728
          } else { 
649
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
729
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
650
          }
730
          }
651
          break;
731
          break;
-
 
732
        case 7: // RETURN_INVENTORY_TYPE
-
 
733
          if (field.type == org.apache.thrift.protocol.TType.I32) {
-
 
734
            this.returnInventoryType = PurchaseReturnInventoryType.findByValue(iprot.readI32());
-
 
735
          } else { 
-
 
736
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
-
 
737
          }
-
 
738
          break;
652
        default:
739
        default:
653
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
740
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
654
      }
741
      }
655
      iprot.readFieldEnd();
742
      iprot.readFieldEnd();
656
    }
743
    }
Line 680... Line 767...
680
    if (this.type != null) {
767
    if (this.type != null) {
681
      oprot.writeFieldBegin(TYPE_FIELD_DESC);
768
      oprot.writeFieldBegin(TYPE_FIELD_DESC);
682
      oprot.writeI32(this.type.getValue());
769
      oprot.writeI32(this.type.getValue());
683
      oprot.writeFieldEnd();
770
      oprot.writeFieldEnd();
684
    }
771
    }
-
 
772
    if (this.returnInventoryType != null) {
-
 
773
      oprot.writeFieldBegin(RETURN_INVENTORY_TYPE_FIELD_DESC);
-
 
774
      oprot.writeI32(this.returnInventoryType.getValue());
-
 
775
      oprot.writeFieldEnd();
-
 
776
    }
685
    oprot.writeFieldStop();
777
    oprot.writeFieldStop();
686
    oprot.writeStructEnd();
778
    oprot.writeStructEnd();
687
  }
779
  }
688
 
780
 
689
  @Override
781
  @Override
Line 716... Line 808...
716
      sb.append("null");
808
      sb.append("null");
717
    } else {
809
    } else {
718
      sb.append(this.type);
810
      sb.append(this.type);
719
    }
811
    }
720
    first = false;
812
    first = false;
-
 
813
    if (!first) sb.append(", ");
-
 
814
    sb.append("returnInventoryType:");
-
 
815
    if (this.returnInventoryType == null) {
-
 
816
      sb.append("null");
-
 
817
    } else {
-
 
818
      sb.append(this.returnInventoryType);
-
 
819
    }
-
 
820
    first = false;
721
    sb.append(")");
821
    sb.append(")");
722
    return sb.toString();
822
    return sb.toString();
723
  }
823
  }
724
 
824
 
725
  public void validate() throws org.apache.thrift.TException {
825
  public void validate() throws org.apache.thrift.TException {