Subversion Repositories SmartDukaan

Rev

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

Rev 123 Rev 130
Line 39... Line 39...
39
  private static final TField IS_SMSVERIFIED_FIELD_DESC = new TField("isSMSVerified", TType.BOOL, (short)7);
39
  private static final TField IS_SMSVERIFIED_FIELD_DESC = new TField("isSMSVerified", TType.BOOL, (short)7);
40
  private static final TField ACTIVE_SINCE_FIELD_DESC = new TField("activeSince", TType.I64, (short)8);
40
  private static final TField ACTIVE_SINCE_FIELD_DESC = new TField("activeSince", TType.I64, (short)8);
41
  private static final TField IS_LOGGED_IN_FIELD_DESC = new TField("isLoggedIn", TType.BOOL, (short)9);
41
  private static final TField IS_LOGGED_IN_FIELD_DESC = new TField("isLoggedIn", TType.BOOL, (short)9);
42
  private static final TField IPS_FIELD_DESC = new TField("ips", TType.LIST, (short)10);
42
  private static final TField IPS_FIELD_DESC = new TField("ips", TType.LIST, (short)10);
43
  private static final TField SHOPPING_CART_HANDLE_FIELD_DESC = new TField("shoppingCartHandle", TType.I64, (short)11);
43
  private static final TField SHOPPING_CART_HANDLE_FIELD_DESC = new TField("shoppingCartHandle", TType.I64, (short)11);
-
 
44
  private static final TField STATUS_FIELD_DESC = new TField("status", TType.I32, (short)12);
44
 
45
 
45
  private long userId;
46
  private long userId;
46
  private boolean isEmailVerified;
47
  private boolean isEmailVerified;
47
  private long lastLogin;
48
  private long lastLogin;
48
  private long lastLogout;
49
  private long lastLogout;
Line 51... Line 52...
51
  private boolean isSMSVerified;
52
  private boolean isSMSVerified;
52
  private long activeSince;
53
  private long activeSince;
53
  private boolean isLoggedIn;
54
  private boolean isLoggedIn;
54
  private List<IPMap> ips;
55
  private List<IPMap> ips;
55
  private long shoppingCartHandle;
56
  private long shoppingCartHandle;
-
 
57
  private AccountStatus status;
56
 
58
 
57
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
59
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
58
  public enum _Fields implements TFieldIdEnum {
60
  public enum _Fields implements TFieldIdEnum {
59
    USER_ID((short)1, "userId"),
61
    USER_ID((short)1, "userId"),
60
    IS_EMAIL_VERIFIED((short)2, "isEmailVerified"),
62
    IS_EMAIL_VERIFIED((short)2, "isEmailVerified"),
Line 64... Line 66...
64
    SMS_VERIFICATION_SENT_ON((short)6, "smsVerificationSentOn"),
66
    SMS_VERIFICATION_SENT_ON((short)6, "smsVerificationSentOn"),
65
    IS_SMSVERIFIED((short)7, "isSMSVerified"),
67
    IS_SMSVERIFIED((short)7, "isSMSVerified"),
66
    ACTIVE_SINCE((short)8, "activeSince"),
68
    ACTIVE_SINCE((short)8, "activeSince"),
67
    IS_LOGGED_IN((short)9, "isLoggedIn"),
69
    IS_LOGGED_IN((short)9, "isLoggedIn"),
68
    IPS((short)10, "ips"),
70
    IPS((short)10, "ips"),
69
    SHOPPING_CART_HANDLE((short)11, "shoppingCartHandle");
71
    SHOPPING_CART_HANDLE((short)11, "shoppingCartHandle"),
-
 
72
    /**
-
 
73
     * 
-
 
74
     * @see AccountStatus
-
 
75
     */
-
 
76
    STATUS((short)12, "status");
70
 
77
 
71
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
78
    private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
72
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
79
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
73
 
80
 
74
    static {
81
    static {
Line 154... Line 161...
154
    put(_Fields.IPS, new FieldMetaData("ips", TFieldRequirementType.DEFAULT, 
161
    put(_Fields.IPS, new FieldMetaData("ips", TFieldRequirementType.DEFAULT, 
155
        new ListMetaData(TType.LIST, 
162
        new ListMetaData(TType.LIST, 
156
            new StructMetaData(TType.STRUCT, IPMap.class))));
163
            new StructMetaData(TType.STRUCT, IPMap.class))));
157
    put(_Fields.SHOPPING_CART_HANDLE, new FieldMetaData("shoppingCartHandle", TFieldRequirementType.DEFAULT, 
164
    put(_Fields.SHOPPING_CART_HANDLE, new FieldMetaData("shoppingCartHandle", TFieldRequirementType.DEFAULT, 
158
        new FieldValueMetaData(TType.I64)));
165
        new FieldValueMetaData(TType.I64)));
-
 
166
    put(_Fields.STATUS, new FieldMetaData("status", TFieldRequirementType.DEFAULT, 
-
 
167
        new EnumMetaData(TType.ENUM, AccountStatus.class)));
159
  }});
168
  }});
160
 
169
 
161
  static {
170
  static {
162
    FieldMetaData.addStructMetaDataMap(UserState.class, metaDataMap);
171
    FieldMetaData.addStructMetaDataMap(UserState.class, metaDataMap);
163
  }
172
  }
Line 174... Line 183...
174
    long smsVerificationSentOn,
183
    long smsVerificationSentOn,
175
    boolean isSMSVerified,
184
    boolean isSMSVerified,
176
    long activeSince,
185
    long activeSince,
177
    boolean isLoggedIn,
186
    boolean isLoggedIn,
178
    List<IPMap> ips,
187
    List<IPMap> ips,
179
    long shoppingCartHandle)
188
    long shoppingCartHandle,
-
 
189
    AccountStatus status)
180
  {
190
  {
181
    this();
191
    this();
182
    this.userId = userId;
192
    this.userId = userId;
183
    setUserIdIsSet(true);
193
    setUserIdIsSet(true);
184
    this.isEmailVerified = isEmailVerified;
194
    this.isEmailVerified = isEmailVerified;
Line 198... Line 208...
198
    this.isLoggedIn = isLoggedIn;
208
    this.isLoggedIn = isLoggedIn;
199
    setIsLoggedInIsSet(true);
209
    setIsLoggedInIsSet(true);
200
    this.ips = ips;
210
    this.ips = ips;
201
    this.shoppingCartHandle = shoppingCartHandle;
211
    this.shoppingCartHandle = shoppingCartHandle;
202
    setShoppingCartHandleIsSet(true);
212
    setShoppingCartHandleIsSet(true);
-
 
213
    this.status = status;
203
  }
214
  }
204
 
215
 
205
  /**
216
  /**
206
   * Performs a deep copy on <i>other</i>.
217
   * Performs a deep copy on <i>other</i>.
207
   */
218
   */
Line 223... Line 234...
223
        __this__ips.add(new IPMap(other_element));
234
        __this__ips.add(new IPMap(other_element));
224
      }
235
      }
225
      this.ips = __this__ips;
236
      this.ips = __this__ips;
226
    }
237
    }
227
    this.shoppingCartHandle = other.shoppingCartHandle;
238
    this.shoppingCartHandle = other.shoppingCartHandle;
-
 
239
    if (other.isSetStatus()) {
-
 
240
      this.status = other.status;
-
 
241
    }
228
  }
242
  }
229
 
243
 
230
  public UserState deepCopy() {
244
  public UserState deepCopy() {
231
    return new UserState(this);
245
    return new UserState(this);
232
  }
246
  }
Line 503... Line 517...
503
 
517
 
504
  public void setShoppingCartHandleIsSet(boolean value) {
518
  public void setShoppingCartHandleIsSet(boolean value) {
505
    __isset_bit_vector.set(__SHOPPINGCARTHANDLE_ISSET_ID, value);
519
    __isset_bit_vector.set(__SHOPPINGCARTHANDLE_ISSET_ID, value);
506
  }
520
  }
507
 
521
 
-
 
522
  /**
-
 
523
   * 
-
 
524
   * @see AccountStatus
-
 
525
   */
-
 
526
  public AccountStatus getStatus() {
-
 
527
    return this.status;
-
 
528
  }
-
 
529
 
-
 
530
  /**
-
 
531
   * 
-
 
532
   * @see AccountStatus
-
 
533
   */
-
 
534
  public UserState setStatus(AccountStatus status) {
-
 
535
    this.status = status;
-
 
536
    return this;
-
 
537
  }
-
 
538
 
-
 
539
  public void unsetStatus() {
-
 
540
    this.status = null;
-
 
541
  }
-
 
542
 
-
 
543
  /** Returns true if field status is set (has been asigned a value) and false otherwise */
-
 
544
  public boolean isSetStatus() {
-
 
545
    return this.status != null;
-
 
546
  }
-
 
547
 
-
 
548
  public void setStatusIsSet(boolean value) {
-
 
549
    if (!value) {
-
 
550
      this.status = null;
-
 
551
    }
-
 
552
  }
-
 
553
 
508
  public void setFieldValue(_Fields field, Object value) {
554
  public void setFieldValue(_Fields field, Object value) {
509
    switch (field) {
555
    switch (field) {
510
    case USER_ID:
556
    case USER_ID:
511
      if (value == null) {
557
      if (value == null) {
512
        unsetUserId();
558
        unsetUserId();
Line 593... Line 639...
593
      } else {
639
      } else {
594
        setShoppingCartHandle((Long)value);
640
        setShoppingCartHandle((Long)value);
595
      }
641
      }
596
      break;
642
      break;
597
 
643
 
-
 
644
    case STATUS:
-
 
645
      if (value == null) {
-
 
646
        unsetStatus();
-
 
647
      } else {
-
 
648
        setStatus((AccountStatus)value);
-
 
649
      }
-
 
650
      break;
-
 
651
 
598
    }
652
    }
599
  }
653
  }
600
 
654
 
601
  public void setFieldValue(int fieldID, Object value) {
655
  public void setFieldValue(int fieldID, Object value) {
602
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
656
    setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
Line 635... Line 689...
635
      return getIps();
689
      return getIps();
636
 
690
 
637
    case SHOPPING_CART_HANDLE:
691
    case SHOPPING_CART_HANDLE:
638
      return new Long(getShoppingCartHandle());
692
      return new Long(getShoppingCartHandle());
639
 
693
 
-
 
694
    case STATUS:
-
 
695
      return getStatus();
-
 
696
 
640
    }
697
    }
641
    throw new IllegalStateException();
698
    throw new IllegalStateException();
642
  }
699
  }
643
 
700
 
644
  public Object getFieldValue(int fieldId) {
701
  public Object getFieldValue(int fieldId) {
Line 668... Line 725...
668
      return isSetIsLoggedIn();
725
      return isSetIsLoggedIn();
669
    case IPS:
726
    case IPS:
670
      return isSetIps();
727
      return isSetIps();
671
    case SHOPPING_CART_HANDLE:
728
    case SHOPPING_CART_HANDLE:
672
      return isSetShoppingCartHandle();
729
      return isSetShoppingCartHandle();
-
 
730
    case STATUS:
-
 
731
      return isSetStatus();
673
    }
732
    }
674
    throw new IllegalStateException();
733
    throw new IllegalStateException();
675
  }
734
  }
676
 
735
 
677
  public boolean isSet(int fieldID) {
736
  public boolean isSet(int fieldID) {
Line 788... Line 847...
788
        return false;
847
        return false;
789
      if (this.shoppingCartHandle != that.shoppingCartHandle)
848
      if (this.shoppingCartHandle != that.shoppingCartHandle)
790
        return false;
849
        return false;
791
    }
850
    }
792
 
851
 
-
 
852
    boolean this_present_status = true && this.isSetStatus();
-
 
853
    boolean that_present_status = true && that.isSetStatus();
-
 
854
    if (this_present_status || that_present_status) {
-
 
855
      if (!(this_present_status && that_present_status))
-
 
856
        return false;
-
 
857
      if (!this.status.equals(that.status))
-
 
858
        return false;
-
 
859
    }
-
 
860
 
793
    return true;
861
    return true;
794
  }
862
  }
795
 
863
 
796
  @Override
864
  @Override
797
  public int hashCode() {
865
  public int hashCode() {
Line 892... Line 960...
892
    }
960
    }
893
    lastComparison = TBaseHelper.compareTo(shoppingCartHandle, typedOther.shoppingCartHandle);
961
    lastComparison = TBaseHelper.compareTo(shoppingCartHandle, typedOther.shoppingCartHandle);
894
    if (lastComparison != 0) {
962
    if (lastComparison != 0) {
895
      return lastComparison;
963
      return lastComparison;
896
    }
964
    }
-
 
965
    lastComparison = Boolean.valueOf(isSetStatus()).compareTo(isSetStatus());
-
 
966
    if (lastComparison != 0) {
-
 
967
      return lastComparison;
-
 
968
    }
-
 
969
    lastComparison = TBaseHelper.compareTo(status, typedOther.status);
-
 
970
    if (lastComparison != 0) {
-
 
971
      return lastComparison;
-
 
972
    }
897
    return 0;
973
    return 0;
898
  }
974
  }
899
 
975
 
900
  public void read(TProtocol iprot) throws TException {
976
  public void read(TProtocol iprot) throws TException {
901
    TField field;
977
    TField field;
Line 984... Line 1060...
984
            }
1060
            }
985
            break;
1061
            break;
986
          case IPS:
1062
          case IPS:
987
            if (field.type == TType.LIST) {
1063
            if (field.type == TType.LIST) {
988
              {
1064
              {
989
                TList _list4 = iprot.readListBegin();
1065
                TList _list8 = iprot.readListBegin();
990
                this.ips = new ArrayList<IPMap>(_list4.size);
1066
                this.ips = new ArrayList<IPMap>(_list8.size);
991
                for (int _i5 = 0; _i5 < _list4.size; ++_i5)
1067
                for (int _i9 = 0; _i9 < _list8.size; ++_i9)
992
                {
1068
                {
993
                  IPMap _elem6;
1069
                  IPMap _elem10;
994
                  _elem6 = new IPMap();
1070
                  _elem10 = new IPMap();
995
                  _elem6.read(iprot);
1071
                  _elem10.read(iprot);
996
                  this.ips.add(_elem6);
1072
                  this.ips.add(_elem10);
997
                }
1073
                }
998
                iprot.readListEnd();
1074
                iprot.readListEnd();
999
              }
1075
              }
1000
            } else { 
1076
            } else { 
1001
              TProtocolUtil.skip(iprot, field.type);
1077
              TProtocolUtil.skip(iprot, field.type);
Line 1007... Line 1083...
1007
              setShoppingCartHandleIsSet(true);
1083
              setShoppingCartHandleIsSet(true);
1008
            } else { 
1084
            } else { 
1009
              TProtocolUtil.skip(iprot, field.type);
1085
              TProtocolUtil.skip(iprot, field.type);
1010
            }
1086
            }
1011
            break;
1087
            break;
-
 
1088
          case STATUS:
-
 
1089
            if (field.type == TType.I32) {
-
 
1090
              this.status = AccountStatus.findByValue(iprot.readI32());
-
 
1091
            } else { 
-
 
1092
              TProtocolUtil.skip(iprot, field.type);
-
 
1093
            }
-
 
1094
            break;
1012
        }
1095
        }
1013
        iprot.readFieldEnd();
1096
        iprot.readFieldEnd();
1014
      }
1097
      }
1015
    }
1098
    }
1016
    iprot.readStructEnd();
1099
    iprot.readStructEnd();
Line 1050... Line 1133...
1050
    oprot.writeFieldEnd();
1133
    oprot.writeFieldEnd();
1051
    if (this.ips != null) {
1134
    if (this.ips != null) {
1052
      oprot.writeFieldBegin(IPS_FIELD_DESC);
1135
      oprot.writeFieldBegin(IPS_FIELD_DESC);
1053
      {
1136
      {
1054
        oprot.writeListBegin(new TList(TType.STRUCT, this.ips.size()));
1137
        oprot.writeListBegin(new TList(TType.STRUCT, this.ips.size()));
1055
        for (IPMap _iter7 : this.ips)
1138
        for (IPMap _iter11 : this.ips)
1056
        {
1139
        {
1057
          _iter7.write(oprot);
1140
          _iter11.write(oprot);
1058
        }
1141
        }
1059
        oprot.writeListEnd();
1142
        oprot.writeListEnd();
1060
      }
1143
      }
1061
      oprot.writeFieldEnd();
1144
      oprot.writeFieldEnd();
1062
    }
1145
    }
1063
    oprot.writeFieldBegin(SHOPPING_CART_HANDLE_FIELD_DESC);
1146
    oprot.writeFieldBegin(SHOPPING_CART_HANDLE_FIELD_DESC);
1064
    oprot.writeI64(this.shoppingCartHandle);
1147
    oprot.writeI64(this.shoppingCartHandle);
1065
    oprot.writeFieldEnd();
1148
    oprot.writeFieldEnd();
-
 
1149
    if (this.status != null) {
-
 
1150
      oprot.writeFieldBegin(STATUS_FIELD_DESC);
-
 
1151
      oprot.writeI32(this.status.getValue());
-
 
1152
      oprot.writeFieldEnd();
-
 
1153
    }
1066
    oprot.writeFieldStop();
1154
    oprot.writeFieldStop();
1067
    oprot.writeStructEnd();
1155
    oprot.writeStructEnd();
1068
  }
1156
  }
1069
 
1157
 
1070
  @Override
1158
  @Override
Line 1117... Line 1205...
1117
    first = false;
1205
    first = false;
1118
    if (!first) sb.append(", ");
1206
    if (!first) sb.append(", ");
1119
    sb.append("shoppingCartHandle:");
1207
    sb.append("shoppingCartHandle:");
1120
    sb.append(this.shoppingCartHandle);
1208
    sb.append(this.shoppingCartHandle);
1121
    first = false;
1209
    first = false;
-
 
1210
    if (!first) sb.append(", ");
-
 
1211
    sb.append("status:");
-
 
1212
    if (this.status == null) {
-
 
1213
      sb.append("null");
-
 
1214
    } else {
-
 
1215
      String status_name = status.name();
-
 
1216
      if (status_name != null) {
-
 
1217
        sb.append(status_name);
-
 
1218
        sb.append(" (");
-
 
1219
      }
-
 
1220
      sb.append(this.status);
-
 
1221
      if (status_name != null) {
-
 
1222
        sb.append(")");
-
 
1223
      }
-
 
1224
    }
-
 
1225
    first = false;
1122
    sb.append(")");
1226
    sb.append(")");
1123
    return sb.toString();
1227
    return sb.toString();
1124
  }
1228
  }
1125
 
1229
 
1126
  public void validate() throws TException {
1230
  public void validate() throws TException {