content: /**
   * Autogenerated by Thrift Compiler (0.9.2)
   *
   * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
   *  @generated
   */
  package thirdparty.thrift.generate.db.user;
  
  import org.apache.thrift.protocol.TTupleProtocol;
  import org.apache.thrift.scheme.IScheme;
  import org.apache.thrift.scheme.SchemeFactory;
  import org.apache.thrift.scheme.StandardScheme;
  import org.apache.thrift.scheme.TupleScheme;
  
  import javax.annotation.Generated;
  import java.util.*;
  
  @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
  @Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2016-2-23")
  public class Account implements org.apache.thrift.TBase<Account, Account._Fields>, java.io.Serializable, Cloneable, Comparable<Account> {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Account");
  
    private static final org.apache.thrift.protocol.TField USERID_FIELD_DESC = new org.apache.thrift.protocol.TField("userid", org.apache.thrift.protocol.TType.STRING, (short)1);
    private static final org.apache.thrift.protocol.TField PASSWD_FIELD_DESC = new org.apache.thrift.protocol.TField("passwd", org.apache.thrift.protocol.TType.STRING, (short)2);
  
    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new AccountStandardSchemeFactory());
      schemes.put(TupleScheme.class, new AccountTupleSchemeFactory());
    }
  
    private String userid; // required
    private String passwd; // required
  
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      USERID((short)1, "userid"),
      PASSWD((short)2, "passwd");
  
      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
  
      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }
  
      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // USERID
            return USERID;
          case 2: // PASSWD
            return PASSWD;
          default:
            return null;
        }
      }
  
      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }
  
      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }
  
      private final short _thriftId;
      private final String _fieldName;
  
      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }
  
      public short getThriftFieldId() {
        return _thriftId;
      }
  
      public String getFieldName() {
        return _fieldName;
      }
    }
  
    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.USERID, new org.apache.thrift.meta_data.FieldMetaData("userid", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.PASSWD, new org.apache.thrift.meta_data.FieldMetaData("passwd", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Account.class, metaDataMap);
    }
  
    public Account() {
    }
  
    public Account(
      String userid,
      String passwd)
    {
      this();
      this.userid = userid;
      this.passwd = passwd;
    }
  
    /**
     * Performs a deep copy on <i>other</i>.
     */
    public Account(Account other) {
      if (other.isSetUserid()) {
        this.userid = other.userid;
      }
      if (other.isSetPasswd()) {
        this.passwd = other.passwd;
      }
    }
  
    public Account deepCopy() {
      return new Account(this);
    }
  
    @Override
    public void clear() {
      this.userid = null;
      this.passwd = null;
    }
  
    public String getUserid() {
      return this.userid;
    }
  
    public Account setUserid(String userid) {
      this.userid = userid;
      return this;
    }
  
    public void unsetUserid() {
      this.userid = null;
    }
  
    /** Returns true if field userid is set (has been assigned a value) and false otherwise */
    public boolean isSetUserid() {
      return this.userid != null;
    }
  
    public void setUseridIsSet(boolean value) {
      if (!value) {
        this.userid = null;
      }
    }
  
    public String getPasswd() {
      return this.passwd;
    }
  
    public Account setPasswd(String passwd) {
      this.passwd = passwd;
      return this;
    }
  
    public void unsetPasswd() {
      this.passwd = null;
    }
  
    /** Returns true if field passwd is set (has been assigned a value) and false otherwise */
    public boolean isSetPasswd() {
      return this.passwd != null;
    }
  
    public void setPasswdIsSet(boolean value) {
      if (!value) {
        this.passwd = null;
      }
    }
  
    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case USERID:
        if (value == null) {
          unsetUserid();
        } else {
          setUserid((String)value);
        }
        break;
  
      case PASSWD:
        if (value == null) {
          unsetPasswd();
        } else {
          setPasswd((String)value);
        }
        break;
  
      }
    }
  
    public Object getFieldValue(_Fields field) {
      switch (field) {
      case USERID:
        return getUserid();
  
      case PASSWD:
        return getPasswd();
  
      }
      throw new IllegalStateException();
    }
  
    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }
  
      switch (field) {
      case USERID:
        return isSetUserid();
      case PASSWD:
        return isSetPasswd();
      }
      throw new IllegalStateException();
    }
  
    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof Account)
        return this.equals((Account)that);
      return false;
    }
  
    public boolean equals(Account that) {
      if (that == null)
        return false;
  
      boolean this_present_userid = true && this.isSetUserid();
      boolean that_present_userid = true && that.isSetUserid();
      if (this_present_userid || that_present_userid) {
        if (!(this_present_userid && that_present_userid))
          return false;
        if (!this.userid.equals(that.userid))
          return false;
      }
  
      boolean this_present_passwd = true && this.isSetPasswd();
      boolean that_present_passwd = true && that.isSetPasswd();
      if (this_present_passwd || that_present_passwd) {
        if (!(this_present_passwd && that_present_passwd))
          return false;
        if (!this.passwd.equals(that.passwd))
          return false;
      }
  
      return true;
    }
  
    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();
  
      boolean present_userid = true && (isSetUserid());
      list.add(present_userid);
      if (present_userid)
        list.add(userid);
  
      boolean present_passwd = true && (isSetPasswd());
      list.add(present_passwd);
      if (present_passwd)
        list.add(passwd);
  
      return list.hashCode();
    }
  
    @Override
    public int compareTo(Account other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }
  
      int lastComparison = 0;
  
      lastComparison = Boolean.valueOf(isSetUserid()).compareTo(other.isSetUserid());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetUserid()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userid, other.userid);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetPasswd()).compareTo(other.isSetPasswd());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPasswd()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.passwd, other.passwd);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }
  
    public _Fields fieldForId(int fieldId) {
      return _Fields.findByThriftId(fieldId);
    }
  
    public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
      schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
    }
  
    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
    }
  
    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder("Account(");
      boolean first = true;
  
      sb.append("userid:");
      if (this.userid == null) {
        sb.append("null");
      } else {
        sb.append(this.userid);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("passwd:");
      if (this.passwd == null) {
        sb.append("null");
      } else {
        sb.append(this.passwd);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }
  
    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }
  
    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }
  
    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
      try {
        read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }
  
    private static class AccountStandardSchemeFactory implements SchemeFactory {
      public AccountStandardScheme getScheme() {
        return new AccountStandardScheme();
      }
    }
  
    private static class AccountStandardScheme extends StandardScheme<Account> {
  
      public void read(org.apache.thrift.protocol.TProtocol iprot, Account struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // USERID
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.userid = iprot.readString();
                struct.setUseridIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // PASSWD
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.passwd = iprot.readString();
                struct.setPasswdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            default:
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
          }
          iprot.readFieldEnd();
        }
        iprot.readStructEnd();
  
        // check for required fields of primitive type, which can't be checked in the validate method
        struct.validate();
      }
  
      public void write(org.apache.thrift.protocol.TProtocol oprot, Account struct) throws org.apache.thrift.TException {
        struct.validate();
  
        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.userid != null) {
          oprot.writeFieldBegin(USERID_FIELD_DESC);
          oprot.writeString(struct.userid);
          oprot.writeFieldEnd();
        }
        if (struct.passwd != null) {
          oprot.writeFieldBegin(PASSWD_FIELD_DESC);
          oprot.writeString(struct.passwd);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }
  
    }
  
    private static class AccountTupleSchemeFactory implements SchemeFactory {
      public AccountTupleScheme getScheme() {
        return new AccountTupleScheme();
      }
    }
  
    private static class AccountTupleScheme extends TupleScheme<Account> {
  
      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, Account struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetUserid()) {
          optionals.set(0);
        }
        if (struct.isSetPasswd()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetUserid()) {
          oprot.writeString(struct.userid);
        }
        if (struct.isSetPasswd()) {
          oprot.writeString(struct.passwd);
        }
      }
  
      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, Account struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.userid = iprot.readString();
          struct.setUseridIsSet(true);
        }
        if (incoming.get(1)) {
          struct.passwd = iprot.readString();
          struct.setPasswdIsSet(true);
        }
      }
    }
  
  }
  
  