Subversion Repositories SmartDukaan

Rev

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

Rev 2219 Rev 2816
Line 32... Line 32...
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
  private static final TField COUPON_CODE_FIELD_DESC = new TField("coupon_code", TType.STRING, (short)8);
-
 
37
  private static final TField SESSION_SOURCE_FIELD_DESC = new TField("sessionSource", TType.STRING, (short)9);
-
 
38
  private static final TField SESSION_START_TIME_FIELD_DESC = new TField("sessionStartTime", TType.I64, (short)10);
37
 
39
 
38
  private long id;
40
  private long id;
39
  private List<Order> orders;
41
  private List<Order> orders;
40
  private long createdOn;
42
  private long createdOn;
41
  private TransactionStatus transactionStatus;
43
  private TransactionStatus transactionStatus;
42
  private String statusDescription;
44
  private String statusDescription;
43
  private long shoppingCartid;
45
  private long shoppingCartid;
44
  private long customer_id;
46
  private long customer_id;
45
  private String coupon_code;
47
  private String coupon_code;
-
 
48
  private String sessionSource;
-
 
49
  private long sessionStartTime;
46
 
50
 
47
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
51
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
48
  public enum _Fields implements TFieldIdEnum {
52
  public enum _Fields implements TFieldIdEnum {
49
    ID((short)1, "id"),
53
    ID((short)1, "id"),
50
    ORDERS((short)2, "orders"),
54
    ORDERS((short)2, "orders"),
Line 55... Line 59...
55
     */
59
     */
56
    TRANSACTION_STATUS((short)4, "transactionStatus"),
60
    TRANSACTION_STATUS((short)4, "transactionStatus"),
57
    STATUS_DESCRIPTION((short)5, "statusDescription"),
61
    STATUS_DESCRIPTION((short)5, "statusDescription"),
58
    SHOPPING_CARTID((short)6, "shoppingCartid"),
62
    SHOPPING_CARTID((short)6, "shoppingCartid"),
59
    CUSTOMER_ID((short)7, "customer_id"),
63
    CUSTOMER_ID((short)7, "customer_id"),
60
    COUPON_CODE((short)8, "coupon_code");
64
    COUPON_CODE((short)8, "coupon_code"),
-
 
65
    SESSION_SOURCE((short)9, "sessionSource"),
-
 
66
    SESSION_START_TIME((short)10, "sessionStartTime");
61
 
67
 
62
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
68
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
63
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
69
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
64
 
70
 
65
    static {
71
    static {
Line 113... Line 119...
113
  // isset id assignments
119
  // isset id assignments
114
  private static final int __ID_ISSET_ID = 0;
120
  private static final int __ID_ISSET_ID = 0;
115
  private static final int __CREATEDON_ISSET_ID = 1;
121
  private static final int __CREATEDON_ISSET_ID = 1;
116
  private static final int __SHOPPINGCARTID_ISSET_ID = 2;
122
  private static final int __SHOPPINGCARTID_ISSET_ID = 2;
117
  private static final int __CUSTOMER_ID_ISSET_ID = 3;
123
  private static final int __CUSTOMER_ID_ISSET_ID = 3;
-
 
124
  private static final int __SESSIONSTARTTIME_ISSET_ID = 4;
118
  private BitSet __isset_bit_vector = new BitSet(4);
125
  private BitSet __isset_bit_vector = new BitSet(5);
119
 
126
 
120
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
127
  public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
121
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
128
    put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT, 
122
        new FieldValueMetaData(TType.I64)));
129
        new FieldValueMetaData(TType.I64)));
123
    put(_Fields.ORDERS, new FieldMetaData("orders", TFieldRequirementType.DEFAULT, 
130
    put(_Fields.ORDERS, new FieldMetaData("orders", TFieldRequirementType.DEFAULT, 
Line 133... Line 140...
133
        new FieldValueMetaData(TType.I64)));
140
        new FieldValueMetaData(TType.I64)));
134
    put(_Fields.CUSTOMER_ID, new FieldMetaData("customer_id", TFieldRequirementType.DEFAULT, 
141
    put(_Fields.CUSTOMER_ID, new FieldMetaData("customer_id", TFieldRequirementType.DEFAULT, 
135
        new FieldValueMetaData(TType.I64)));
142
        new FieldValueMetaData(TType.I64)));
136
    put(_Fields.COUPON_CODE, new FieldMetaData("coupon_code", TFieldRequirementType.DEFAULT, 
143
    put(_Fields.COUPON_CODE, new FieldMetaData("coupon_code", TFieldRequirementType.DEFAULT, 
137
        new FieldValueMetaData(TType.STRING)));
144
        new FieldValueMetaData(TType.STRING)));
-
 
145
    put(_Fields.SESSION_SOURCE, new FieldMetaData("sessionSource", TFieldRequirementType.DEFAULT, 
-
 
146
        new FieldValueMetaData(TType.STRING)));
-
 
147
    put(_Fields.SESSION_START_TIME, new FieldMetaData("sessionStartTime", TFieldRequirementType.DEFAULT, 
-
 
148
        new FieldValueMetaData(TType.I64)));
138
  }});
149
  }});
139
 
150
 
140
  static {
151
  static {
141
    FieldMetaData.addStructMetaDataMap(Transaction.class, metaDataMap);
152
    FieldMetaData.addStructMetaDataMap(Transaction.class, metaDataMap);
142
  }
153
  }
Line 150... Line 161...
150
    long createdOn,
161
    long createdOn,
151
    TransactionStatus transactionStatus,
162
    TransactionStatus transactionStatus,
152
    String statusDescription,
163
    String statusDescription,
153
    long shoppingCartid,
164
    long shoppingCartid,
154
    long customer_id,
165
    long customer_id,
155
    String coupon_code)
166
    String coupon_code,
-
 
167
    String sessionSource,
-
 
168
    long sessionStartTime)
156
  {
169
  {
157
    this();
170
    this();
158
    this.id = id;
171
    this.id = id;
159
    setIdIsSet(true);
172
    setIdIsSet(true);
160
    this.orders = orders;
173
    this.orders = orders;
Line 165... Line 178...
165
    this.shoppingCartid = shoppingCartid;
178
    this.shoppingCartid = shoppingCartid;
166
    setShoppingCartidIsSet(true);
179
    setShoppingCartidIsSet(true);
167
    this.customer_id = customer_id;
180
    this.customer_id = customer_id;
168
    setCustomer_idIsSet(true);
181
    setCustomer_idIsSet(true);
169
    this.coupon_code = coupon_code;
182
    this.coupon_code = coupon_code;
-
 
183
    this.sessionSource = sessionSource;
-
 
184
    this.sessionStartTime = sessionStartTime;
-
 
185
    setSessionStartTimeIsSet(true);
170
  }
186
  }
171
 
187
 
172
  /**
188
  /**
173
   * Performs a deep copy on <i>other</i>.
189
   * Performs a deep copy on <i>other</i>.
174
   */
190
   */
Line 193... Line 209...
193
    this.shoppingCartid = other.shoppingCartid;
209
    this.shoppingCartid = other.shoppingCartid;
194
    this.customer_id = other.customer_id;
210
    this.customer_id = other.customer_id;
195
    if (other.isSetCoupon_code()) {
211
    if (other.isSetCoupon_code()) {
196
      this.coupon_code = other.coupon_code;
212
      this.coupon_code = other.coupon_code;
197
    }
213
    }
-
 
214
    if (other.isSetSessionSource()) {
-
 
215
      this.sessionSource = other.sessionSource;
-
 
216
    }
-
 
217
    this.sessionStartTime = other.sessionStartTime;
198
  }
218
  }
199
 
219
 
200
  public Transaction deepCopy() {
220
  public Transaction deepCopy() {
201
    return new Transaction(this);
221
    return new Transaction(this);
202
  }
222
  }
Line 415... Line 435...
415
    if (!value) {
435
    if (!value) {
416
      this.coupon_code = null;
436
      this.coupon_code = null;
417
    }
437
    }
418
  }
438
  }
419
 
439
 
-
 
440
  public String getSessionSource() {
-
 
441
    return this.sessionSource;
-
 
442
  }
-
 
443
 
-
 
444
  public Transaction setSessionSource(String sessionSource) {
-
 
445
    this.sessionSource = sessionSource;
-
 
446
    return this;
-
 
447
  }
-
 
448
 
-
 
449
  public void unsetSessionSource() {
-
 
450
    this.sessionSource = null;
-
 
451
  }
-
 
452
 
-
 
453
  /** Returns true if field sessionSource is set (has been asigned a value) and false otherwise */
-
 
454
  public boolean isSetSessionSource() {
-
 
455
    return this.sessionSource != null;
-
 
456
  }
-
 
457
 
-
 
458
  public void setSessionSourceIsSet(boolean value) {
-
 
459
    if (!value) {
-
 
460
      this.sessionSource = null;
-
 
461
    }
-
 
462
  }
-
 
463
 
-
 
464
  public long getSessionStartTime() {
-
 
465
    return this.sessionStartTime;
-
 
466
  }
-
 
467
 
-
 
468
  public Transaction setSessionStartTime(long sessionStartTime) {
-
 
469
    this.sessionStartTime = sessionStartTime;
-
 
470
    setSessionStartTimeIsSet(true);
-
 
471
    return this;
-
 
472
  }
-
 
473
 
-
 
474
  public void unsetSessionStartTime() {
-
 
475
    __isset_bit_vector.clear(__SESSIONSTARTTIME_ISSET_ID);
-
 
476
  }
-
 
477
 
-
 
478
  /** Returns true if field sessionStartTime is set (has been asigned a value) and false otherwise */
-
 
479
  public boolean isSetSessionStartTime() {
-
 
480
    return __isset_bit_vector.get(__SESSIONSTARTTIME_ISSET_ID);
-
 
481
  }
-
 
482
 
-
 
483
  public void setSessionStartTimeIsSet(boolean value) {
-
 
484
    __isset_bit_vector.set(__SESSIONSTARTTIME_ISSET_ID, value);
-
 
485
  }
-
 
486
 
420
  public void setFieldValue(_Fields field, Object value) {
487
  public void setFieldValue(_Fields field, Object value) {
421
    switch (field) {
488
    switch (field) {
422
    case ID:
489
    case ID:
423
      if (value == null) {
490
      if (value == null) {
424
        unsetId();
491
        unsetId();
Line 481... Line 548...
481
      } else {
548
      } else {
482
        setCoupon_code((String)value);
549
        setCoupon_code((String)value);
483
      }
550
      }
484
      break;
551
      break;
485
 
552
 
-
 
553
    case SESSION_SOURCE:
-
 
554
      if (value == null) {
-
 
555
        unsetSessionSource();
-
 
556
      } else {
-
 
557
        setSessionSource((String)value);
-
 
558
      }
-
 
559
      break;
-
 
560
 
-
 
561
    case SESSION_START_TIME:
-
 
562
      if (value == null) {
-
 
563
        unsetSessionStartTime();
-
 
564
      } else {
-
 
565
        setSessionStartTime((Long)value);
-
 
566
      }
-
 
567
      break;
-
 
568
 
486
    }
569
    }
487
  }
570
  }
488
 
571
 
489
  public void setFieldValue(int fieldID, Object value) {
572
  public void setFieldValue(int fieldID, Object value) {
490
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
573
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
Line 514... Line 597...
514
      return new Long(getCustomer_id());
597
      return new Long(getCustomer_id());
515
 
598
 
516
    case COUPON_CODE:
599
    case COUPON_CODE:
517
      return getCoupon_code();
600
      return getCoupon_code();
518
 
601
 
-
 
602
    case SESSION_SOURCE:
-
 
603
      return getSessionSource();
-
 
604
 
-
 
605
    case SESSION_START_TIME:
-
 
606
      return new Long(getSessionStartTime());
-
 
607
 
519
    }
608
    }
520
    throw new IllegalStateException();
609
    throw new IllegalStateException();
521
  }
610
  }
522
 
611
 
523
  public Object getFieldValue(int fieldId) {
612
  public Object getFieldValue(int fieldId) {
Line 541... Line 630...
541
      return isSetShoppingCartid();
630
      return isSetShoppingCartid();
542
    case CUSTOMER_ID:
631
    case CUSTOMER_ID:
543
      return isSetCustomer_id();
632
      return isSetCustomer_id();
544
    case COUPON_CODE:
633
    case COUPON_CODE:
545
      return isSetCoupon_code();
634
      return isSetCoupon_code();
-
 
635
    case SESSION_SOURCE:
-
 
636
      return isSetSessionSource();
-
 
637
    case SESSION_START_TIME:
-
 
638
      return isSetSessionStartTime();
546
    }
639
    }
547
    throw new IllegalStateException();
640
    throw new IllegalStateException();
548
  }
641
  }
549
 
642
 
550
  public boolean isSet(int fieldID) {
643
  public boolean isSet(int fieldID) {
Line 634... Line 727...
634
        return false;
727
        return false;
635
      if (!this.coupon_code.equals(that.coupon_code))
728
      if (!this.coupon_code.equals(that.coupon_code))
636
        return false;
729
        return false;
637
    }
730
    }
638
 
731
 
-
 
732
    boolean this_present_sessionSource = true && this.isSetSessionSource();
-
 
733
    boolean that_present_sessionSource = true && that.isSetSessionSource();
-
 
734
    if (this_present_sessionSource || that_present_sessionSource) {
-
 
735
      if (!(this_present_sessionSource && that_present_sessionSource))
-
 
736
        return false;
-
 
737
      if (!this.sessionSource.equals(that.sessionSource))
-
 
738
        return false;
-
 
739
    }
-
 
740
 
-
 
741
    boolean this_present_sessionStartTime = true;
-
 
742
    boolean that_present_sessionStartTime = true;
-
 
743
    if (this_present_sessionStartTime || that_present_sessionStartTime) {
-
 
744
      if (!(this_present_sessionStartTime && that_present_sessionStartTime))
-
 
745
        return false;
-
 
746
      if (this.sessionStartTime != that.sessionStartTime)
-
 
747
        return false;
-
 
748
    }
-
 
749
 
639
    return true;
750
    return true;
640
  }
751
  }
641
 
752
 
642
  @Override
753
  @Override
643
  public int hashCode() {
754
  public int hashCode() {
Line 714... Line 825...
714
    }
825
    }
715
    lastComparison = TBaseHelper.compareTo(coupon_code, typedOther.coupon_code);
826
    lastComparison = TBaseHelper.compareTo(coupon_code, typedOther.coupon_code);
716
    if (lastComparison != 0) {
827
    if (lastComparison != 0) {
717
      return lastComparison;
828
      return lastComparison;
718
    }
829
    }
-
 
830
    lastComparison = Boolean.valueOf(isSetSessionSource()).compareTo(isSetSessionSource());
-
 
831
    if (lastComparison != 0) {
-
 
832
      return lastComparison;
-
 
833
    }
-
 
834
    lastComparison = TBaseHelper.compareTo(sessionSource, typedOther.sessionSource);
-
 
835
    if (lastComparison != 0) {
-
 
836
      return lastComparison;
-
 
837
    }
-
 
838
    lastComparison = Boolean.valueOf(isSetSessionStartTime()).compareTo(isSetSessionStartTime());
-
 
839
    if (lastComparison != 0) {
-
 
840
      return lastComparison;
-
 
841
    }
-
 
842
    lastComparison = TBaseHelper.compareTo(sessionStartTime, typedOther.sessionStartTime);
-
 
843
    if (lastComparison != 0) {
-
 
844
      return lastComparison;
-
 
845
    }
719
    return 0;
846
    return 0;
720
  }
847
  }
721
 
848
 
722
  public void read(TProtocol iprot) throws TException {
849
  public void read(TProtocol iprot) throws TException {
723
    TField field;
850
    TField field;
Line 802... Line 929...
802
              this.coupon_code = iprot.readString();
929
              this.coupon_code = iprot.readString();
803
            } else { 
930
            } else { 
804
              TProtocolUtil.skip(iprot, field.type);
931
              TProtocolUtil.skip(iprot, field.type);
805
            }
932
            }
806
            break;
933
            break;
-
 
934
          case SESSION_SOURCE:
-
 
935
            if (field.type == TType.STRING) {
-
 
936
              this.sessionSource = iprot.readString();
-
 
937
            } else { 
-
 
938
              TProtocolUtil.skip(iprot, field.type);
-
 
939
            }
-
 
940
            break;
-
 
941
          case SESSION_START_TIME:
-
 
942
            if (field.type == TType.I64) {
-
 
943
              this.sessionStartTime = iprot.readI64();
-
 
944
              setSessionStartTimeIsSet(true);
-
 
945
            } else { 
-
 
946
              TProtocolUtil.skip(iprot, field.type);
-
 
947
            }
-
 
948
            break;
807
        }
949
        }
808
        iprot.readFieldEnd();
950
        iprot.readFieldEnd();
809
      }
951
      }
810
    }
952
    }
811
    iprot.readStructEnd();
953
    iprot.readStructEnd();
Line 853... Line 995...
853
    if (this.coupon_code != null) {
995
    if (this.coupon_code != null) {
854
      oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
996
      oprot.writeFieldBegin(COUPON_CODE_FIELD_DESC);
855
      oprot.writeString(this.coupon_code);
997
      oprot.writeString(this.coupon_code);
856
      oprot.writeFieldEnd();
998
      oprot.writeFieldEnd();
857
    }
999
    }
-
 
1000
    if (this.sessionSource != null) {
-
 
1001
      oprot.writeFieldBegin(SESSION_SOURCE_FIELD_DESC);
-
 
1002
      oprot.writeString(this.sessionSource);
-
 
1003
      oprot.writeFieldEnd();
-
 
1004
    }
-
 
1005
    oprot.writeFieldBegin(SESSION_START_TIME_FIELD_DESC);
-
 
1006
    oprot.writeI64(this.sessionStartTime);
-
 
1007
    oprot.writeFieldEnd();
858
    oprot.writeFieldStop();
1008
    oprot.writeFieldStop();
859
    oprot.writeStructEnd();
1009
    oprot.writeStructEnd();
860
  }
1010
  }
861
 
1011
 
862
  @Override
1012
  @Override
Line 917... Line 1067...
917
      sb.append("null");
1067
      sb.append("null");
918
    } else {
1068
    } else {
919
      sb.append(this.coupon_code);
1069
      sb.append(this.coupon_code);
920
    }
1070
    }
921
    first = false;
1071
    first = false;
-
 
1072
    if (!first) sb.append(", ");
-
 
1073
    sb.append("sessionSource:");
-
 
1074
    if (this.sessionSource == null) {
-
 
1075
      sb.append("null");
-
 
1076
    } else {
-
 
1077
      sb.append(this.sessionSource);
-
 
1078
    }
-
 
1079
    first = false;
-
 
1080
    if (!first) sb.append(", ");
-
 
1081
    sb.append("sessionStartTime:");
-
 
1082
    sb.append(this.sessionStartTime);
-
 
1083
    first = false;
922
    sb.append(")");
1084
    sb.append(")");
923
    return sb.toString();
1085
    return sb.toString();
924
  }
1086
  }
925
 
1087
 
926
  public void validate() throws TException {
1088
  public void validate() throws TException {