Subversion Repositories SmartDukaan

Rev

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

Rev 1013 Rev 2219
Line 31... Line 31...
31
  private static final TField CREATED_ON_FIELD_DESC = new TField("createdOn", TType.I64, (short)3);
31
  private static final TField CREATED_ON_FIELD_DESC = new TField("createdOn", TType.I64, (short)3);
32
  private static final TField TRANSACTION_STATUS_FIELD_DESC = new TField("transactionStatus", TType.I32, (short)4);
32
  private static final TField TRANSACTION_STATUS_FIELD_DESC = new TField("transactionStatus", TType.I32, (short)4);
33
  private static final TField STATUS_DESCRIPTION_FIELD_DESC = new TField("statusDescription", TType.STRING, (short)5);
33
  private static final TField STATUS_DESCRIPTION_FIELD_DESC = new TField("statusDescription", TType.STRING, (short)5);
34
  private static final TField SHOPPING_CARTID_FIELD_DESC = new TField("shoppingCartid", TType.I64, (short)6);
34
  private static final TField SHOPPING_CARTID_FIELD_DESC = new TField("shoppingCartid", TType.I64, (short)6);
35
  private static final TField CUSTOMER_ID_FIELD_DESC = new TField("customer_id", TType.I64, (short)7);
35
  private static final TField CUSTOMER_ID_FIELD_DESC = new TField("customer_id", TType.I64, (short)7);
-
 
36
  private static final TField COUPON_CODE_FIELD_DESC = new TField("coupon_code", TType.STRING, (short)8);
36
 
37
 
37
  private long id;
38
  private long id;
38
  private List<Order> orders;
39
  private List<Order> orders;
39
  private long createdOn;
40
  private long createdOn;
40
  private TransactionStatus transactionStatus;
41
  private TransactionStatus transactionStatus;
41
  private String statusDescription;
42
  private String statusDescription;
42
  private long shoppingCartid;
43
  private long shoppingCartid;
43
  private long customer_id;
44
  private long customer_id;
-
 
45
  private String coupon_code;
44
 
46
 
45
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
47
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
46
  public enum _Fields implements TFieldIdEnum {
48
  public enum _Fields implements TFieldIdEnum {
47
    ID((short)1, "id"),
49
    ID((short)1, "id"),
48
    ORDERS((short)2, "orders"),
50
    ORDERS((short)2, "orders"),
Line 52... Line 54...
52
     * @see TransactionStatus
54
     * @see TransactionStatus
53
     */
55
     */
54
    TRANSACTION_STATUS((short)4, "transactionStatus"),
56
    TRANSACTION_STATUS((short)4, "transactionStatus"),
55
    STATUS_DESCRIPTION((short)5, "statusDescription"),
57
    STATUS_DESCRIPTION((short)5, "statusDescription"),
56
    SHOPPING_CARTID((short)6, "shoppingCartid"),
58
    SHOPPING_CARTID((short)6, "shoppingCartid"),
57
    CUSTOMER_ID((short)7, "customer_id");
59
    CUSTOMER_ID((short)7, "customer_id"),
-
 
60
    COUPON_CODE((short)8, "coupon_code");
58
 
61
 
59
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
62
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
60
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
63
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
61
 
64
 
62
    static {
65
    static {
Line 128... Line 131...
128
        new FieldValueMetaData(TType.STRING)));
131
        new FieldValueMetaData(TType.STRING)));
129
    put(_Fields.SHOPPING_CARTID, new FieldMetaData("shoppingCartid", TFieldRequirementType.DEFAULT, 
132
    put(_Fields.SHOPPING_CARTID, new FieldMetaData("shoppingCartid", TFieldRequirementType.DEFAULT, 
130
        new FieldValueMetaData(TType.I64)));
133
        new FieldValueMetaData(TType.I64)));
131
    put(_Fields.CUSTOMER_ID, new FieldMetaData("customer_id", TFieldRequirementType.DEFAULT, 
134
    put(_Fields.CUSTOMER_ID, new FieldMetaData("customer_id", TFieldRequirementType.DEFAULT, 
132
        new FieldValueMetaData(TType.I64)));
135
        new FieldValueMetaData(TType.I64)));
-
 
136
    put(_Fields.COUPON_CODE, new FieldMetaData("coupon_code", TFieldRequirementType.DEFAULT, 
-
 
137
        new FieldValueMetaData(TType.STRING)));
133
  }});
138
  }});
134
 
139
 
135
  static {
140
  static {
136
    FieldMetaData.addStructMetaDataMap(Transaction.class, metaDataMap);
141
    FieldMetaData.addStructMetaDataMap(Transaction.class, metaDataMap);
137
  }
142
  }
Line 144... Line 149...
144
    List<Order> orders,
149
    List<Order> orders,
145
    long createdOn,
150
    long createdOn,
146
    TransactionStatus transactionStatus,
151
    TransactionStatus transactionStatus,
147
    String statusDescription,
152
    String statusDescription,
148
    long shoppingCartid,
153
    long shoppingCartid,
149
    long customer_id)
154
    long customer_id,
-
 
155
    String coupon_code)
150
  {
156
  {
151
    this();
157
    this();
152
    this.id = id;
158
    this.id = id;
153
    setIdIsSet(true);
159
    setIdIsSet(true);
154
    this.orders = orders;
160
    this.orders = orders;
Line 158... Line 164...
158
    this.statusDescription = statusDescription;
164
    this.statusDescription = statusDescription;
159
    this.shoppingCartid = shoppingCartid;
165
    this.shoppingCartid = shoppingCartid;
160
    setShoppingCartidIsSet(true);
166
    setShoppingCartidIsSet(true);
161
    this.customer_id = customer_id;
167
    this.customer_id = customer_id;
162
    setCustomer_idIsSet(true);
168
    setCustomer_idIsSet(true);
-
 
169
    this.coupon_code = coupon_code;
163
  }
170
  }
164
 
171
 
165
  /**
172
  /**
166
   * Performs a deep copy on <i>other</i>.
173
   * Performs a deep copy on <i>other</i>.
167
   */
174
   */
Line 183... Line 190...
183
    if (other.isSetStatusDescription()) {
190
    if (other.isSetStatusDescription()) {
184
      this.statusDescription = other.statusDescription;
191
      this.statusDescription = other.statusDescription;
185
    }
192
    }
186
    this.shoppingCartid = other.shoppingCartid;
193
    this.shoppingCartid = other.shoppingCartid;
187
    this.customer_id = other.customer_id;
194
    this.customer_id = other.customer_id;
-
 
195
    if (other.isSetCoupon_code()) {
-
 
196
      this.coupon_code = other.coupon_code;
-
 
197
    }
188
  }
198
  }
189
 
199
 
190
  public Transaction deepCopy() {
200
  public Transaction deepCopy() {
191
    return new Transaction(this);
201
    return new Transaction(this);
192
  }
202
  }
Line 381... Line 391...
381
 
391
 
382
  public void setCustomer_idIsSet(boolean value) {
392
  public void setCustomer_idIsSet(boolean value) {
383
    __isset_bit_vector.set(__CUSTOMER_ID_ISSET_ID, value);
393
    __isset_bit_vector.set(__CUSTOMER_ID_ISSET_ID, value);
384
  }
394
  }
385
 
395
 
-
 
396
  public String getCoupon_code() {
-
 
397
    return this.coupon_code;
-
 
398
  }
-
 
399
 
-
 
400
  public Transaction setCoupon_code(String coupon_code) {
-
 
401
    this.coupon_code = coupon_code;
-
 
402
    return this;
-
 
403
  }
-
 
404
 
-
 
405
  public void unsetCoupon_code() {
-
 
406
    this.coupon_code = null;
-
 
407
  }
-
 
408
 
-
 
409
  /** Returns true if field coupon_code is set (has been asigned a value) and false otherwise */
-
 
410
  public boolean isSetCoupon_code() {
-
 
411
    return this.coupon_code != null;
-
 
412
  }
-
 
413
 
-
 
414
  public void setCoupon_codeIsSet(boolean value) {
-
 
415
    if (!value) {
-
 
416
      this.coupon_code = null;
-
 
417
    }
-
 
418
  }
-
 
419
 
386
  public void setFieldValue(_Fields field, Object value) {
420
  public void setFieldValue(_Fields field, Object value) {
387
    switch (field) {
421
    switch (field) {
388
    case ID:
422
    case ID:
389
      if (value == null) {
423
      if (value == null) {
390
        unsetId();
424
        unsetId();
Line 439... Line 473...
439
      } else {
473
      } else {
440
        setCustomer_id((Long)value);
474
        setCustomer_id((Long)value);
441
      }
475
      }
442
      break;
476
      break;
443
 
477
 
-
 
478
    case COUPON_CODE:
-
 
479
      if (value == null) {
-
 
480
        unsetCoupon_code();
-
 
481
      } else {
-
 
482
        setCoupon_code((String)value);
-
 
483
      }
-
 
484
      break;
-
 
485
 
444
    }
486
    }
445
  }
487
  }
446
 
488
 
447
  public void setFieldValue(int fieldID, Object value) {
489
  public void setFieldValue(int fieldID, Object value) {
448
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
490
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
Line 469... Line 511...
469
      return new Long(getShoppingCartid());
511
      return new Long(getShoppingCartid());
470
 
512
 
471
    case CUSTOMER_ID:
513
    case CUSTOMER_ID:
472
      return new Long(getCustomer_id());
514
      return new Long(getCustomer_id());
473
 
515
 
-
 
516
    case COUPON_CODE:
-
 
517
      return getCoupon_code();
-
 
518
 
474
    }
519
    }
475
    throw new IllegalStateException();
520
    throw new IllegalStateException();
476
  }
521
  }
477
 
522
 
478
  public Object getFieldValue(int fieldId) {
523
  public Object getFieldValue(int fieldId) {
Line 494... Line 539...
494
      return isSetStatusDescription();
539
      return isSetStatusDescription();
495
    case SHOPPING_CARTID:
540
    case SHOPPING_CARTID:
496
      return isSetShoppingCartid();
541
      return isSetShoppingCartid();
497
    case CUSTOMER_ID:
542
    case CUSTOMER_ID:
498
      return isSetCustomer_id();
543
      return isSetCustomer_id();
-
 
544
    case COUPON_CODE:
-
 
545
      return isSetCoupon_code();
499
    }
546
    }
500
    throw new IllegalStateException();
547
    throw new IllegalStateException();
501
  }
548
  }
502
 
549
 
503
  public boolean isSet(int fieldID) {
550
  public boolean isSet(int fieldID) {
Line 578... Line 625...
578
        return false;
625
        return false;
579
      if (this.customer_id != that.customer_id)
626
      if (this.customer_id != that.customer_id)
580
        return false;
627
        return false;
581
    }
628
    }
582
 
629
 
-
 
630
    boolean this_present_coupon_code = true && this.isSetCoupon_code();
-
 
631
    boolean that_present_coupon_code = true && that.isSetCoupon_code();
-
 
632
    if (this_present_coupon_code || that_present_coupon_code) {
-
 
633
      if (!(this_present_coupon_code && that_present_coupon_code))
-
 
634
        return false;
-
 
635
      if (!this.coupon_code.equals(that.coupon_code))
-
 
636
        return false;
-
 
637
    }
-
 
638
 
583
    return true;
639
    return true;
584
  }
640
  }
585
 
641
 
586
  @Override
642
  @Override
587
  public int hashCode() {
643
  public int hashCode() {
Line 650... Line 706...
650
    }
706
    }
651
    lastComparison = TBaseHelper.compareTo(customer_id, typedOther.customer_id);
707
    lastComparison = TBaseHelper.compareTo(customer_id, typedOther.customer_id);
652
    if (lastComparison != 0) {
708
    if (lastComparison != 0) {
653
      return lastComparison;
709
      return lastComparison;
654
    }
710
    }
-
 
711
    lastComparison = Boolean.valueOf(isSetCoupon_code()).compareTo(isSetCoupon_code());
-
 
712
    if (lastComparison != 0) {
-
 
713
      return lastComparison;
-
 
714
    }
-
 
715
    lastComparison = TBaseHelper.compareTo(coupon_code, typedOther.coupon_code);
-
 
716
    if (lastComparison != 0) {
-
 
717
      return lastComparison;
-
 
718
    }
655
    return 0;
719
    return 0;
656
  }
720
  }
657
 
721
 
658
  public void read(TProtocol iprot) throws TException {
722
  public void read(TProtocol iprot) throws TException {
659
    TField field;
723
    TField field;
Line 731... Line 795...
731
              setCustomer_idIsSet(true);
795
              setCustomer_idIsSet(true);
732
            } else { 
796
            } else { 
733
              TProtocolUtil.skip(iprot, field.type);
797
              TProtocolUtil.skip(iprot, field.type);
734
            }
798
            }
735
            break;
799
            break;
-
 
800
          case COUPON_CODE:
-
 
801
            if (field.type == TType.STRING) {
-
 
802
              this.coupon_code = iprot.readString();
-
 
803
            } else { 
-
 
804
              TProtocolUtil.skip(iprot, field.type);
-
 
805
            }
-
 
806
            break;
736
        }
807
        }
737
        iprot.readFieldEnd();
808
        iprot.readFieldEnd();
738
      }
809
      }
739
    }
810
    }
740
    iprot.readStructEnd();
811
    iprot.readStructEnd();
Line 777... Line 848...
777
    oprot.writeI64(this.shoppingCartid);
848
    oprot.writeI64(this.shoppingCartid);
778
    oprot.writeFieldEnd();
849
    oprot.writeFieldEnd();
779
    oprot.writeFieldBegin(CUSTOMER_ID_FIELD_DESC);
850
    oprot.writeFieldBegin(CUSTOMER_ID_FIELD_DESC);
780
    oprot.writeI64(this.customer_id);
851
    oprot.writeI64(this.customer_id);
781
    oprot.writeFieldEnd();
852
    oprot.writeFieldEnd();
-
 
853
    if (this.coupon_code != null) {
-
 
854
      oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
-
 
855
      oprot.writeString(this.coupon_code);
-
 
856
      oprot.writeFieldEnd();
-
 
857
    }
782
    oprot.writeFieldStop();
858
    oprot.writeFieldStop();
783
    oprot.writeStructEnd();
859
    oprot.writeStructEnd();
784
  }
860
  }
785
 
861
 
786
  @Override
862
  @Override
Line 833... Line 909...
833
    first = false;
909
    first = false;
834
    if (!first) sb.append(", ");
910
    if (!first) sb.append(", ");
835
    sb.append("customer_id:");
911
    sb.append("customer_id:");
836
    sb.append(this.customer_id);
912
    sb.append(this.customer_id);
837
    first = false;
913
    first = false;
-
 
914
    if (!first) sb.append(", ");
-
 
915
    sb.append("coupon_code:");
-
 
916
    if (this.coupon_code == null) {
-
 
917
      sb.append("null");
-
 
918
    } else {
-
 
919
      sb.append(this.coupon_code);
-
 
920
    }
-
 
921
    first = false;
838
    sb.append(")");
922
    sb.append(")");
839
    return sb.toString();
923
    return sb.toString();
840
  }
924
  }
841
 
925
 
842
  public void validate() throws TException {
926
  public void validate() throws TException {