Subversion Repositories SmartDukaan

Rev

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

Rev 130 Rev 506
Line 56... Line 56...
56
 
56
 
57
    public boolean setUserAsLoggedIn(long userId, long timestamp) throws UserContextException, TException;
57
    public boolean setUserAsLoggedIn(long userId, long timestamp) throws UserContextException, TException;
58
 
58
 
59
    public boolean setUserAsLoggedOut(long userid, long timestamp) throws UserContextException, TException;
59
    public boolean setUserAsLoggedOut(long userid, long timestamp) throws UserContextException, TException;
60
 
60
 
-
 
61
    public boolean setDefaultAddress(long userid, long addressId) throws UserContextException, TException;
-
 
62
 
61
    public boolean updatePassword(long userid, String password) throws UserContextException, TException;
63
    public boolean updatePassword(long userid, String password) throws UserContextException, TException;
62
 
64
 
63
    public boolean deleteUser(long userid, boolean isSessionId) throws UserContextException, TException;
65
    public boolean deleteUser(long userid, boolean isSessionId) throws UserContextException, TException;
64
 
66
 
65
    public boolean sendEmailVerification(long userid) throws UserContextException, TException;
67
    public boolean sendEmailVerification(long userid) throws UserContextException, TException;
Line 623... Line 625...
623
        throw result.ucx;
625
        throw result.ucx;
624
      }
626
      }
625
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "setUserAsLoggedOut failed: unknown result");
627
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "setUserAsLoggedOut failed: unknown result");
626
    }
628
    }
627
 
629
 
-
 
630
    public boolean setDefaultAddress(long userid, long addressId) throws UserContextException, TException
-
 
631
    {
-
 
632
      send_setDefaultAddress(userid, addressId);
-
 
633
      return recv_setDefaultAddress();
-
 
634
    }
-
 
635
 
-
 
636
    public void send_setDefaultAddress(long userid, long addressId) throws TException
-
 
637
    {
-
 
638
      oprot_.writeMessageBegin(new TMessage("setDefaultAddress", TMessageType.CALL, seqid_));
-
 
639
      setDefaultAddress_args args = new setDefaultAddress_args();
-
 
640
      args.userid = userid;
-
 
641
      args.addressId = addressId;
-
 
642
      args.write(oprot_);
-
 
643
      oprot_.writeMessageEnd();
-
 
644
      oprot_.getTransport().flush();
-
 
645
    }
-
 
646
 
-
 
647
    public boolean recv_setDefaultAddress() throws UserContextException, TException
-
 
648
    {
-
 
649
      TMessage msg = iprot_.readMessageBegin();
-
 
650
      if (msg.type == TMessageType.EXCEPTION) {
-
 
651
        TApplicationException x = TApplicationException.read(iprot_);
-
 
652
        iprot_.readMessageEnd();
-
 
653
        throw x;
-
 
654
      }
-
 
655
      setDefaultAddress_result result = new setDefaultAddress_result();
-
 
656
      result.read(iprot_);
-
 
657
      iprot_.readMessageEnd();
-
 
658
      if (result.isSetSuccess()) {
-
 
659
        return result.success;
-
 
660
      }
-
 
661
      if (result.ucx != null) {
-
 
662
        throw result.ucx;
-
 
663
      }
-
 
664
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "setDefaultAddress failed: unknown result");
-
 
665
    }
-
 
666
 
628
    public boolean updatePassword(long userid, String password) throws UserContextException, TException
667
    public boolean updatePassword(long userid, String password) throws UserContextException, TException
629
    {
668
    {
630
      send_updatePassword(userid, password);
669
      send_updatePassword(userid, password);
631
      return recv_updatePassword();
670
      return recv_updatePassword();
632
    }
671
    }
Line 972... Line 1011...
972
      processMap_.put("addIpAdressForUser", new addIpAdressForUser());
1011
      processMap_.put("addIpAdressForUser", new addIpAdressForUser());
973
      processMap_.put("addAddressForUser", new addAddressForUser());
1012
      processMap_.put("addAddressForUser", new addAddressForUser());
974
      processMap_.put("removeAddressForUser", new removeAddressForUser());
1013
      processMap_.put("removeAddressForUser", new removeAddressForUser());
975
      processMap_.put("setUserAsLoggedIn", new setUserAsLoggedIn());
1014
      processMap_.put("setUserAsLoggedIn", new setUserAsLoggedIn());
976
      processMap_.put("setUserAsLoggedOut", new setUserAsLoggedOut());
1015
      processMap_.put("setUserAsLoggedOut", new setUserAsLoggedOut());
-
 
1016
      processMap_.put("setDefaultAddress", new setDefaultAddress());
977
      processMap_.put("updatePassword", new updatePassword());
1017
      processMap_.put("updatePassword", new updatePassword());
978
      processMap_.put("deleteUser", new deleteUser());
1018
      processMap_.put("deleteUser", new deleteUser());
979
      processMap_.put("sendEmailVerification", new sendEmailVerification());
1019
      processMap_.put("sendEmailVerification", new sendEmailVerification());
980
      processMap_.put("sendSMSVerification", new sendSMSVerification());
1020
      processMap_.put("sendSMSVerification", new sendSMSVerification());
981
      processMap_.put("confirmEmailVerification", new confirmEmailVerification());
1021
      processMap_.put("confirmEmailVerification", new confirmEmailVerification());
Line 1407... Line 1447...
1407
        oprot.getTransport().flush();
1447
        oprot.getTransport().flush();
1408
      }
1448
      }
1409
 
1449
 
1410
    }
1450
    }
1411
 
1451
 
-
 
1452
    private class setDefaultAddress implements ProcessFunction {
-
 
1453
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
-
 
1454
      {
-
 
1455
        setDefaultAddress_args args = new setDefaultAddress_args();
-
 
1456
        args.read(iprot);
-
 
1457
        iprot.readMessageEnd();
-
 
1458
        setDefaultAddress_result result = new setDefaultAddress_result();
-
 
1459
        try {
-
 
1460
          result.success = iface_.setDefaultAddress(args.userid, args.addressId);
-
 
1461
          result.setSuccessIsSet(true);
-
 
1462
        } catch (UserContextException ucx) {
-
 
1463
          result.ucx = ucx;
-
 
1464
        } catch (Throwable th) {
-
 
1465
          LOGGER.error("Internal error processing setDefaultAddress", th);
-
 
1466
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing setDefaultAddress");
-
 
1467
          oprot.writeMessageBegin(new TMessage("setDefaultAddress", TMessageType.EXCEPTION, seqid));
-
 
1468
          x.write(oprot);
-
 
1469
          oprot.writeMessageEnd();
-
 
1470
          oprot.getTransport().flush();
-
 
1471
          return;
-
 
1472
        }
-
 
1473
        oprot.writeMessageBegin(new TMessage("setDefaultAddress", TMessageType.REPLY, seqid));
-
 
1474
        result.write(oprot);
-
 
1475
        oprot.writeMessageEnd();
-
 
1476
        oprot.getTransport().flush();
-
 
1477
      }
-
 
1478
 
-
 
1479
    }
-
 
1480
 
1412
    private class updatePassword implements ProcessFunction {
1481
    private class updatePassword implements ProcessFunction {
1413
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
1482
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
1414
      {
1483
      {
1415
        updatePassword_args args = new updatePassword_args();
1484
        updatePassword_args args = new updatePassword_args();
1416
        args.read(iprot);
1485
        args.read(iprot);
Line 11776... Line 11845...
11776
      boolean first = true;
11845
      boolean first = true;
11777
 
11846
 
11778
      sb.append("success:");
11847
      sb.append("success:");
11779
      sb.append(this.success);
11848
      sb.append(this.success);
11780
      first = false;
11849
      first = false;
-
 
11850
      if (!first) sb.append(", ");
-
 
11851
      sb.append("ucx:");
-
 
11852
      if (this.ucx == null) {
-
 
11853
        sb.append("null");
-
 
11854
      } else {
-
 
11855
        sb.append(this.ucx);
-
 
11856
      }
-
 
11857
      first = false;
-
 
11858
      sb.append(")");
-
 
11859
      return sb.toString();
-
 
11860
    }
-
 
11861
 
-
 
11862
    public void validate() throws TException {
-
 
11863
      // check for required fields
-
 
11864
    }
-
 
11865
 
-
 
11866
  }
-
 
11867
 
-
 
11868
  public static class setDefaultAddress_args implements TBase<setDefaultAddress_args._Fields>, java.io.Serializable, Cloneable, Comparable<setDefaultAddress_args>   {
-
 
11869
    private static final TStruct STRUCT_DESC = new TStruct("setDefaultAddress_args");
-
 
11870
 
-
 
11871
    private static final TField USERID_FIELD_DESC = new TField("userid", TType.I64, (short)1);
-
 
11872
    private static final TField ADDRESS_ID_FIELD_DESC = new TField("addressId", TType.I64, (short)2);
-
 
11873
 
-
 
11874
    private long userid;
-
 
11875
    private long addressId;
-
 
11876
 
-
 
11877
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-
 
11878
    public enum _Fields implements TFieldIdEnum {
-
 
11879
      USERID((short)1, "userid"),
-
 
11880
      ADDRESS_ID((short)2, "addressId");
-
 
11881
 
-
 
11882
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
-
 
11883
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
 
11884
 
-
 
11885
      static {
-
 
11886
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-
 
11887
          byId.put((int)field._thriftId, field);
-
 
11888
          byName.put(field.getFieldName(), field);
-
 
11889
        }
-
 
11890
      }
-
 
11891
 
-
 
11892
      /**
-
 
11893
       * Find the _Fields constant that matches fieldId, or null if its not found.
-
 
11894
       */
-
 
11895
      public static _Fields findByThriftId(int fieldId) {
-
 
11896
        return byId.get(fieldId);
-
 
11897
      }
-
 
11898
 
-
 
11899
      /**
-
 
11900
       * Find the _Fields constant that matches fieldId, throwing an exception
-
 
11901
       * if it is not found.
-
 
11902
       */
-
 
11903
      public static _Fields findByThriftIdOrThrow(int fieldId) {
-
 
11904
        _Fields fields = findByThriftId(fieldId);
-
 
11905
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-
 
11906
        return fields;
-
 
11907
      }
-
 
11908
 
-
 
11909
      /**
-
 
11910
       * Find the _Fields constant that matches name, or null if its not found.
-
 
11911
       */
-
 
11912
      public static _Fields findByName(String name) {
-
 
11913
        return byName.get(name);
-
 
11914
      }
-
 
11915
 
-
 
11916
      private final short _thriftId;
-
 
11917
      private final String _fieldName;
-
 
11918
 
-
 
11919
      _Fields(short thriftId, String fieldName) {
-
 
11920
        _thriftId = thriftId;
-
 
11921
        _fieldName = fieldName;
-
 
11922
      }
-
 
11923
 
-
 
11924
      public short getThriftFieldId() {
-
 
11925
        return _thriftId;
-
 
11926
      }
-
 
11927
 
-
 
11928
      public String getFieldName() {
-
 
11929
        return _fieldName;
-
 
11930
      }
-
 
11931
    }
-
 
11932
 
-
 
11933
    // isset id assignments
-
 
11934
    private static final int __USERID_ISSET_ID = 0;
-
 
11935
    private static final int __ADDRESSID_ISSET_ID = 1;
-
 
11936
    private BitSet __isset_bit_vector = new BitSet(2);
-
 
11937
 
-
 
11938
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
-
 
11939
      put(_Fields.USERID, new FieldMetaData("userid", TFieldRequirementType.DEFAULT, 
-
 
11940
          new FieldValueMetaData(TType.I64)));
-
 
11941
      put(_Fields.ADDRESS_ID, new FieldMetaData("addressId", TFieldRequirementType.DEFAULT, 
-
 
11942
          new FieldValueMetaData(TType.I64)));
-
 
11943
    }});
-
 
11944
 
-
 
11945
    static {
-
 
11946
      FieldMetaData.addStructMetaDataMap(setDefaultAddress_args.class, metaDataMap);
-
 
11947
    }
-
 
11948
 
-
 
11949
    public setDefaultAddress_args() {
-
 
11950
    }
-
 
11951
 
-
 
11952
    public setDefaultAddress_args(
-
 
11953
      long userid,
-
 
11954
      long addressId)
-
 
11955
    {
-
 
11956
      this();
-
 
11957
      this.userid = userid;
-
 
11958
      setUseridIsSet(true);
-
 
11959
      this.addressId = addressId;
-
 
11960
      setAddressIdIsSet(true);
-
 
11961
    }
-
 
11962
 
-
 
11963
    /**
-
 
11964
     * Performs a deep copy on <i>other</i>.
-
 
11965
     */
-
 
11966
    public setDefaultAddress_args(setDefaultAddress_args other) {
-
 
11967
      __isset_bit_vector.clear();
-
 
11968
      __isset_bit_vector.or(other.__isset_bit_vector);
-
 
11969
      this.userid = other.userid;
-
 
11970
      this.addressId = other.addressId;
-
 
11971
    }
-
 
11972
 
-
 
11973
    public setDefaultAddress_args deepCopy() {
-
 
11974
      return new setDefaultAddress_args(this);
-
 
11975
    }
-
 
11976
 
-
 
11977
    @Deprecated
-
 
11978
    public setDefaultAddress_args clone() {
-
 
11979
      return new setDefaultAddress_args(this);
-
 
11980
    }
-
 
11981
 
-
 
11982
    public long getUserid() {
-
 
11983
      return this.userid;
-
 
11984
    }
-
 
11985
 
-
 
11986
    public setDefaultAddress_args setUserid(long userid) {
-
 
11987
      this.userid = userid;
-
 
11988
      setUseridIsSet(true);
-
 
11989
      return this;
-
 
11990
    }
-
 
11991
 
-
 
11992
    public void unsetUserid() {
-
 
11993
      __isset_bit_vector.clear(__USERID_ISSET_ID);
-
 
11994
    }
-
 
11995
 
-
 
11996
    /** Returns true if field userid is set (has been asigned a value) and false otherwise */
-
 
11997
    public boolean isSetUserid() {
-
 
11998
      return __isset_bit_vector.get(__USERID_ISSET_ID);
-
 
11999
    }
-
 
12000
 
-
 
12001
    public void setUseridIsSet(boolean value) {
-
 
12002
      __isset_bit_vector.set(__USERID_ISSET_ID, value);
-
 
12003
    }
-
 
12004
 
-
 
12005
    public long getAddressId() {
-
 
12006
      return this.addressId;
-
 
12007
    }
-
 
12008
 
-
 
12009
    public setDefaultAddress_args setAddressId(long addressId) {
-
 
12010
      this.addressId = addressId;
-
 
12011
      setAddressIdIsSet(true);
-
 
12012
      return this;
-
 
12013
    }
-
 
12014
 
-
 
12015
    public void unsetAddressId() {
-
 
12016
      __isset_bit_vector.clear(__ADDRESSID_ISSET_ID);
-
 
12017
    }
-
 
12018
 
-
 
12019
    /** Returns true if field addressId is set (has been asigned a value) and false otherwise */
-
 
12020
    public boolean isSetAddressId() {
-
 
12021
      return __isset_bit_vector.get(__ADDRESSID_ISSET_ID);
-
 
12022
    }
-
 
12023
 
-
 
12024
    public void setAddressIdIsSet(boolean value) {
-
 
12025
      __isset_bit_vector.set(__ADDRESSID_ISSET_ID, value);
-
 
12026
    }
-
 
12027
 
-
 
12028
    public void setFieldValue(_Fields field, Object value) {
-
 
12029
      switch (field) {
-
 
12030
      case USERID:
-
 
12031
        if (value == null) {
-
 
12032
          unsetUserid();
-
 
12033
        } else {
-
 
12034
          setUserid((Long)value);
-
 
12035
        }
-
 
12036
        break;
-
 
12037
 
-
 
12038
      case ADDRESS_ID:
-
 
12039
        if (value == null) {
-
 
12040
          unsetAddressId();
-
 
12041
        } else {
-
 
12042
          setAddressId((Long)value);
-
 
12043
        }
-
 
12044
        break;
-
 
12045
 
-
 
12046
      }
-
 
12047
    }
-
 
12048
 
-
 
12049
    public void setFieldValue(int fieldID, Object value) {
-
 
12050
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
12051
    }
-
 
12052
 
-
 
12053
    public Object getFieldValue(_Fields field) {
-
 
12054
      switch (field) {
-
 
12055
      case USERID:
-
 
12056
        return new Long(getUserid());
-
 
12057
 
-
 
12058
      case ADDRESS_ID:
-
 
12059
        return new Long(getAddressId());
-
 
12060
 
-
 
12061
      }
-
 
12062
      throw new IllegalStateException();
-
 
12063
    }
-
 
12064
 
-
 
12065
    public Object getFieldValue(int fieldId) {
-
 
12066
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
12067
    }
-
 
12068
 
-
 
12069
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
-
 
12070
    public boolean isSet(_Fields field) {
-
 
12071
      switch (field) {
-
 
12072
      case USERID:
-
 
12073
        return isSetUserid();
-
 
12074
      case ADDRESS_ID:
-
 
12075
        return isSetAddressId();
-
 
12076
      }
-
 
12077
      throw new IllegalStateException();
-
 
12078
    }
-
 
12079
 
-
 
12080
    public boolean isSet(int fieldID) {
-
 
12081
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
12082
    }
-
 
12083
 
-
 
12084
    @Override
-
 
12085
    public boolean equals(Object that) {
-
 
12086
      if (that == null)
-
 
12087
        return false;
-
 
12088
      if (that instanceof setDefaultAddress_args)
-
 
12089
        return this.equals((setDefaultAddress_args)that);
-
 
12090
      return false;
-
 
12091
    }
-
 
12092
 
-
 
12093
    public boolean equals(setDefaultAddress_args that) {
-
 
12094
      if (that == null)
-
 
12095
        return false;
-
 
12096
 
-
 
12097
      boolean this_present_userid = true;
-
 
12098
      boolean that_present_userid = true;
-
 
12099
      if (this_present_userid || that_present_userid) {
-
 
12100
        if (!(this_present_userid && that_present_userid))
-
 
12101
          return false;
-
 
12102
        if (this.userid != that.userid)
-
 
12103
          return false;
-
 
12104
      }
-
 
12105
 
-
 
12106
      boolean this_present_addressId = true;
-
 
12107
      boolean that_present_addressId = true;
-
 
12108
      if (this_present_addressId || that_present_addressId) {
-
 
12109
        if (!(this_present_addressId && that_present_addressId))
-
 
12110
          return false;
-
 
12111
        if (this.addressId != that.addressId)
-
 
12112
          return false;
-
 
12113
      }
-
 
12114
 
-
 
12115
      return true;
-
 
12116
    }
-
 
12117
 
-
 
12118
    @Override
-
 
12119
    public int hashCode() {
-
 
12120
      return 0;
-
 
12121
    }
-
 
12122
 
-
 
12123
    public int compareTo(setDefaultAddress_args other) {
-
 
12124
      if (!getClass().equals(other.getClass())) {
-
 
12125
        return getClass().getName().compareTo(other.getClass().getName());
-
 
12126
      }
-
 
12127
 
-
 
12128
      int lastComparison = 0;
-
 
12129
      setDefaultAddress_args typedOther = (setDefaultAddress_args)other;
-
 
12130
 
-
 
12131
      lastComparison = Boolean.valueOf(isSetUserid()).compareTo(isSetUserid());
-
 
12132
      if (lastComparison != 0) {
-
 
12133
        return lastComparison;
-
 
12134
      }
-
 
12135
      lastComparison = TBaseHelper.compareTo(userid, typedOther.userid);
-
 
12136
      if (lastComparison != 0) {
-
 
12137
        return lastComparison;
-
 
12138
      }
-
 
12139
      lastComparison = Boolean.valueOf(isSetAddressId()).compareTo(isSetAddressId());
-
 
12140
      if (lastComparison != 0) {
-
 
12141
        return lastComparison;
-
 
12142
      }
-
 
12143
      lastComparison = TBaseHelper.compareTo(addressId, typedOther.addressId);
-
 
12144
      if (lastComparison != 0) {
-
 
12145
        return lastComparison;
-
 
12146
      }
-
 
12147
      return 0;
-
 
12148
    }
-
 
12149
 
-
 
12150
    public void read(TProtocol iprot) throws TException {
-
 
12151
      TField field;
-
 
12152
      iprot.readStructBegin();
-
 
12153
      while (true)
-
 
12154
      {
-
 
12155
        field = iprot.readFieldBegin();
-
 
12156
        if (field.type == TType.STOP) { 
-
 
12157
          break;
-
 
12158
        }
-
 
12159
        _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
12160
        if (fieldId == null) {
-
 
12161
          TProtocolUtil.skip(iprot, field.type);
-
 
12162
        } else {
-
 
12163
          switch (fieldId) {
-
 
12164
            case USERID:
-
 
12165
              if (field.type == TType.I64) {
-
 
12166
                this.userid = iprot.readI64();
-
 
12167
                setUseridIsSet(true);
-
 
12168
              } else { 
-
 
12169
                TProtocolUtil.skip(iprot, field.type);
-
 
12170
              }
-
 
12171
              break;
-
 
12172
            case ADDRESS_ID:
-
 
12173
              if (field.type == TType.I64) {
-
 
12174
                this.addressId = iprot.readI64();
-
 
12175
                setAddressIdIsSet(true);
-
 
12176
              } else { 
-
 
12177
                TProtocolUtil.skip(iprot, field.type);
-
 
12178
              }
-
 
12179
              break;
-
 
12180
          }
-
 
12181
          iprot.readFieldEnd();
-
 
12182
        }
-
 
12183
      }
-
 
12184
      iprot.readStructEnd();
-
 
12185
      validate();
-
 
12186
    }
-
 
12187
 
-
 
12188
    public void write(TProtocol oprot) throws TException {
-
 
12189
      validate();
-
 
12190
 
-
 
12191
      oprot.writeStructBegin(STRUCT_DESC);
-
 
12192
      oprot.writeFieldBegin(USERID_FIELD_DESC);
-
 
12193
      oprot.writeI64(this.userid);
-
 
12194
      oprot.writeFieldEnd();
-
 
12195
      oprot.writeFieldBegin(ADDRESS_ID_FIELD_DESC);
-
 
12196
      oprot.writeI64(this.addressId);
-
 
12197
      oprot.writeFieldEnd();
-
 
12198
      oprot.writeFieldStop();
-
 
12199
      oprot.writeStructEnd();
-
 
12200
    }
-
 
12201
 
-
 
12202
    @Override
-
 
12203
    public String toString() {
-
 
12204
      StringBuilder sb = new StringBuilder("setDefaultAddress_args(");
-
 
12205
      boolean first = true;
-
 
12206
 
-
 
12207
      sb.append("userid:");
-
 
12208
      sb.append(this.userid);
-
 
12209
      first = false;
-
 
12210
      if (!first) sb.append(", ");
-
 
12211
      sb.append("addressId:");
-
 
12212
      sb.append(this.addressId);
-
 
12213
      first = false;
-
 
12214
      sb.append(")");
-
 
12215
      return sb.toString();
-
 
12216
    }
-
 
12217
 
-
 
12218
    public void validate() throws TException {
-
 
12219
      // check for required fields
-
 
12220
    }
-
 
12221
 
-
 
12222
  }
-
 
12223
 
-
 
12224
  public static class setDefaultAddress_result implements TBase<setDefaultAddress_result._Fields>, java.io.Serializable, Cloneable, Comparable<setDefaultAddress_result>   {
-
 
12225
    private static final TStruct STRUCT_DESC = new TStruct("setDefaultAddress_result");
-
 
12226
 
-
 
12227
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.BOOL, (short)0);
-
 
12228
    private static final TField UCX_FIELD_DESC = new TField("ucx", TType.STRUCT, (short)1);
-
 
12229
 
-
 
12230
    private boolean success;
-
 
12231
    private UserContextException ucx;
-
 
12232
 
-
 
12233
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-
 
12234
    public enum _Fields implements TFieldIdEnum {
-
 
12235
      SUCCESS((short)0, "success"),
-
 
12236
      UCX((short)1, "ucx");
-
 
12237
 
-
 
12238
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
-
 
12239
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
 
12240
 
-
 
12241
      static {
-
 
12242
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-
 
12243
          byId.put((int)field._thriftId, field);
-
 
12244
          byName.put(field.getFieldName(), field);
-
 
12245
        }
-
 
12246
      }
-
 
12247
 
-
 
12248
      /**
-
 
12249
       * Find the _Fields constant that matches fieldId, or null if its not found.
-
 
12250
       */
-
 
12251
      public static _Fields findByThriftId(int fieldId) {
-
 
12252
        return byId.get(fieldId);
-
 
12253
      }
-
 
12254
 
-
 
12255
      /**
-
 
12256
       * Find the _Fields constant that matches fieldId, throwing an exception
-
 
12257
       * if it is not found.
-
 
12258
       */
-
 
12259
      public static _Fields findByThriftIdOrThrow(int fieldId) {
-
 
12260
        _Fields fields = findByThriftId(fieldId);
-
 
12261
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-
 
12262
        return fields;
-
 
12263
      }
-
 
12264
 
-
 
12265
      /**
-
 
12266
       * Find the _Fields constant that matches name, or null if its not found.
-
 
12267
       */
-
 
12268
      public static _Fields findByName(String name) {
-
 
12269
        return byName.get(name);
-
 
12270
      }
-
 
12271
 
-
 
12272
      private final short _thriftId;
-
 
12273
      private final String _fieldName;
-
 
12274
 
-
 
12275
      _Fields(short thriftId, String fieldName) {
-
 
12276
        _thriftId = thriftId;
-
 
12277
        _fieldName = fieldName;
-
 
12278
      }
-
 
12279
 
-
 
12280
      public short getThriftFieldId() {
-
 
12281
        return _thriftId;
-
 
12282
      }
-
 
12283
 
-
 
12284
      public String getFieldName() {
-
 
12285
        return _fieldName;
-
 
12286
      }
-
 
12287
    }
-
 
12288
 
-
 
12289
    // isset id assignments
-
 
12290
    private static final int __SUCCESS_ISSET_ID = 0;
-
 
12291
    private BitSet __isset_bit_vector = new BitSet(1);
-
 
12292
 
-
 
12293
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
-
 
12294
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
-
 
12295
          new FieldValueMetaData(TType.BOOL)));
-
 
12296
      put(_Fields.UCX, new FieldMetaData("ucx", TFieldRequirementType.DEFAULT, 
-
 
12297
          new FieldValueMetaData(TType.STRUCT)));
-
 
12298
    }});
-
 
12299
 
-
 
12300
    static {
-
 
12301
      FieldMetaData.addStructMetaDataMap(setDefaultAddress_result.class, metaDataMap);
-
 
12302
    }
-
 
12303
 
-
 
12304
    public setDefaultAddress_result() {
-
 
12305
    }
-
 
12306
 
-
 
12307
    public setDefaultAddress_result(
-
 
12308
      boolean success,
-
 
12309
      UserContextException ucx)
-
 
12310
    {
-
 
12311
      this();
-
 
12312
      this.success = success;
-
 
12313
      setSuccessIsSet(true);
-
 
12314
      this.ucx = ucx;
-
 
12315
    }
-
 
12316
 
-
 
12317
    /**
-
 
12318
     * Performs a deep copy on <i>other</i>.
-
 
12319
     */
-
 
12320
    public setDefaultAddress_result(setDefaultAddress_result other) {
-
 
12321
      __isset_bit_vector.clear();
-
 
12322
      __isset_bit_vector.or(other.__isset_bit_vector);
-
 
12323
      this.success = other.success;
-
 
12324
      if (other.isSetUcx()) {
-
 
12325
        this.ucx = new UserContextException(other.ucx);
-
 
12326
      }
-
 
12327
    }
-
 
12328
 
-
 
12329
    public setDefaultAddress_result deepCopy() {
-
 
12330
      return new setDefaultAddress_result(this);
-
 
12331
    }
-
 
12332
 
-
 
12333
    @Deprecated
-
 
12334
    public setDefaultAddress_result clone() {
-
 
12335
      return new setDefaultAddress_result(this);
-
 
12336
    }
-
 
12337
 
-
 
12338
    public boolean isSuccess() {
-
 
12339
      return this.success;
-
 
12340
    }
-
 
12341
 
-
 
12342
    public setDefaultAddress_result setSuccess(boolean success) {
-
 
12343
      this.success = success;
-
 
12344
      setSuccessIsSet(true);
-
 
12345
      return this;
-
 
12346
    }
-
 
12347
 
-
 
12348
    public void unsetSuccess() {
-
 
12349
      __isset_bit_vector.clear(__SUCCESS_ISSET_ID);
-
 
12350
    }
-
 
12351
 
-
 
12352
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
-
 
12353
    public boolean isSetSuccess() {
-
 
12354
      return __isset_bit_vector.get(__SUCCESS_ISSET_ID);
-
 
12355
    }
-
 
12356
 
-
 
12357
    public void setSuccessIsSet(boolean value) {
-
 
12358
      __isset_bit_vector.set(__SUCCESS_ISSET_ID, value);
-
 
12359
    }
-
 
12360
 
-
 
12361
    public UserContextException getUcx() {
-
 
12362
      return this.ucx;
-
 
12363
    }
-
 
12364
 
-
 
12365
    public setDefaultAddress_result setUcx(UserContextException ucx) {
-
 
12366
      this.ucx = ucx;
-
 
12367
      return this;
-
 
12368
    }
-
 
12369
 
-
 
12370
    public void unsetUcx() {
-
 
12371
      this.ucx = null;
-
 
12372
    }
-
 
12373
 
-
 
12374
    /** Returns true if field ucx is set (has been asigned a value) and false otherwise */
-
 
12375
    public boolean isSetUcx() {
-
 
12376
      return this.ucx != null;
-
 
12377
    }
-
 
12378
 
-
 
12379
    public void setUcxIsSet(boolean value) {
-
 
12380
      if (!value) {
-
 
12381
        this.ucx = null;
-
 
12382
      }
-
 
12383
    }
-
 
12384
 
-
 
12385
    public void setFieldValue(_Fields field, Object value) {
-
 
12386
      switch (field) {
-
 
12387
      case SUCCESS:
-
 
12388
        if (value == null) {
-
 
12389
          unsetSuccess();
-
 
12390
        } else {
-
 
12391
          setSuccess((Boolean)value);
-
 
12392
        }
-
 
12393
        break;
-
 
12394
 
-
 
12395
      case UCX:
-
 
12396
        if (value == null) {
-
 
12397
          unsetUcx();
-
 
12398
        } else {
-
 
12399
          setUcx((UserContextException)value);
-
 
12400
        }
-
 
12401
        break;
-
 
12402
 
-
 
12403
      }
-
 
12404
    }
-
 
12405
 
-
 
12406
    public void setFieldValue(int fieldID, Object value) {
-
 
12407
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
12408
    }
-
 
12409
 
-
 
12410
    public Object getFieldValue(_Fields field) {
-
 
12411
      switch (field) {
-
 
12412
      case SUCCESS:
-
 
12413
        return new Boolean(isSuccess());
-
 
12414
 
-
 
12415
      case UCX:
-
 
12416
        return getUcx();
-
 
12417
 
-
 
12418
      }
-
 
12419
      throw new IllegalStateException();
-
 
12420
    }
-
 
12421
 
-
 
12422
    public Object getFieldValue(int fieldId) {
-
 
12423
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
12424
    }
-
 
12425
 
-
 
12426
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
-
 
12427
    public boolean isSet(_Fields field) {
-
 
12428
      switch (field) {
-
 
12429
      case SUCCESS:
-
 
12430
        return isSetSuccess();
-
 
12431
      case UCX:
-
 
12432
        return isSetUcx();
-
 
12433
      }
-
 
12434
      throw new IllegalStateException();
-
 
12435
    }
-
 
12436
 
-
 
12437
    public boolean isSet(int fieldID) {
-
 
12438
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
12439
    }
-
 
12440
 
-
 
12441
    @Override
-
 
12442
    public boolean equals(Object that) {
-
 
12443
      if (that == null)
-
 
12444
        return false;
-
 
12445
      if (that instanceof setDefaultAddress_result)
-
 
12446
        return this.equals((setDefaultAddress_result)that);
-
 
12447
      return false;
-
 
12448
    }
-
 
12449
 
-
 
12450
    public boolean equals(setDefaultAddress_result that) {
-
 
12451
      if (that == null)
-
 
12452
        return false;
-
 
12453
 
-
 
12454
      boolean this_present_success = true;
-
 
12455
      boolean that_present_success = true;
-
 
12456
      if (this_present_success || that_present_success) {
-
 
12457
        if (!(this_present_success && that_present_success))
-
 
12458
          return false;
-
 
12459
        if (this.success != that.success)
-
 
12460
          return false;
-
 
12461
      }
-
 
12462
 
-
 
12463
      boolean this_present_ucx = true && this.isSetUcx();
-
 
12464
      boolean that_present_ucx = true && that.isSetUcx();
-
 
12465
      if (this_present_ucx || that_present_ucx) {
-
 
12466
        if (!(this_present_ucx && that_present_ucx))
-
 
12467
          return false;
-
 
12468
        if (!this.ucx.equals(that.ucx))
-
 
12469
          return false;
-
 
12470
      }
-
 
12471
 
-
 
12472
      return true;
-
 
12473
    }
-
 
12474
 
-
 
12475
    @Override
-
 
12476
    public int hashCode() {
-
 
12477
      return 0;
-
 
12478
    }
-
 
12479
 
-
 
12480
    public int compareTo(setDefaultAddress_result other) {
-
 
12481
      if (!getClass().equals(other.getClass())) {
-
 
12482
        return getClass().getName().compareTo(other.getClass().getName());
-
 
12483
      }
-
 
12484
 
-
 
12485
      int lastComparison = 0;
-
 
12486
      setDefaultAddress_result typedOther = (setDefaultAddress_result)other;
-
 
12487
 
-
 
12488
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
-
 
12489
      if (lastComparison != 0) {
-
 
12490
        return lastComparison;
-
 
12491
      }
-
 
12492
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
-
 
12493
      if (lastComparison != 0) {
-
 
12494
        return lastComparison;
-
 
12495
      }
-
 
12496
      lastComparison = Boolean.valueOf(isSetUcx()).compareTo(isSetUcx());
-
 
12497
      if (lastComparison != 0) {
-
 
12498
        return lastComparison;
-
 
12499
      }
-
 
12500
      lastComparison = TBaseHelper.compareTo(ucx, typedOther.ucx);
-
 
12501
      if (lastComparison != 0) {
-
 
12502
        return lastComparison;
-
 
12503
      }
-
 
12504
      return 0;
-
 
12505
    }
-
 
12506
 
-
 
12507
    public void read(TProtocol iprot) throws TException {
-
 
12508
      TField field;
-
 
12509
      iprot.readStructBegin();
-
 
12510
      while (true)
-
 
12511
      {
-
 
12512
        field = iprot.readFieldBegin();
-
 
12513
        if (field.type == TType.STOP) { 
-
 
12514
          break;
-
 
12515
        }
-
 
12516
        _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
12517
        if (fieldId == null) {
-
 
12518
          TProtocolUtil.skip(iprot, field.type);
-
 
12519
        } else {
-
 
12520
          switch (fieldId) {
-
 
12521
            case SUCCESS:
-
 
12522
              if (field.type == TType.BOOL) {
-
 
12523
                this.success = iprot.readBool();
-
 
12524
                setSuccessIsSet(true);
-
 
12525
              } else { 
-
 
12526
                TProtocolUtil.skip(iprot, field.type);
-
 
12527
              }
-
 
12528
              break;
-
 
12529
            case UCX:
-
 
12530
              if (field.type == TType.STRUCT) {
-
 
12531
                this.ucx = new UserContextException();
-
 
12532
                this.ucx.read(iprot);
-
 
12533
              } else { 
-
 
12534
                TProtocolUtil.skip(iprot, field.type);
-
 
12535
              }
-
 
12536
              break;
-
 
12537
          }
-
 
12538
          iprot.readFieldEnd();
-
 
12539
        }
-
 
12540
      }
-
 
12541
      iprot.readStructEnd();
-
 
12542
      validate();
-
 
12543
    }
-
 
12544
 
-
 
12545
    public void write(TProtocol oprot) throws TException {
-
 
12546
      oprot.writeStructBegin(STRUCT_DESC);
-
 
12547
 
-
 
12548
      if (this.isSetSuccess()) {
-
 
12549
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
-
 
12550
        oprot.writeBool(this.success);
-
 
12551
        oprot.writeFieldEnd();
-
 
12552
      } else if (this.isSetUcx()) {
-
 
12553
        oprot.writeFieldBegin(UCX_FIELD_DESC);
-
 
12554
        this.ucx.write(oprot);
-
 
12555
        oprot.writeFieldEnd();
-
 
12556
      }
-
 
12557
      oprot.writeFieldStop();
-
 
12558
      oprot.writeStructEnd();
-
 
12559
    }
-
 
12560
 
-
 
12561
    @Override
-
 
12562
    public String toString() {
-
 
12563
      StringBuilder sb = new StringBuilder("setDefaultAddress_result(");
-
 
12564
      boolean first = true;
-
 
12565
 
-
 
12566
      sb.append("success:");
-
 
12567
      sb.append(this.success);
-
 
12568
      first = false;
11781
      if (!first) sb.append(", ");
12569
      if (!first) sb.append(", ");
11782
      sb.append("ucx:");
12570
      sb.append("ucx:");
11783
      if (this.ucx == null) {
12571
      if (this.ucx == null) {
11784
        sb.append("null");
12572
        sb.append("null");
11785
      } else {
12573
      } else {