Subversion Repositories SmartDukaan

Rev

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

Rev 1466 Rev 1491
Line 37... Line 37...
37
 
37
 
38
    public User createAnonymousUser(String jsessionId) throws UserContextException, TException;
38
    public User createAnonymousUser(String jsessionId) throws UserContextException, TException;
39
 
39
 
40
    public User getUserById(long userId) throws UserContextException, TException;
40
    public User getUserById(long userId) throws UserContextException, TException;
41
 
41
 
-
 
42
    public User getUserByEmail(String email) throws UserContextException, TException;
-
 
43
 
42
    public User createUser(User user) throws UserContextException, TException;
44
    public User createUser(User user) throws UserContextException, TException;
43
 
45
 
44
    public User updateUser(User user) throws UserContextException, TException;
46
    public User updateUser(User user) throws UserContextException, TException;
45
 
47
 
46
    public boolean deleteUser(long userId) throws UserContextException, TException;
48
    public boolean deleteUser(long userId) throws UserContextException, TException;
Line 284... Line 286...
284
        throw result.ucex;
286
        throw result.ucex;
285
      }
287
      }
286
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getUserById failed: unknown result");
288
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getUserById failed: unknown result");
287
    }
289
    }
288
 
290
 
-
 
291
    public User getUserByEmail(String email) throws UserContextException, TException
-
 
292
    {
-
 
293
      send_getUserByEmail(email);
-
 
294
      return recv_getUserByEmail();
-
 
295
    }
-
 
296
 
-
 
297
    public void send_getUserByEmail(String email) throws TException
-
 
298
    {
-
 
299
      oprot_.writeMessageBegin(new TMessage("getUserByEmail", TMessageType.CALL, seqid_));
-
 
300
      getUserByEmail_args args = new getUserByEmail_args();
-
 
301
      args.email = email;
-
 
302
      args.write(oprot_);
-
 
303
      oprot_.writeMessageEnd();
-
 
304
      oprot_.getTransport().flush();
-
 
305
    }
-
 
306
 
-
 
307
    public User recv_getUserByEmail() throws UserContextException, TException
-
 
308
    {
-
 
309
      TMessage msg = iprot_.readMessageBegin();
-
 
310
      if (msg.type == TMessageType.EXCEPTION) {
-
 
311
        TApplicationException x = TApplicationException.read(iprot_);
-
 
312
        iprot_.readMessageEnd();
-
 
313
        throw x;
-
 
314
      }
-
 
315
      getUserByEmail_result result = new getUserByEmail_result();
-
 
316
      result.read(iprot_);
-
 
317
      iprot_.readMessageEnd();
-
 
318
      if (result.isSetSuccess()) {
-
 
319
        return result.success;
-
 
320
      }
-
 
321
      if (result.ucex != null) {
-
 
322
        throw result.ucex;
-
 
323
      }
-
 
324
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "getUserByEmail failed: unknown result");
-
 
325
    }
-
 
326
 
289
    public User createUser(User user) throws UserContextException, TException
327
    public User createUser(User user) throws UserContextException, TException
290
    {
328
    {
291
      send_createUser(user);
329
      send_createUser(user);
292
      return recv_createUser();
330
      return recv_createUser();
293
    }
331
    }
Line 1729... Line 1767...
1729
    {
1767
    {
1730
      iface_ = iface;
1768
      iface_ = iface;
1731
      processMap_.put("closeSession", new closeSession());
1769
      processMap_.put("closeSession", new closeSession());
1732
      processMap_.put("createAnonymousUser", new createAnonymousUser());
1770
      processMap_.put("createAnonymousUser", new createAnonymousUser());
1733
      processMap_.put("getUserById", new getUserById());
1771
      processMap_.put("getUserById", new getUserById());
-
 
1772
      processMap_.put("getUserByEmail", new getUserByEmail());
1734
      processMap_.put("createUser", new createUser());
1773
      processMap_.put("createUser", new createUser());
1735
      processMap_.put("updateUser", new updateUser());
1774
      processMap_.put("updateUser", new updateUser());
1736
      processMap_.put("deleteUser", new deleteUser());
1775
      processMap_.put("deleteUser", new deleteUser());
1737
      processMap_.put("getUserState", new getUserState());
1776
      processMap_.put("getUserState", new getUserState());
1738
      processMap_.put("authenticateUser", new authenticateUser());
1777
      processMap_.put("authenticateUser", new authenticateUser());
Line 1868... Line 1907...
1868
        oprot.getTransport().flush();
1907
        oprot.getTransport().flush();
1869
      }
1908
      }
1870
 
1909
 
1871
    }
1910
    }
1872
 
1911
 
-
 
1912
    private class getUserByEmail implements ProcessFunction {
-
 
1913
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
-
 
1914
      {
-
 
1915
        getUserByEmail_args args = new getUserByEmail_args();
-
 
1916
        args.read(iprot);
-
 
1917
        iprot.readMessageEnd();
-
 
1918
        getUserByEmail_result result = new getUserByEmail_result();
-
 
1919
        try {
-
 
1920
          result.success = iface_.getUserByEmail(args.email);
-
 
1921
        } catch (UserContextException ucex) {
-
 
1922
          result.ucex = ucex;
-
 
1923
        } catch (Throwable th) {
-
 
1924
          LOGGER.error("Internal error processing getUserByEmail", th);
-
 
1925
          TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing getUserByEmail");
-
 
1926
          oprot.writeMessageBegin(new TMessage("getUserByEmail", TMessageType.EXCEPTION, seqid));
-
 
1927
          x.write(oprot);
-
 
1928
          oprot.writeMessageEnd();
-
 
1929
          oprot.getTransport().flush();
-
 
1930
          return;
-
 
1931
        }
-
 
1932
        oprot.writeMessageBegin(new TMessage("getUserByEmail", TMessageType.REPLY, seqid));
-
 
1933
        result.write(oprot);
-
 
1934
        oprot.writeMessageEnd();
-
 
1935
        oprot.getTransport().flush();
-
 
1936
      }
-
 
1937
 
-
 
1938
    }
-
 
1939
 
1873
    private class createUser implements ProcessFunction {
1940
    private class createUser implements ProcessFunction {
1874
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
1941
      public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
1875
      {
1942
      {
1876
        createUser_args args = new createUser_args();
1943
        createUser_args args = new createUser_args();
1877
        args.read(iprot);
1944
        args.read(iprot);
Line 4618... Line 4685...
4618
      boolean first = true;
4685
      boolean first = true;
4619
 
4686
 
4620
      sb.append("success:");
4687
      sb.append("success:");
4621
      if (this.success == null) {
4688
      if (this.success == null) {
4622
        sb.append("null");
4689
        sb.append("null");
-
 
4690
      } else {
-
 
4691
        sb.append(this.success);
-
 
4692
      }
-
 
4693
      first = false;
-
 
4694
      if (!first) sb.append(", ");
-
 
4695
      sb.append("ucex:");
-
 
4696
      if (this.ucex == null) {
-
 
4697
        sb.append("null");
-
 
4698
      } else {
-
 
4699
        sb.append(this.ucex);
-
 
4700
      }
-
 
4701
      first = false;
-
 
4702
      sb.append(")");
-
 
4703
      return sb.toString();
-
 
4704
    }
-
 
4705
 
-
 
4706
    public void validate() throws TException {
-
 
4707
      // check for required fields
-
 
4708
    }
-
 
4709
 
-
 
4710
  }
-
 
4711
 
-
 
4712
  public static class getUserByEmail_args implements TBase<getUserByEmail_args._Fields>, java.io.Serializable, Cloneable, Comparable<getUserByEmail_args>   {
-
 
4713
    private static final TStruct STRUCT_DESC = new TStruct("getUserByEmail_args");
-
 
4714
 
-
 
4715
    private static final TField EMAIL_FIELD_DESC = new TField("email", TType.STRING, (short)1);
-
 
4716
 
-
 
4717
    private String email;
-
 
4718
 
-
 
4719
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-
 
4720
    public enum _Fields implements TFieldIdEnum {
-
 
4721
      EMAIL((short)1, "email");
-
 
4722
 
-
 
4723
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
-
 
4724
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
 
4725
 
-
 
4726
      static {
-
 
4727
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-
 
4728
          byId.put((int)field._thriftId, field);
-
 
4729
          byName.put(field.getFieldName(), field);
-
 
4730
        }
-
 
4731
      }
-
 
4732
 
-
 
4733
      /**
-
 
4734
       * Find the _Fields constant that matches fieldId, or null if its not found.
-
 
4735
       */
-
 
4736
      public static _Fields findByThriftId(int fieldId) {
-
 
4737
        return byId.get(fieldId);
-
 
4738
      }
-
 
4739
 
-
 
4740
      /**
-
 
4741
       * Find the _Fields constant that matches fieldId, throwing an exception
-
 
4742
       * if it is not found.
-
 
4743
       */
-
 
4744
      public static _Fields findByThriftIdOrThrow(int fieldId) {
-
 
4745
        _Fields fields = findByThriftId(fieldId);
-
 
4746
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-
 
4747
        return fields;
-
 
4748
      }
-
 
4749
 
-
 
4750
      /**
-
 
4751
       * Find the _Fields constant that matches name, or null if its not found.
-
 
4752
       */
-
 
4753
      public static _Fields findByName(String name) {
-
 
4754
        return byName.get(name);
-
 
4755
      }
-
 
4756
 
-
 
4757
      private final short _thriftId;
-
 
4758
      private final String _fieldName;
-
 
4759
 
-
 
4760
      _Fields(short thriftId, String fieldName) {
-
 
4761
        _thriftId = thriftId;
-
 
4762
        _fieldName = fieldName;
-
 
4763
      }
-
 
4764
 
-
 
4765
      public short getThriftFieldId() {
-
 
4766
        return _thriftId;
-
 
4767
      }
-
 
4768
 
-
 
4769
      public String getFieldName() {
-
 
4770
        return _fieldName;
-
 
4771
      }
-
 
4772
    }
-
 
4773
 
-
 
4774
    // isset id assignments
-
 
4775
 
-
 
4776
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
-
 
4777
      put(_Fields.EMAIL, new FieldMetaData("email", TFieldRequirementType.DEFAULT, 
-
 
4778
          new FieldValueMetaData(TType.STRING)));
-
 
4779
    }});
-
 
4780
 
-
 
4781
    static {
-
 
4782
      FieldMetaData.addStructMetaDataMap(getUserByEmail_args.class, metaDataMap);
-
 
4783
    }
-
 
4784
 
-
 
4785
    public getUserByEmail_args() {
-
 
4786
    }
-
 
4787
 
-
 
4788
    public getUserByEmail_args(
-
 
4789
      String email)
-
 
4790
    {
-
 
4791
      this();
-
 
4792
      this.email = email;
-
 
4793
    }
-
 
4794
 
-
 
4795
    /**
-
 
4796
     * Performs a deep copy on <i>other</i>.
-
 
4797
     */
-
 
4798
    public getUserByEmail_args(getUserByEmail_args other) {
-
 
4799
      if (other.isSetEmail()) {
-
 
4800
        this.email = other.email;
-
 
4801
      }
-
 
4802
    }
-
 
4803
 
-
 
4804
    public getUserByEmail_args deepCopy() {
-
 
4805
      return new getUserByEmail_args(this);
-
 
4806
    }
-
 
4807
 
-
 
4808
    @Deprecated
-
 
4809
    public getUserByEmail_args clone() {
-
 
4810
      return new getUserByEmail_args(this);
-
 
4811
    }
-
 
4812
 
-
 
4813
    public String getEmail() {
-
 
4814
      return this.email;
-
 
4815
    }
-
 
4816
 
-
 
4817
    public getUserByEmail_args setEmail(String email) {
-
 
4818
      this.email = email;
-
 
4819
      return this;
-
 
4820
    }
-
 
4821
 
-
 
4822
    public void unsetEmail() {
-
 
4823
      this.email = null;
-
 
4824
    }
-
 
4825
 
-
 
4826
    /** Returns true if field email is set (has been asigned a value) and false otherwise */
-
 
4827
    public boolean isSetEmail() {
-
 
4828
      return this.email != null;
-
 
4829
    }
-
 
4830
 
-
 
4831
    public void setEmailIsSet(boolean value) {
-
 
4832
      if (!value) {
-
 
4833
        this.email = null;
-
 
4834
      }
-
 
4835
    }
-
 
4836
 
-
 
4837
    public void setFieldValue(_Fields field, Object value) {
-
 
4838
      switch (field) {
-
 
4839
      case EMAIL:
-
 
4840
        if (value == null) {
-
 
4841
          unsetEmail();
-
 
4842
        } else {
-
 
4843
          setEmail((String)value);
-
 
4844
        }
-
 
4845
        break;
-
 
4846
 
-
 
4847
      }
-
 
4848
    }
-
 
4849
 
-
 
4850
    public void setFieldValue(int fieldID, Object value) {
-
 
4851
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
4852
    }
-
 
4853
 
-
 
4854
    public Object getFieldValue(_Fields field) {
-
 
4855
      switch (field) {
-
 
4856
      case EMAIL:
-
 
4857
        return getEmail();
-
 
4858
 
-
 
4859
      }
-
 
4860
      throw new IllegalStateException();
-
 
4861
    }
-
 
4862
 
-
 
4863
    public Object getFieldValue(int fieldId) {
-
 
4864
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
4865
    }
-
 
4866
 
-
 
4867
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
-
 
4868
    public boolean isSet(_Fields field) {
-
 
4869
      switch (field) {
-
 
4870
      case EMAIL:
-
 
4871
        return isSetEmail();
-
 
4872
      }
-
 
4873
      throw new IllegalStateException();
-
 
4874
    }
-
 
4875
 
-
 
4876
    public boolean isSet(int fieldID) {
-
 
4877
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
4878
    }
-
 
4879
 
-
 
4880
    @Override
-
 
4881
    public boolean equals(Object that) {
-
 
4882
      if (that == null)
-
 
4883
        return false;
-
 
4884
      if (that instanceof getUserByEmail_args)
-
 
4885
        return this.equals((getUserByEmail_args)that);
-
 
4886
      return false;
-
 
4887
    }
-
 
4888
 
-
 
4889
    public boolean equals(getUserByEmail_args that) {
-
 
4890
      if (that == null)
-
 
4891
        return false;
-
 
4892
 
-
 
4893
      boolean this_present_email = true && this.isSetEmail();
-
 
4894
      boolean that_present_email = true && that.isSetEmail();
-
 
4895
      if (this_present_email || that_present_email) {
-
 
4896
        if (!(this_present_email && that_present_email))
-
 
4897
          return false;
-
 
4898
        if (!this.email.equals(that.email))
-
 
4899
          return false;
-
 
4900
      }
-
 
4901
 
-
 
4902
      return true;
-
 
4903
    }
-
 
4904
 
-
 
4905
    @Override
-
 
4906
    public int hashCode() {
-
 
4907
      return 0;
-
 
4908
    }
-
 
4909
 
-
 
4910
    public int compareTo(getUserByEmail_args other) {
-
 
4911
      if (!getClass().equals(other.getClass())) {
-
 
4912
        return getClass().getName().compareTo(other.getClass().getName());
-
 
4913
      }
-
 
4914
 
-
 
4915
      int lastComparison = 0;
-
 
4916
      getUserByEmail_args typedOther = (getUserByEmail_args)other;
-
 
4917
 
-
 
4918
      lastComparison = Boolean.valueOf(isSetEmail()).compareTo(isSetEmail());
-
 
4919
      if (lastComparison != 0) {
-
 
4920
        return lastComparison;
-
 
4921
      }
-
 
4922
      lastComparison = TBaseHelper.compareTo(email, typedOther.email);
-
 
4923
      if (lastComparison != 0) {
-
 
4924
        return lastComparison;
-
 
4925
      }
-
 
4926
      return 0;
-
 
4927
    }
-
 
4928
 
-
 
4929
    public void read(TProtocol iprot) throws TException {
-
 
4930
      TField field;
-
 
4931
      iprot.readStructBegin();
-
 
4932
      while (true)
-
 
4933
      {
-
 
4934
        field = iprot.readFieldBegin();
-
 
4935
        if (field.type == TType.STOP) { 
-
 
4936
          break;
-
 
4937
        }
-
 
4938
        _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
4939
        if (fieldId == null) {
-
 
4940
          TProtocolUtil.skip(iprot, field.type);
-
 
4941
        } else {
-
 
4942
          switch (fieldId) {
-
 
4943
            case EMAIL:
-
 
4944
              if (field.type == TType.STRING) {
-
 
4945
                this.email = iprot.readString();
-
 
4946
              } else { 
-
 
4947
                TProtocolUtil.skip(iprot, field.type);
-
 
4948
              }
-
 
4949
              break;
-
 
4950
          }
-
 
4951
          iprot.readFieldEnd();
-
 
4952
        }
-
 
4953
      }
-
 
4954
      iprot.readStructEnd();
-
 
4955
      validate();
-
 
4956
    }
-
 
4957
 
-
 
4958
    public void write(TProtocol oprot) throws TException {
-
 
4959
      validate();
-
 
4960
 
-
 
4961
      oprot.writeStructBegin(STRUCT_DESC);
-
 
4962
      if (this.email != null) {
-
 
4963
        oprot.writeFieldBegin(EMAIL_FIELD_DESC);
-
 
4964
        oprot.writeString(this.email);
-
 
4965
        oprot.writeFieldEnd();
-
 
4966
      }
-
 
4967
      oprot.writeFieldStop();
-
 
4968
      oprot.writeStructEnd();
-
 
4969
    }
-
 
4970
 
-
 
4971
    @Override
-
 
4972
    public String toString() {
-
 
4973
      StringBuilder sb = new StringBuilder("getUserByEmail_args(");
-
 
4974
      boolean first = true;
-
 
4975
 
-
 
4976
      sb.append("email:");
-
 
4977
      if (this.email == null) {
-
 
4978
        sb.append("null");
-
 
4979
      } else {
-
 
4980
        sb.append(this.email);
-
 
4981
      }
-
 
4982
      first = false;
-
 
4983
      sb.append(")");
-
 
4984
      return sb.toString();
-
 
4985
    }
-
 
4986
 
-
 
4987
    public void validate() throws TException {
-
 
4988
      // check for required fields
-
 
4989
    }
-
 
4990
 
-
 
4991
  }
-
 
4992
 
-
 
4993
  public static class getUserByEmail_result implements TBase<getUserByEmail_result._Fields>, java.io.Serializable, Cloneable, Comparable<getUserByEmail_result>   {
-
 
4994
    private static final TStruct STRUCT_DESC = new TStruct("getUserByEmail_result");
-
 
4995
 
-
 
4996
    private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0);
-
 
4997
    private static final TField UCEX_FIELD_DESC = new TField("ucex", TType.STRUCT, (short)1);
-
 
4998
 
-
 
4999
    private User success;
-
 
5000
    private UserContextException ucex;
-
 
5001
 
-
 
5002
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
-
 
5003
    public enum _Fields implements TFieldIdEnum {
-
 
5004
      SUCCESS((short)0, "success"),
-
 
5005
      UCEX((short)1, "ucex");
-
 
5006
 
-
 
5007
      private static final Map<Integer, _Fields> byId = new HashMap<Integer, _Fields>();
-
 
5008
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
 
5009
 
-
 
5010
      static {
-
 
5011
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
-
 
5012
          byId.put((int)field._thriftId, field);
-
 
5013
          byName.put(field.getFieldName(), field);
-
 
5014
        }
-
 
5015
      }
-
 
5016
 
-
 
5017
      /**
-
 
5018
       * Find the _Fields constant that matches fieldId, or null if its not found.
-
 
5019
       */
-
 
5020
      public static _Fields findByThriftId(int fieldId) {
-
 
5021
        return byId.get(fieldId);
-
 
5022
      }
-
 
5023
 
-
 
5024
      /**
-
 
5025
       * Find the _Fields constant that matches fieldId, throwing an exception
-
 
5026
       * if it is not found.
-
 
5027
       */
-
 
5028
      public static _Fields findByThriftIdOrThrow(int fieldId) {
-
 
5029
        _Fields fields = findByThriftId(fieldId);
-
 
5030
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
-
 
5031
        return fields;
-
 
5032
      }
-
 
5033
 
-
 
5034
      /**
-
 
5035
       * Find the _Fields constant that matches name, or null if its not found.
-
 
5036
       */
-
 
5037
      public static _Fields findByName(String name) {
-
 
5038
        return byName.get(name);
-
 
5039
      }
-
 
5040
 
-
 
5041
      private final short _thriftId;
-
 
5042
      private final String _fieldName;
-
 
5043
 
-
 
5044
      _Fields(short thriftId, String fieldName) {
-
 
5045
        _thriftId = thriftId;
-
 
5046
        _fieldName = fieldName;
-
 
5047
      }
-
 
5048
 
-
 
5049
      public short getThriftFieldId() {
-
 
5050
        return _thriftId;
-
 
5051
      }
-
 
5052
 
-
 
5053
      public String getFieldName() {
-
 
5054
        return _fieldName;
-
 
5055
      }
-
 
5056
    }
-
 
5057
 
-
 
5058
    // isset id assignments
-
 
5059
 
-
 
5060
    public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{
-
 
5061
      put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, 
-
 
5062
          new StructMetaData(TType.STRUCT, User.class)));
-
 
5063
      put(_Fields.UCEX, new FieldMetaData("ucex", TFieldRequirementType.DEFAULT, 
-
 
5064
          new FieldValueMetaData(TType.STRUCT)));
-
 
5065
    }});
-
 
5066
 
-
 
5067
    static {
-
 
5068
      FieldMetaData.addStructMetaDataMap(getUserByEmail_result.class, metaDataMap);
-
 
5069
    }
-
 
5070
 
-
 
5071
    public getUserByEmail_result() {
-
 
5072
    }
-
 
5073
 
-
 
5074
    public getUserByEmail_result(
-
 
5075
      User success,
-
 
5076
      UserContextException ucex)
-
 
5077
    {
-
 
5078
      this();
-
 
5079
      this.success = success;
-
 
5080
      this.ucex = ucex;
-
 
5081
    }
-
 
5082
 
-
 
5083
    /**
-
 
5084
     * Performs a deep copy on <i>other</i>.
-
 
5085
     */
-
 
5086
    public getUserByEmail_result(getUserByEmail_result other) {
-
 
5087
      if (other.isSetSuccess()) {
-
 
5088
        this.success = new User(other.success);
-
 
5089
      }
-
 
5090
      if (other.isSetUcex()) {
-
 
5091
        this.ucex = new UserContextException(other.ucex);
-
 
5092
      }
-
 
5093
    }
-
 
5094
 
-
 
5095
    public getUserByEmail_result deepCopy() {
-
 
5096
      return new getUserByEmail_result(this);
-
 
5097
    }
-
 
5098
 
-
 
5099
    @Deprecated
-
 
5100
    public getUserByEmail_result clone() {
-
 
5101
      return new getUserByEmail_result(this);
-
 
5102
    }
-
 
5103
 
-
 
5104
    public User getSuccess() {
-
 
5105
      return this.success;
-
 
5106
    }
-
 
5107
 
-
 
5108
    public getUserByEmail_result setSuccess(User success) {
-
 
5109
      this.success = success;
-
 
5110
      return this;
-
 
5111
    }
-
 
5112
 
-
 
5113
    public void unsetSuccess() {
-
 
5114
      this.success = null;
-
 
5115
    }
-
 
5116
 
-
 
5117
    /** Returns true if field success is set (has been asigned a value) and false otherwise */
-
 
5118
    public boolean isSetSuccess() {
-
 
5119
      return this.success != null;
-
 
5120
    }
-
 
5121
 
-
 
5122
    public void setSuccessIsSet(boolean value) {
-
 
5123
      if (!value) {
-
 
5124
        this.success = null;
-
 
5125
      }
-
 
5126
    }
-
 
5127
 
-
 
5128
    public UserContextException getUcex() {
-
 
5129
      return this.ucex;
-
 
5130
    }
-
 
5131
 
-
 
5132
    public getUserByEmail_result setUcex(UserContextException ucex) {
-
 
5133
      this.ucex = ucex;
-
 
5134
      return this;
-
 
5135
    }
-
 
5136
 
-
 
5137
    public void unsetUcex() {
-
 
5138
      this.ucex = null;
-
 
5139
    }
-
 
5140
 
-
 
5141
    /** Returns true if field ucex is set (has been asigned a value) and false otherwise */
-
 
5142
    public boolean isSetUcex() {
-
 
5143
      return this.ucex != null;
-
 
5144
    }
-
 
5145
 
-
 
5146
    public void setUcexIsSet(boolean value) {
-
 
5147
      if (!value) {
-
 
5148
        this.ucex = null;
-
 
5149
      }
-
 
5150
    }
-
 
5151
 
-
 
5152
    public void setFieldValue(_Fields field, Object value) {
-
 
5153
      switch (field) {
-
 
5154
      case SUCCESS:
-
 
5155
        if (value == null) {
-
 
5156
          unsetSuccess();
-
 
5157
        } else {
-
 
5158
          setSuccess((User)value);
-
 
5159
        }
-
 
5160
        break;
-
 
5161
 
-
 
5162
      case UCEX:
-
 
5163
        if (value == null) {
-
 
5164
          unsetUcex();
-
 
5165
        } else {
-
 
5166
          setUcex((UserContextException)value);
-
 
5167
        }
-
 
5168
        break;
-
 
5169
 
-
 
5170
      }
-
 
5171
    }
-
 
5172
 
-
 
5173
    public void setFieldValue(int fieldID, Object value) {
-
 
5174
      setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value);
-
 
5175
    }
-
 
5176
 
-
 
5177
    public Object getFieldValue(_Fields field) {
-
 
5178
      switch (field) {
-
 
5179
      case SUCCESS:
-
 
5180
        return getSuccess();
-
 
5181
 
-
 
5182
      case UCEX:
-
 
5183
        return getUcex();
-
 
5184
 
-
 
5185
      }
-
 
5186
      throw new IllegalStateException();
-
 
5187
    }
-
 
5188
 
-
 
5189
    public Object getFieldValue(int fieldId) {
-
 
5190
      return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId));
-
 
5191
    }
-
 
5192
 
-
 
5193
    /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
-
 
5194
    public boolean isSet(_Fields field) {
-
 
5195
      switch (field) {
-
 
5196
      case SUCCESS:
-
 
5197
        return isSetSuccess();
-
 
5198
      case UCEX:
-
 
5199
        return isSetUcex();
-
 
5200
      }
-
 
5201
      throw new IllegalStateException();
-
 
5202
    }
-
 
5203
 
-
 
5204
    public boolean isSet(int fieldID) {
-
 
5205
      return isSet(_Fields.findByThriftIdOrThrow(fieldID));
-
 
5206
    }
-
 
5207
 
-
 
5208
    @Override
-
 
5209
    public boolean equals(Object that) {
-
 
5210
      if (that == null)
-
 
5211
        return false;
-
 
5212
      if (that instanceof getUserByEmail_result)
-
 
5213
        return this.equals((getUserByEmail_result)that);
-
 
5214
      return false;
-
 
5215
    }
-
 
5216
 
-
 
5217
    public boolean equals(getUserByEmail_result that) {
-
 
5218
      if (that == null)
-
 
5219
        return false;
-
 
5220
 
-
 
5221
      boolean this_present_success = true && this.isSetSuccess();
-
 
5222
      boolean that_present_success = true && that.isSetSuccess();
-
 
5223
      if (this_present_success || that_present_success) {
-
 
5224
        if (!(this_present_success && that_present_success))
-
 
5225
          return false;
-
 
5226
        if (!this.success.equals(that.success))
-
 
5227
          return false;
-
 
5228
      }
-
 
5229
 
-
 
5230
      boolean this_present_ucex = true && this.isSetUcex();
-
 
5231
      boolean that_present_ucex = true && that.isSetUcex();
-
 
5232
      if (this_present_ucex || that_present_ucex) {
-
 
5233
        if (!(this_present_ucex && that_present_ucex))
-
 
5234
          return false;
-
 
5235
        if (!this.ucex.equals(that.ucex))
-
 
5236
          return false;
-
 
5237
      }
-
 
5238
 
-
 
5239
      return true;
-
 
5240
    }
-
 
5241
 
-
 
5242
    @Override
-
 
5243
    public int hashCode() {
-
 
5244
      return 0;
-
 
5245
    }
-
 
5246
 
-
 
5247
    public int compareTo(getUserByEmail_result other) {
-
 
5248
      if (!getClass().equals(other.getClass())) {
-
 
5249
        return getClass().getName().compareTo(other.getClass().getName());
-
 
5250
      }
-
 
5251
 
-
 
5252
      int lastComparison = 0;
-
 
5253
      getUserByEmail_result typedOther = (getUserByEmail_result)other;
-
 
5254
 
-
 
5255
      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess());
-
 
5256
      if (lastComparison != 0) {
-
 
5257
        return lastComparison;
-
 
5258
      }
-
 
5259
      lastComparison = TBaseHelper.compareTo(success, typedOther.success);
-
 
5260
      if (lastComparison != 0) {
-
 
5261
        return lastComparison;
-
 
5262
      }
-
 
5263
      lastComparison = Boolean.valueOf(isSetUcex()).compareTo(isSetUcex());
-
 
5264
      if (lastComparison != 0) {
-
 
5265
        return lastComparison;
-
 
5266
      }
-
 
5267
      lastComparison = TBaseHelper.compareTo(ucex, typedOther.ucex);
-
 
5268
      if (lastComparison != 0) {
-
 
5269
        return lastComparison;
-
 
5270
      }
-
 
5271
      return 0;
-
 
5272
    }
-
 
5273
 
-
 
5274
    public void read(TProtocol iprot) throws TException {
-
 
5275
      TField field;
-
 
5276
      iprot.readStructBegin();
-
 
5277
      while (true)
-
 
5278
      {
-
 
5279
        field = iprot.readFieldBegin();
-
 
5280
        if (field.type == TType.STOP) { 
-
 
5281
          break;
-
 
5282
        }
-
 
5283
        _Fields fieldId = _Fields.findByThriftId(field.id);
-
 
5284
        if (fieldId == null) {
-
 
5285
          TProtocolUtil.skip(iprot, field.type);
-
 
5286
        } else {
-
 
5287
          switch (fieldId) {
-
 
5288
            case SUCCESS:
-
 
5289
              if (field.type == TType.STRUCT) {
-
 
5290
                this.success = new User();
-
 
5291
                this.success.read(iprot);
-
 
5292
              } else { 
-
 
5293
                TProtocolUtil.skip(iprot, field.type);
-
 
5294
              }
-
 
5295
              break;
-
 
5296
            case UCEX:
-
 
5297
              if (field.type == TType.STRUCT) {
-
 
5298
                this.ucex = new UserContextException();
-
 
5299
                this.ucex.read(iprot);
-
 
5300
              } else { 
-
 
5301
                TProtocolUtil.skip(iprot, field.type);
-
 
5302
              }
-
 
5303
              break;
-
 
5304
          }
-
 
5305
          iprot.readFieldEnd();
-
 
5306
        }
-
 
5307
      }
-
 
5308
      iprot.readStructEnd();
-
 
5309
      validate();
-
 
5310
    }
-
 
5311
 
-
 
5312
    public void write(TProtocol oprot) throws TException {
-
 
5313
      oprot.writeStructBegin(STRUCT_DESC);
-
 
5314
 
-
 
5315
      if (this.isSetSuccess()) {
-
 
5316
        oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
-
 
5317
        this.success.write(oprot);
-
 
5318
        oprot.writeFieldEnd();
-
 
5319
      } else if (this.isSetUcex()) {
-
 
5320
        oprot.writeFieldBegin(UCEX_FIELD_DESC);
-
 
5321
        this.ucex.write(oprot);
-
 
5322
        oprot.writeFieldEnd();
-
 
5323
      }
-
 
5324
      oprot.writeFieldStop();
-
 
5325
      oprot.writeStructEnd();
-
 
5326
    }
-
 
5327
 
-
 
5328
    @Override
-
 
5329
    public String toString() {
-
 
5330
      StringBuilder sb = new StringBuilder("getUserByEmail_result(");
-
 
5331
      boolean first = true;
-
 
5332
 
-
 
5333
      sb.append("success:");
-
 
5334
      if (this.success == null) {
-
 
5335
        sb.append("null");
4623
      } else {
5336
      } else {
4624
        sb.append(this.success);
5337
        sb.append(this.success);
4625
      }
5338
      }
4626
      first = false;
5339
      first = false;
4627
      if (!first) sb.append(", ");
5340
      if (!first) sb.append(", ");