TCheckAuthRequest.java

/**
 * Autogenerated by Thrift Compiler (0.16.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package org.apache.doris.thrift;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.16.0)", date = "2026-05-14")
public class TCheckAuthRequest implements org.apache.thrift.TBase<TCheckAuthRequest, TCheckAuthRequest._Fields>, java.io.Serializable, Cloneable, Comparable<TCheckAuthRequest> {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCheckAuthRequest");

  private static final org.apache.thrift.protocol.TField CLUSTER_FIELD_DESC = new org.apache.thrift.protocol.TField("cluster", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField USER_FIELD_DESC = new org.apache.thrift.protocol.TField("user", org.apache.thrift.protocol.TType.STRING, (short)2);
  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)3);
  private static final org.apache.thrift.protocol.TField USER_IP_FIELD_DESC = new org.apache.thrift.protocol.TField("user_ip", org.apache.thrift.protocol.TType.STRING, (short)4);
  private static final org.apache.thrift.protocol.TField PRIV_CTRL_FIELD_DESC = new org.apache.thrift.protocol.TField("priv_ctrl", org.apache.thrift.protocol.TType.STRUCT, (short)5);
  private static final org.apache.thrift.protocol.TField PRIV_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("priv_type", org.apache.thrift.protocol.TType.I32, (short)6);
  private static final org.apache.thrift.protocol.TField THRIFT_RPC_TIMEOUT_MS_FIELD_DESC = new org.apache.thrift.protocol.TField("thrift_rpc_timeout_ms", org.apache.thrift.protocol.TType.I64, (short)7);

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

  public @org.apache.thrift.annotation.Nullable java.lang.String cluster; // optional
  public @org.apache.thrift.annotation.Nullable java.lang.String user; // required
  public @org.apache.thrift.annotation.Nullable java.lang.String passwd; // required
  public @org.apache.thrift.annotation.Nullable java.lang.String user_ip; // optional
  public @org.apache.thrift.annotation.Nullable TPrivilegeCtrl priv_ctrl; // optional
  /**
   * 
   * @see TPrivilegeType
   */
  public @org.apache.thrift.annotation.Nullable TPrivilegeType priv_type; // optional
  public long thrift_rpc_timeout_ms; // optional

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    CLUSTER((short)1, "cluster"),
    USER((short)2, "user"),
    PASSWD((short)3, "passwd"),
    USER_IP((short)4, "user_ip"),
    PRIV_CTRL((short)5, "priv_ctrl"),
    /**
     * 
     * @see TPrivilegeType
     */
    PRIV_TYPE((short)6, "priv_type"),
    THRIFT_RPC_TIMEOUT_MS((short)7, "thrift_rpc_timeout_ms");

    private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();

    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.
     */
    @org.apache.thrift.annotation.Nullable
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // CLUSTER
          return CLUSTER;
        case 2: // USER
          return USER;
        case 3: // PASSWD
          return PASSWD;
        case 4: // USER_IP
          return USER_IP;
        case 5: // PRIV_CTRL
          return PRIV_CTRL;
        case 6: // PRIV_TYPE
          return PRIV_TYPE;
        case 7: // THRIFT_RPC_TIMEOUT_MS
          return THRIFT_RPC_TIMEOUT_MS;
        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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
      return fields;
    }

    /**
     * Find the _Fields constant that matches name, or null if its not found.
     */
    @org.apache.thrift.annotation.Nullable
    public static _Fields findByName(java.lang.String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final java.lang.String _fieldName;

    _Fields(short thriftId, java.lang.String fieldName) {
      _thriftId = thriftId;
      _fieldName = fieldName;
    }

    public short getThriftFieldId() {
      return _thriftId;
    }

    public java.lang.String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final int __THRIFT_RPC_TIMEOUT_MS_ISSET_ID = 0;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.CLUSTER,_Fields.USER_IP,_Fields.PRIV_CTRL,_Fields.PRIV_TYPE,_Fields.THRIFT_RPC_TIMEOUT_MS};
  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.CLUSTER, new org.apache.thrift.meta_data.FieldMetaData("cluster", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.USER, new org.apache.thrift.meta_data.FieldMetaData("user", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        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.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.USER_IP, new org.apache.thrift.meta_data.FieldMetaData("user_ip", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.PRIV_CTRL, new org.apache.thrift.meta_data.FieldMetaData("priv_ctrl", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TPrivilegeCtrl.class)));
    tmpMap.put(_Fields.PRIV_TYPE, new org.apache.thrift.meta_data.FieldMetaData("priv_type", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TPrivilegeType.class)));
    tmpMap.put(_Fields.THRIFT_RPC_TIMEOUT_MS, new org.apache.thrift.meta_data.FieldMetaData("thrift_rpc_timeout_ms", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCheckAuthRequest.class, metaDataMap);
  }

  public TCheckAuthRequest() {
  }

  public TCheckAuthRequest(
    java.lang.String user,
    java.lang.String passwd)
  {
    this();
    this.user = user;
    this.passwd = passwd;
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public TCheckAuthRequest(TCheckAuthRequest other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetCluster()) {
      this.cluster = other.cluster;
    }
    if (other.isSetUser()) {
      this.user = other.user;
    }
    if (other.isSetPasswd()) {
      this.passwd = other.passwd;
    }
    if (other.isSetUserIp()) {
      this.user_ip = other.user_ip;
    }
    if (other.isSetPrivCtrl()) {
      this.priv_ctrl = new TPrivilegeCtrl(other.priv_ctrl);
    }
    if (other.isSetPrivType()) {
      this.priv_type = other.priv_type;
    }
    this.thrift_rpc_timeout_ms = other.thrift_rpc_timeout_ms;
  }

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

  @Override
  public void clear() {
    this.cluster = null;
    this.user = null;
    this.passwd = null;
    this.user_ip = null;
    this.priv_ctrl = null;
    this.priv_type = null;
    setThriftRpcTimeoutMsIsSet(false);
    this.thrift_rpc_timeout_ms = 0;
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.String getCluster() {
    return this.cluster;
  }

  public TCheckAuthRequest setCluster(@org.apache.thrift.annotation.Nullable java.lang.String cluster) {
    this.cluster = cluster;
    return this;
  }

  public void unsetCluster() {
    this.cluster = null;
  }

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

  public void setClusterIsSet(boolean value) {
    if (!value) {
      this.cluster = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.String getUser() {
    return this.user;
  }

  public TCheckAuthRequest setUser(@org.apache.thrift.annotation.Nullable java.lang.String user) {
    this.user = user;
    return this;
  }

  public void unsetUser() {
    this.user = null;
  }

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

  public void setUserIsSet(boolean value) {
    if (!value) {
      this.user = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.String getPasswd() {
    return this.passwd;
  }

  public TCheckAuthRequest setPasswd(@org.apache.thrift.annotation.Nullable java.lang.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;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.String getUserIp() {
    return this.user_ip;
  }

  public TCheckAuthRequest setUserIp(@org.apache.thrift.annotation.Nullable java.lang.String user_ip) {
    this.user_ip = user_ip;
    return this;
  }

  public void unsetUserIp() {
    this.user_ip = null;
  }

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

  public void setUserIpIsSet(boolean value) {
    if (!value) {
      this.user_ip = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public TPrivilegeCtrl getPrivCtrl() {
    return this.priv_ctrl;
  }

  public TCheckAuthRequest setPrivCtrl(@org.apache.thrift.annotation.Nullable TPrivilegeCtrl priv_ctrl) {
    this.priv_ctrl = priv_ctrl;
    return this;
  }

  public void unsetPrivCtrl() {
    this.priv_ctrl = null;
  }

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

  public void setPrivCtrlIsSet(boolean value) {
    if (!value) {
      this.priv_ctrl = null;
    }
  }

  /**
   * 
   * @see TPrivilegeType
   */
  @org.apache.thrift.annotation.Nullable
  public TPrivilegeType getPrivType() {
    return this.priv_type;
  }

  /**
   * 
   * @see TPrivilegeType
   */
  public TCheckAuthRequest setPrivType(@org.apache.thrift.annotation.Nullable TPrivilegeType priv_type) {
    this.priv_type = priv_type;
    return this;
  }

  public void unsetPrivType() {
    this.priv_type = null;
  }

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

  public void setPrivTypeIsSet(boolean value) {
    if (!value) {
      this.priv_type = null;
    }
  }

  public long getThriftRpcTimeoutMs() {
    return this.thrift_rpc_timeout_ms;
  }

  public TCheckAuthRequest setThriftRpcTimeoutMs(long thrift_rpc_timeout_ms) {
    this.thrift_rpc_timeout_ms = thrift_rpc_timeout_ms;
    setThriftRpcTimeoutMsIsSet(true);
    return this;
  }

  public void unsetThriftRpcTimeoutMs() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __THRIFT_RPC_TIMEOUT_MS_ISSET_ID);
  }

  /** Returns true if field thrift_rpc_timeout_ms is set (has been assigned a value) and false otherwise */
  public boolean isSetThriftRpcTimeoutMs() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __THRIFT_RPC_TIMEOUT_MS_ISSET_ID);
  }

  public void setThriftRpcTimeoutMsIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __THRIFT_RPC_TIMEOUT_MS_ISSET_ID, value);
  }

  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case CLUSTER:
      if (value == null) {
        unsetCluster();
      } else {
        setCluster((java.lang.String)value);
      }
      break;

    case USER:
      if (value == null) {
        unsetUser();
      } else {
        setUser((java.lang.String)value);
      }
      break;

    case PASSWD:
      if (value == null) {
        unsetPasswd();
      } else {
        setPasswd((java.lang.String)value);
      }
      break;

    case USER_IP:
      if (value == null) {
        unsetUserIp();
      } else {
        setUserIp((java.lang.String)value);
      }
      break;

    case PRIV_CTRL:
      if (value == null) {
        unsetPrivCtrl();
      } else {
        setPrivCtrl((TPrivilegeCtrl)value);
      }
      break;

    case PRIV_TYPE:
      if (value == null) {
        unsetPrivType();
      } else {
        setPrivType((TPrivilegeType)value);
      }
      break;

    case THRIFT_RPC_TIMEOUT_MS:
      if (value == null) {
        unsetThriftRpcTimeoutMs();
      } else {
        setThriftRpcTimeoutMs((java.lang.Long)value);
      }
      break;

    }
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.Object getFieldValue(_Fields field) {
    switch (field) {
    case CLUSTER:
      return getCluster();

    case USER:
      return getUser();

    case PASSWD:
      return getPasswd();

    case USER_IP:
      return getUserIp();

    case PRIV_CTRL:
      return getPrivCtrl();

    case PRIV_TYPE:
      return getPrivType();

    case THRIFT_RPC_TIMEOUT_MS:
      return getThriftRpcTimeoutMs();

    }
    throw new java.lang.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 java.lang.IllegalArgumentException();
    }

    switch (field) {
    case CLUSTER:
      return isSetCluster();
    case USER:
      return isSetUser();
    case PASSWD:
      return isSetPasswd();
    case USER_IP:
      return isSetUserIp();
    case PRIV_CTRL:
      return isSetPrivCtrl();
    case PRIV_TYPE:
      return isSetPrivType();
    case THRIFT_RPC_TIMEOUT_MS:
      return isSetThriftRpcTimeoutMs();
    }
    throw new java.lang.IllegalStateException();
  }

  @Override
  public boolean equals(java.lang.Object that) {
    if (that instanceof TCheckAuthRequest)
      return this.equals((TCheckAuthRequest)that);
    return false;
  }

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

    boolean this_present_cluster = true && this.isSetCluster();
    boolean that_present_cluster = true && that.isSetCluster();
    if (this_present_cluster || that_present_cluster) {
      if (!(this_present_cluster && that_present_cluster))
        return false;
      if (!this.cluster.equals(that.cluster))
        return false;
    }

    boolean this_present_user = true && this.isSetUser();
    boolean that_present_user = true && that.isSetUser();
    if (this_present_user || that_present_user) {
      if (!(this_present_user && that_present_user))
        return false;
      if (!this.user.equals(that.user))
        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;
    }

    boolean this_present_user_ip = true && this.isSetUserIp();
    boolean that_present_user_ip = true && that.isSetUserIp();
    if (this_present_user_ip || that_present_user_ip) {
      if (!(this_present_user_ip && that_present_user_ip))
        return false;
      if (!this.user_ip.equals(that.user_ip))
        return false;
    }

    boolean this_present_priv_ctrl = true && this.isSetPrivCtrl();
    boolean that_present_priv_ctrl = true && that.isSetPrivCtrl();
    if (this_present_priv_ctrl || that_present_priv_ctrl) {
      if (!(this_present_priv_ctrl && that_present_priv_ctrl))
        return false;
      if (!this.priv_ctrl.equals(that.priv_ctrl))
        return false;
    }

    boolean this_present_priv_type = true && this.isSetPrivType();
    boolean that_present_priv_type = true && that.isSetPrivType();
    if (this_present_priv_type || that_present_priv_type) {
      if (!(this_present_priv_type && that_present_priv_type))
        return false;
      if (!this.priv_type.equals(that.priv_type))
        return false;
    }

    boolean this_present_thrift_rpc_timeout_ms = true && this.isSetThriftRpcTimeoutMs();
    boolean that_present_thrift_rpc_timeout_ms = true && that.isSetThriftRpcTimeoutMs();
    if (this_present_thrift_rpc_timeout_ms || that_present_thrift_rpc_timeout_ms) {
      if (!(this_present_thrift_rpc_timeout_ms && that_present_thrift_rpc_timeout_ms))
        return false;
      if (this.thrift_rpc_timeout_ms != that.thrift_rpc_timeout_ms)
        return false;
    }

    return true;
  }

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

    hashCode = hashCode * 8191 + ((isSetCluster()) ? 131071 : 524287);
    if (isSetCluster())
      hashCode = hashCode * 8191 + cluster.hashCode();

    hashCode = hashCode * 8191 + ((isSetUser()) ? 131071 : 524287);
    if (isSetUser())
      hashCode = hashCode * 8191 + user.hashCode();

    hashCode = hashCode * 8191 + ((isSetPasswd()) ? 131071 : 524287);
    if (isSetPasswd())
      hashCode = hashCode * 8191 + passwd.hashCode();

    hashCode = hashCode * 8191 + ((isSetUserIp()) ? 131071 : 524287);
    if (isSetUserIp())
      hashCode = hashCode * 8191 + user_ip.hashCode();

    hashCode = hashCode * 8191 + ((isSetPrivCtrl()) ? 131071 : 524287);
    if (isSetPrivCtrl())
      hashCode = hashCode * 8191 + priv_ctrl.hashCode();

    hashCode = hashCode * 8191 + ((isSetPrivType()) ? 131071 : 524287);
    if (isSetPrivType())
      hashCode = hashCode * 8191 + priv_type.getValue();

    hashCode = hashCode * 8191 + ((isSetThriftRpcTimeoutMs()) ? 131071 : 524287);
    if (isSetThriftRpcTimeoutMs())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(thrift_rpc_timeout_ms);

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetCluster(), other.isSetCluster());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCluster()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cluster, other.cluster);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetUser(), other.isSetUser());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUser()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.user, other.user);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetPasswd(), other.isSetPasswd());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPasswd()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.passwd, other.passwd);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetUserIp(), other.isSetUserIp());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUserIp()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.user_ip, other.user_ip);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetPrivCtrl(), other.isSetPrivCtrl());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPrivCtrl()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.priv_ctrl, other.priv_ctrl);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetPrivType(), other.isSetPrivType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPrivType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.priv_type, other.priv_type);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetThriftRpcTimeoutMs(), other.isSetThriftRpcTimeoutMs());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetThriftRpcTimeoutMs()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.thrift_rpc_timeout_ms, other.thrift_rpc_timeout_ms);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  @org.apache.thrift.annotation.Nullable
  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 java.lang.String toString() {
    java.lang.StringBuilder sb = new java.lang.StringBuilder("TCheckAuthRequest(");
    boolean first = true;

    if (isSetCluster()) {
      sb.append("cluster:");
      if (this.cluster == null) {
        sb.append("null");
      } else {
        sb.append(this.cluster);
      }
      first = false;
    }
    if (!first) sb.append(", ");
    sb.append("user:");
    if (this.user == null) {
      sb.append("null");
    } else {
      sb.append(this.user);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("passwd:");
    if (this.passwd == null) {
      sb.append("null");
    } else {
      sb.append(this.passwd);
    }
    first = false;
    if (isSetUserIp()) {
      if (!first) sb.append(", ");
      sb.append("user_ip:");
      if (this.user_ip == null) {
        sb.append("null");
      } else {
        sb.append(this.user_ip);
      }
      first = false;
    }
    if (isSetPrivCtrl()) {
      if (!first) sb.append(", ");
      sb.append("priv_ctrl:");
      if (this.priv_ctrl == null) {
        sb.append("null");
      } else {
        sb.append(this.priv_ctrl);
      }
      first = false;
    }
    if (isSetPrivType()) {
      if (!first) sb.append(", ");
      sb.append("priv_type:");
      if (this.priv_type == null) {
        sb.append("null");
      } else {
        sb.append(this.priv_type);
      }
      first = false;
    }
    if (isSetThriftRpcTimeoutMs()) {
      if (!first) sb.append(", ");
      sb.append("thrift_rpc_timeout_ms:");
      sb.append(this.thrift_rpc_timeout_ms);
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    if (user == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'user' was not present! Struct: " + toString());
    }
    if (passwd == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'passwd' was not present! Struct: " + toString());
    }
    // check for sub-struct validity
    if (priv_ctrl != null) {
      priv_ctrl.validate();
    }
  }

  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, java.lang.ClassNotFoundException {
    try {
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
      __isset_bitfield = 0;
      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 TCheckAuthRequestStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TCheckAuthRequestStandardScheme getScheme() {
      return new TCheckAuthRequestStandardScheme();
    }
  }

  private static class TCheckAuthRequestStandardScheme extends org.apache.thrift.scheme.StandardScheme<TCheckAuthRequest> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, TCheckAuthRequest 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: // CLUSTER
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.cluster = iprot.readString();
              struct.setClusterIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // USER
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.user = iprot.readString();
              struct.setUserIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // 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;
          case 4: // USER_IP
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.user_ip = iprot.readString();
              struct.setUserIpIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // PRIV_CTRL
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.priv_ctrl = new TPrivilegeCtrl();
              struct.priv_ctrl.read(iprot);
              struct.setPrivCtrlIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // PRIV_TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.priv_type = org.apache.doris.thrift.TPrivilegeType.findByValue(iprot.readI32());
              struct.setPrivTypeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // THRIFT_RPC_TIMEOUT_MS
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.thrift_rpc_timeout_ms = iprot.readI64();
              struct.setThriftRpcTimeoutMsIsSet(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, TCheckAuthRequest struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.cluster != null) {
        if (struct.isSetCluster()) {
          oprot.writeFieldBegin(CLUSTER_FIELD_DESC);
          oprot.writeString(struct.cluster);
          oprot.writeFieldEnd();
        }
      }
      if (struct.user != null) {
        oprot.writeFieldBegin(USER_FIELD_DESC);
        oprot.writeString(struct.user);
        oprot.writeFieldEnd();
      }
      if (struct.passwd != null) {
        oprot.writeFieldBegin(PASSWD_FIELD_DESC);
        oprot.writeString(struct.passwd);
        oprot.writeFieldEnd();
      }
      if (struct.user_ip != null) {
        if (struct.isSetUserIp()) {
          oprot.writeFieldBegin(USER_IP_FIELD_DESC);
          oprot.writeString(struct.user_ip);
          oprot.writeFieldEnd();
        }
      }
      if (struct.priv_ctrl != null) {
        if (struct.isSetPrivCtrl()) {
          oprot.writeFieldBegin(PRIV_CTRL_FIELD_DESC);
          struct.priv_ctrl.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.priv_type != null) {
        if (struct.isSetPrivType()) {
          oprot.writeFieldBegin(PRIV_TYPE_FIELD_DESC);
          oprot.writeI32(struct.priv_type.getValue());
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetThriftRpcTimeoutMs()) {
        oprot.writeFieldBegin(THRIFT_RPC_TIMEOUT_MS_FIELD_DESC);
        oprot.writeI64(struct.thrift_rpc_timeout_ms);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

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

  private static class TCheckAuthRequestTupleScheme extends org.apache.thrift.scheme.TupleScheme<TCheckAuthRequest> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TCheckAuthRequest struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      oprot.writeString(struct.user);
      oprot.writeString(struct.passwd);
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetCluster()) {
        optionals.set(0);
      }
      if (struct.isSetUserIp()) {
        optionals.set(1);
      }
      if (struct.isSetPrivCtrl()) {
        optionals.set(2);
      }
      if (struct.isSetPrivType()) {
        optionals.set(3);
      }
      if (struct.isSetThriftRpcTimeoutMs()) {
        optionals.set(4);
      }
      oprot.writeBitSet(optionals, 5);
      if (struct.isSetCluster()) {
        oprot.writeString(struct.cluster);
      }
      if (struct.isSetUserIp()) {
        oprot.writeString(struct.user_ip);
      }
      if (struct.isSetPrivCtrl()) {
        struct.priv_ctrl.write(oprot);
      }
      if (struct.isSetPrivType()) {
        oprot.writeI32(struct.priv_type.getValue());
      }
      if (struct.isSetThriftRpcTimeoutMs()) {
        oprot.writeI64(struct.thrift_rpc_timeout_ms);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TCheckAuthRequest struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      struct.user = iprot.readString();
      struct.setUserIsSet(true);
      struct.passwd = iprot.readString();
      struct.setPasswdIsSet(true);
      java.util.BitSet incoming = iprot.readBitSet(5);
      if (incoming.get(0)) {
        struct.cluster = iprot.readString();
        struct.setClusterIsSet(true);
      }
      if (incoming.get(1)) {
        struct.user_ip = iprot.readString();
        struct.setUserIpIsSet(true);
      }
      if (incoming.get(2)) {
        struct.priv_ctrl = new TPrivilegeCtrl();
        struct.priv_ctrl.read(iprot);
        struct.setPrivCtrlIsSet(true);
      }
      if (incoming.get(3)) {
        struct.priv_type = org.apache.doris.thrift.TPrivilegeType.findByValue(iprot.readI32());
        struct.setPrivTypeIsSet(true);
      }
      if (incoming.get(4)) {
        struct.thrift_rpc_timeout_ms = iprot.readI64();
        struct.setThriftRpcTimeoutMsIsSet(true);
      }
    }
  }

  private static <S extends org.apache.thrift.scheme.IScheme> 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();
  }
}