All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cicada.userdriver.config.UserBase Maven / Gradle / Ivy

There is a newer version: 1.0.6.6
Show newest version
/**
 * Autogenerated by Thrift Compiler (0.10.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package cicada.userdriver.config;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)", date = "2017-08-15")
public class UserBase implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("UserBase");

  private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField LOGIN_ACCOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("loginAccount", org.apache.thrift.protocol.TType.STRING, (short)2);
  private static final org.apache.thrift.protocol.TField LOGIN_PWD_FIELD_DESC = new org.apache.thrift.protocol.TField("loginPwd", org.apache.thrift.protocol.TType.STRING, (short)3);
  private static final org.apache.thrift.protocol.TField REGISTER_DATE_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("registerDateTime", org.apache.thrift.protocol.TType.STRING, (short)4);
  private static final org.apache.thrift.protocol.TField REFERRER_FIELD_DESC = new org.apache.thrift.protocol.TField("referrer", org.apache.thrift.protocol.TType.STRING, (short)5);
  private static final org.apache.thrift.protocol.TField DEVICE_TOKEN_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("deviceTokenCode", org.apache.thrift.protocol.TType.STRING, (short)6);
  private static final org.apache.thrift.protocol.TField REGISTER_DT_DEVICE_USER_FIELD_DESC = new org.apache.thrift.protocol.TField("registerDtDeviceUser", org.apache.thrift.protocol.TType.STRING, (short)7);

  private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new UserBaseStandardSchemeFactory();
  private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new UserBaseTupleSchemeFactory();

  public String id; // required
  public String loginAccount; // required
  public String loginPwd; // required
  public String registerDateTime; // required
  public String referrer; // required
  public String deviceTokenCode; // required
  public String registerDtDeviceUser; // 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 {
    ID((short)1, "id"),
    LOGIN_ACCOUNT((short)2, "loginAccount"),
    LOGIN_PWD((short)3, "loginPwd"),
    REGISTER_DATE_TIME((short)4, "registerDateTime"),
    REFERRER((short)5, "referrer"),
    DEVICE_TOKEN_CODE((short)6, "deviceTokenCode"),
    REGISTER_DT_DEVICE_USER((short)7, "registerDtDeviceUser");

    private static final java.util.Map byName = new java.util.HashMap();

    static {
      for (_Fields field : java.util.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: // ID
          return ID;
        case 2: // LOGIN_ACCOUNT
          return LOGIN_ACCOUNT;
        case 3: // LOGIN_PWD
          return LOGIN_PWD;
        case 4: // REGISTER_DATE_TIME
          return REGISTER_DATE_TIME;
        case 5: // REFERRER
          return REFERRER;
        case 6: // DEVICE_TOKEN_CODE
          return DEVICE_TOKEN_CODE;
        case 7: // REGISTER_DT_DEVICE_USER
          return REGISTER_DT_DEVICE_USER;
        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 java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.LOGIN_ACCOUNT, new org.apache.thrift.meta_data.FieldMetaData("loginAccount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.LOGIN_PWD, new org.apache.thrift.meta_data.FieldMetaData("loginPwd", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.REGISTER_DATE_TIME, new org.apache.thrift.meta_data.FieldMetaData("registerDateTime", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.REFERRER, new org.apache.thrift.meta_data.FieldMetaData("referrer", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.DEVICE_TOKEN_CODE, new org.apache.thrift.meta_data.FieldMetaData("deviceTokenCode", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.REGISTER_DT_DEVICE_USER, new org.apache.thrift.meta_data.FieldMetaData("registerDtDeviceUser", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(UserBase.class, metaDataMap);
  }

  public UserBase() {
  }

  public UserBase(
    String id,
    String loginAccount,
    String loginPwd,
    String registerDateTime,
    String referrer,
    String deviceTokenCode,
    String registerDtDeviceUser)
  {
    this();
    this.id = id;
    this.loginAccount = loginAccount;
    this.loginPwd = loginPwd;
    this.registerDateTime = registerDateTime;
    this.referrer = referrer;
    this.deviceTokenCode = deviceTokenCode;
    this.registerDtDeviceUser = registerDtDeviceUser;
  }

  /**
   * Performs a deep copy on other.
   */
  public UserBase(UserBase other) {
    if (other.isSetId()) {
      this.id = other.id;
    }
    if (other.isSetLoginAccount()) {
      this.loginAccount = other.loginAccount;
    }
    if (other.isSetLoginPwd()) {
      this.loginPwd = other.loginPwd;
    }
    if (other.isSetRegisterDateTime()) {
      this.registerDateTime = other.registerDateTime;
    }
    if (other.isSetReferrer()) {
      this.referrer = other.referrer;
    }
    if (other.isSetDeviceTokenCode()) {
      this.deviceTokenCode = other.deviceTokenCode;
    }
    if (other.isSetRegisterDtDeviceUser()) {
      this.registerDtDeviceUser = other.registerDtDeviceUser;
    }
  }

  public UserBase deepCopy() {
    return new UserBase(this);
  }

  @Override
  public void clear() {
    this.id = null;
    this.loginAccount = null;
    this.loginPwd = null;
    this.registerDateTime = null;
    this.referrer = null;
    this.deviceTokenCode = null;
    this.registerDtDeviceUser = null;
  }

  public String getId() {
    return this.id;
  }

  public UserBase setId(String id) {
    this.id = id;
    return this;
  }

  public void unsetId() {
    this.id = null;
  }

  /** Returns true if field id is set (has been assigned a value) and false otherwise */
  public boolean isSetId() {
    return this.id != null;
  }

  public void setIdIsSet(boolean value) {
    if (!value) {
      this.id = null;
    }
  }

  public String getLoginAccount() {
    return this.loginAccount;
  }

  public UserBase setLoginAccount(String loginAccount) {
    this.loginAccount = loginAccount;
    return this;
  }

  public void unsetLoginAccount() {
    this.loginAccount = null;
  }

  /** Returns true if field loginAccount is set (has been assigned a value) and false otherwise */
  public boolean isSetLoginAccount() {
    return this.loginAccount != null;
  }

  public void setLoginAccountIsSet(boolean value) {
    if (!value) {
      this.loginAccount = null;
    }
  }

  public String getLoginPwd() {
    return this.loginPwd;
  }

  public UserBase setLoginPwd(String loginPwd) {
    this.loginPwd = loginPwd;
    return this;
  }

  public void unsetLoginPwd() {
    this.loginPwd = null;
  }

  /** Returns true if field loginPwd is set (has been assigned a value) and false otherwise */
  public boolean isSetLoginPwd() {
    return this.loginPwd != null;
  }

  public void setLoginPwdIsSet(boolean value) {
    if (!value) {
      this.loginPwd = null;
    }
  }

  public String getRegisterDateTime() {
    return this.registerDateTime;
  }

  public UserBase setRegisterDateTime(String registerDateTime) {
    this.registerDateTime = registerDateTime;
    return this;
  }

  public void unsetRegisterDateTime() {
    this.registerDateTime = null;
  }

  /** Returns true if field registerDateTime is set (has been assigned a value) and false otherwise */
  public boolean isSetRegisterDateTime() {
    return this.registerDateTime != null;
  }

  public void setRegisterDateTimeIsSet(boolean value) {
    if (!value) {
      this.registerDateTime = null;
    }
  }

  public String getReferrer() {
    return this.referrer;
  }

  public UserBase setReferrer(String referrer) {
    this.referrer = referrer;
    return this;
  }

  public void unsetReferrer() {
    this.referrer = null;
  }

  /** Returns true if field referrer is set (has been assigned a value) and false otherwise */
  public boolean isSetReferrer() {
    return this.referrer != null;
  }

  public void setReferrerIsSet(boolean value) {
    if (!value) {
      this.referrer = null;
    }
  }

  public String getDeviceTokenCode() {
    return this.deviceTokenCode;
  }

  public UserBase setDeviceTokenCode(String deviceTokenCode) {
    this.deviceTokenCode = deviceTokenCode;
    return this;
  }

  public void unsetDeviceTokenCode() {
    this.deviceTokenCode = null;
  }

  /** Returns true if field deviceTokenCode is set (has been assigned a value) and false otherwise */
  public boolean isSetDeviceTokenCode() {
    return this.deviceTokenCode != null;
  }

  public void setDeviceTokenCodeIsSet(boolean value) {
    if (!value) {
      this.deviceTokenCode = null;
    }
  }

  public String getRegisterDtDeviceUser() {
    return this.registerDtDeviceUser;
  }

  public UserBase setRegisterDtDeviceUser(String registerDtDeviceUser) {
    this.registerDtDeviceUser = registerDtDeviceUser;
    return this;
  }

  public void unsetRegisterDtDeviceUser() {
    this.registerDtDeviceUser = null;
  }

  /** Returns true if field registerDtDeviceUser is set (has been assigned a value) and false otherwise */
  public boolean isSetRegisterDtDeviceUser() {
    return this.registerDtDeviceUser != null;
  }

  public void setRegisterDtDeviceUserIsSet(boolean value) {
    if (!value) {
      this.registerDtDeviceUser = null;
    }
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case ID:
      if (value == null) {
        unsetId();
      } else {
        setId((String)value);
      }
      break;

    case LOGIN_ACCOUNT:
      if (value == null) {
        unsetLoginAccount();
      } else {
        setLoginAccount((String)value);
      }
      break;

    case LOGIN_PWD:
      if (value == null) {
        unsetLoginPwd();
      } else {
        setLoginPwd((String)value);
      }
      break;

    case REGISTER_DATE_TIME:
      if (value == null) {
        unsetRegisterDateTime();
      } else {
        setRegisterDateTime((String)value);
      }
      break;

    case REFERRER:
      if (value == null) {
        unsetReferrer();
      } else {
        setReferrer((String)value);
      }
      break;

    case DEVICE_TOKEN_CODE:
      if (value == null) {
        unsetDeviceTokenCode();
      } else {
        setDeviceTokenCode((String)value);
      }
      break;

    case REGISTER_DT_DEVICE_USER:
      if (value == null) {
        unsetRegisterDtDeviceUser();
      } else {
        setRegisterDtDeviceUser((String)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case ID:
      return getId();

    case LOGIN_ACCOUNT:
      return getLoginAccount();

    case LOGIN_PWD:
      return getLoginPwd();

    case REGISTER_DATE_TIME:
      return getRegisterDateTime();

    case REFERRER:
      return getReferrer();

    case DEVICE_TOKEN_CODE:
      return getDeviceTokenCode();

    case REGISTER_DT_DEVICE_USER:
      return getRegisterDtDeviceUser();

    }
    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 ID:
      return isSetId();
    case LOGIN_ACCOUNT:
      return isSetLoginAccount();
    case LOGIN_PWD:
      return isSetLoginPwd();
    case REGISTER_DATE_TIME:
      return isSetRegisterDateTime();
    case REFERRER:
      return isSetReferrer();
    case DEVICE_TOKEN_CODE:
      return isSetDeviceTokenCode();
    case REGISTER_DT_DEVICE_USER:
      return isSetRegisterDtDeviceUser();
    }
    throw new IllegalStateException();
  }

  @Override
  public boolean equals(Object that) {
    if (that == null)
      return false;
    if (that instanceof UserBase)
      return this.equals((UserBase)that);
    return false;
  }

  public boolean equals(UserBase that) {
    if (that == null)
      return false;
    if (this == that)
      return true;

    boolean this_present_id = true && this.isSetId();
    boolean that_present_id = true && that.isSetId();
    if (this_present_id || that_present_id) {
      if (!(this_present_id && that_present_id))
        return false;
      if (!this.id.equals(that.id))
        return false;
    }

    boolean this_present_loginAccount = true && this.isSetLoginAccount();
    boolean that_present_loginAccount = true && that.isSetLoginAccount();
    if (this_present_loginAccount || that_present_loginAccount) {
      if (!(this_present_loginAccount && that_present_loginAccount))
        return false;
      if (!this.loginAccount.equals(that.loginAccount))
        return false;
    }

    boolean this_present_loginPwd = true && this.isSetLoginPwd();
    boolean that_present_loginPwd = true && that.isSetLoginPwd();
    if (this_present_loginPwd || that_present_loginPwd) {
      if (!(this_present_loginPwd && that_present_loginPwd))
        return false;
      if (!this.loginPwd.equals(that.loginPwd))
        return false;
    }

    boolean this_present_registerDateTime = true && this.isSetRegisterDateTime();
    boolean that_present_registerDateTime = true && that.isSetRegisterDateTime();
    if (this_present_registerDateTime || that_present_registerDateTime) {
      if (!(this_present_registerDateTime && that_present_registerDateTime))
        return false;
      if (!this.registerDateTime.equals(that.registerDateTime))
        return false;
    }

    boolean this_present_referrer = true && this.isSetReferrer();
    boolean that_present_referrer = true && that.isSetReferrer();
    if (this_present_referrer || that_present_referrer) {
      if (!(this_present_referrer && that_present_referrer))
        return false;
      if (!this.referrer.equals(that.referrer))
        return false;
    }

    boolean this_present_deviceTokenCode = true && this.isSetDeviceTokenCode();
    boolean that_present_deviceTokenCode = true && that.isSetDeviceTokenCode();
    if (this_present_deviceTokenCode || that_present_deviceTokenCode) {
      if (!(this_present_deviceTokenCode && that_present_deviceTokenCode))
        return false;
      if (!this.deviceTokenCode.equals(that.deviceTokenCode))
        return false;
    }

    boolean this_present_registerDtDeviceUser = true && this.isSetRegisterDtDeviceUser();
    boolean that_present_registerDtDeviceUser = true && that.isSetRegisterDtDeviceUser();
    if (this_present_registerDtDeviceUser || that_present_registerDtDeviceUser) {
      if (!(this_present_registerDtDeviceUser && that_present_registerDtDeviceUser))
        return false;
      if (!this.registerDtDeviceUser.equals(that.registerDtDeviceUser))
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    int hashCode = 1;

    hashCode = hashCode * 8191 + ((isSetId()) ? 131071 : 524287);
    if (isSetId())
      hashCode = hashCode * 8191 + id.hashCode();

    hashCode = hashCode * 8191 + ((isSetLoginAccount()) ? 131071 : 524287);
    if (isSetLoginAccount())
      hashCode = hashCode * 8191 + loginAccount.hashCode();

    hashCode = hashCode * 8191 + ((isSetLoginPwd()) ? 131071 : 524287);
    if (isSetLoginPwd())
      hashCode = hashCode * 8191 + loginPwd.hashCode();

    hashCode = hashCode * 8191 + ((isSetRegisterDateTime()) ? 131071 : 524287);
    if (isSetRegisterDateTime())
      hashCode = hashCode * 8191 + registerDateTime.hashCode();

    hashCode = hashCode * 8191 + ((isSetReferrer()) ? 131071 : 524287);
    if (isSetReferrer())
      hashCode = hashCode * 8191 + referrer.hashCode();

    hashCode = hashCode * 8191 + ((isSetDeviceTokenCode()) ? 131071 : 524287);
    if (isSetDeviceTokenCode())
      hashCode = hashCode * 8191 + deviceTokenCode.hashCode();

    hashCode = hashCode * 8191 + ((isSetRegisterDtDeviceUser()) ? 131071 : 524287);
    if (isSetRegisterDtDeviceUser())
      hashCode = hashCode * 8191 + registerDtDeviceUser.hashCode();

    return hashCode;
  }

  @Override
  public int compareTo(UserBase other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetLoginAccount()).compareTo(other.isSetLoginAccount());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLoginAccount()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.loginAccount, other.loginAccount);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetLoginPwd()).compareTo(other.isSetLoginPwd());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLoginPwd()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.loginPwd, other.loginPwd);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetRegisterDateTime()).compareTo(other.isSetRegisterDateTime());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRegisterDateTime()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.registerDateTime, other.registerDateTime);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetReferrer()).compareTo(other.isSetReferrer());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetReferrer()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.referrer, other.referrer);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDeviceTokenCode()).compareTo(other.isSetDeviceTokenCode());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDeviceTokenCode()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.deviceTokenCode, other.deviceTokenCode);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetRegisterDtDeviceUser()).compareTo(other.isSetRegisterDtDeviceUser());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRegisterDtDeviceUser()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.registerDtDeviceUser, other.registerDtDeviceUser);
      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 {
    scheme(iprot).read(iprot, this);
  }

  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    scheme(oprot).write(oprot, this);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder("UserBase(");
    boolean first = true;

    sb.append("id:");
    if (this.id == null) {
      sb.append("null");
    } else {
      sb.append(this.id);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("loginAccount:");
    if (this.loginAccount == null) {
      sb.append("null");
    } else {
      sb.append(this.loginAccount);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("loginPwd:");
    if (this.loginPwd == null) {
      sb.append("null");
    } else {
      sb.append(this.loginPwd);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("registerDateTime:");
    if (this.registerDateTime == null) {
      sb.append("null");
    } else {
      sb.append(this.registerDateTime);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("referrer:");
    if (this.referrer == null) {
      sb.append("null");
    } else {
      sb.append(this.referrer);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("deviceTokenCode:");
    if (this.deviceTokenCode == null) {
      sb.append("null");
    } else {
      sb.append(this.deviceTokenCode);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("registerDtDeviceUser:");
    if (this.registerDtDeviceUser == null) {
      sb.append("null");
    } else {
      sb.append(this.registerDtDeviceUser);
    }
    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 UserBaseStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public UserBaseStandardScheme getScheme() {
      return new UserBaseStandardScheme();
    }
  }

  private static class UserBaseStandardScheme extends org.apache.thrift.scheme.StandardScheme {

    public void read(org.apache.thrift.protocol.TProtocol iprot, UserBase 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: // ID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.id = iprot.readString();
              struct.setIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // LOGIN_ACCOUNT
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.loginAccount = iprot.readString();
              struct.setLoginAccountIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // LOGIN_PWD
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.loginPwd = iprot.readString();
              struct.setLoginPwdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // REGISTER_DATE_TIME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.registerDateTime = iprot.readString();
              struct.setRegisterDateTimeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // REFERRER
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.referrer = iprot.readString();
              struct.setReferrerIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // DEVICE_TOKEN_CODE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.deviceTokenCode = iprot.readString();
              struct.setDeviceTokenCodeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // REGISTER_DT_DEVICE_USER
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.registerDtDeviceUser = iprot.readString();
              struct.setRegisterDtDeviceUserIsSet(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, UserBase struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.id != null) {
        oprot.writeFieldBegin(ID_FIELD_DESC);
        oprot.writeString(struct.id);
        oprot.writeFieldEnd();
      }
      if (struct.loginAccount != null) {
        oprot.writeFieldBegin(LOGIN_ACCOUNT_FIELD_DESC);
        oprot.writeString(struct.loginAccount);
        oprot.writeFieldEnd();
      }
      if (struct.loginPwd != null) {
        oprot.writeFieldBegin(LOGIN_PWD_FIELD_DESC);
        oprot.writeString(struct.loginPwd);
        oprot.writeFieldEnd();
      }
      if (struct.registerDateTime != null) {
        oprot.writeFieldBegin(REGISTER_DATE_TIME_FIELD_DESC);
        oprot.writeString(struct.registerDateTime);
        oprot.writeFieldEnd();
      }
      if (struct.referrer != null) {
        oprot.writeFieldBegin(REFERRER_FIELD_DESC);
        oprot.writeString(struct.referrer);
        oprot.writeFieldEnd();
      }
      if (struct.deviceTokenCode != null) {
        oprot.writeFieldBegin(DEVICE_TOKEN_CODE_FIELD_DESC);
        oprot.writeString(struct.deviceTokenCode);
        oprot.writeFieldEnd();
      }
      if (struct.registerDtDeviceUser != null) {
        oprot.writeFieldBegin(REGISTER_DT_DEVICE_USER_FIELD_DESC);
        oprot.writeString(struct.registerDtDeviceUser);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class UserBaseTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public UserBaseTupleScheme getScheme() {
      return new UserBaseTupleScheme();
    }
  }

  private static class UserBaseTupleScheme extends org.apache.thrift.scheme.TupleScheme {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, UserBase struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetId()) {
        optionals.set(0);
      }
      if (struct.isSetLoginAccount()) {
        optionals.set(1);
      }
      if (struct.isSetLoginPwd()) {
        optionals.set(2);
      }
      if (struct.isSetRegisterDateTime()) {
        optionals.set(3);
      }
      if (struct.isSetReferrer()) {
        optionals.set(4);
      }
      if (struct.isSetDeviceTokenCode()) {
        optionals.set(5);
      }
      if (struct.isSetRegisterDtDeviceUser()) {
        optionals.set(6);
      }
      oprot.writeBitSet(optionals, 7);
      if (struct.isSetId()) {
        oprot.writeString(struct.id);
      }
      if (struct.isSetLoginAccount()) {
        oprot.writeString(struct.loginAccount);
      }
      if (struct.isSetLoginPwd()) {
        oprot.writeString(struct.loginPwd);
      }
      if (struct.isSetRegisterDateTime()) {
        oprot.writeString(struct.registerDateTime);
      }
      if (struct.isSetReferrer()) {
        oprot.writeString(struct.referrer);
      }
      if (struct.isSetDeviceTokenCode()) {
        oprot.writeString(struct.deviceTokenCode);
      }
      if (struct.isSetRegisterDtDeviceUser()) {
        oprot.writeString(struct.registerDtDeviceUser);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, UserBase struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet incoming = iprot.readBitSet(7);
      if (incoming.get(0)) {
        struct.id = iprot.readString();
        struct.setIdIsSet(true);
      }
      if (incoming.get(1)) {
        struct.loginAccount = iprot.readString();
        struct.setLoginAccountIsSet(true);
      }
      if (incoming.get(2)) {
        struct.loginPwd = iprot.readString();
        struct.setLoginPwdIsSet(true);
      }
      if (incoming.get(3)) {
        struct.registerDateTime = iprot.readString();
        struct.setRegisterDateTimeIsSet(true);
      }
      if (incoming.get(4)) {
        struct.referrer = iprot.readString();
        struct.setReferrerIsSet(true);
      }
      if (incoming.get(5)) {
        struct.deviceTokenCode = iprot.readString();
        struct.setDeviceTokenCodeIsSet(true);
      }
      if (incoming.get(6)) {
        struct.registerDtDeviceUser = iprot.readString();
        struct.setRegisterDtDeviceUserIsSet(true);
      }
    }
  }

  private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
  }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy