TFrontendReportAliveSessionResult.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 TFrontendReportAliveSessionResult implements org.apache.thrift.TBase<TFrontendReportAliveSessionResult, TFrontendReportAliveSessionResult._Fields>, java.io.Serializable, Cloneable, Comparable<TFrontendReportAliveSessionResult> {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TFrontendReportAliveSessionResult");

  private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.I32, (short)1);
  private static final org.apache.thrift.protocol.TField MSG_FIELD_DESC = new org.apache.thrift.protocol.TField("msg", org.apache.thrift.protocol.TType.STRING, (short)2);
  private static final org.apache.thrift.protocol.TField SESSION_ID_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionIdList", org.apache.thrift.protocol.TType.LIST, (short)3);

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

  /**
   * 
   * @see org.apache.doris.thrift.TStatusCode
   */
  public @org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TStatusCode status; // required
  public @org.apache.thrift.annotation.Nullable java.lang.String msg; // required
  public @org.apache.thrift.annotation.Nullable java.util.List<java.lang.String> sessionIdList; // 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 {
    /**
     * 
     * @see org.apache.doris.thrift.TStatusCode
     */
    STATUS((short)1, "status"),
    MSG((short)2, "msg"),
    SESSION_ID_LIST((short)3, "sessionIdList");

    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: // STATUS
          return STATUS;
        case 2: // MSG
          return MSG;
        case 3: // SESSION_ID_LIST
          return SESSION_ID_LIST;
        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
  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.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, org.apache.doris.thrift.TStatusCode.class)));
    tmpMap.put(_Fields.MSG, new org.apache.thrift.meta_data.FieldMetaData("msg", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.SESSION_ID_LIST, new org.apache.thrift.meta_data.FieldMetaData("sessionIdList", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            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(TFrontendReportAliveSessionResult.class, metaDataMap);
  }

  public TFrontendReportAliveSessionResult() {
  }

  public TFrontendReportAliveSessionResult(
    org.apache.doris.thrift.TStatusCode status,
    java.lang.String msg,
    java.util.List<java.lang.String> sessionIdList)
  {
    this();
    this.status = status;
    this.msg = msg;
    this.sessionIdList = sessionIdList;
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public TFrontendReportAliveSessionResult(TFrontendReportAliveSessionResult other) {
    if (other.isSetStatus()) {
      this.status = other.status;
    }
    if (other.isSetMsg()) {
      this.msg = other.msg;
    }
    if (other.isSetSessionIdList()) {
      java.util.List<java.lang.String> __this__sessionIdList = new java.util.ArrayList<java.lang.String>(other.sessionIdList);
      this.sessionIdList = __this__sessionIdList;
    }
  }

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

  @Override
  public void clear() {
    this.status = null;
    this.msg = null;
    this.sessionIdList = null;
  }

  /**
   * 
   * @see org.apache.doris.thrift.TStatusCode
   */
  @org.apache.thrift.annotation.Nullable
  public org.apache.doris.thrift.TStatusCode getStatus() {
    return this.status;
  }

  /**
   * 
   * @see org.apache.doris.thrift.TStatusCode
   */
  public TFrontendReportAliveSessionResult setStatus(@org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TStatusCode status) {
    this.status = status;
    return this;
  }

  public void unsetStatus() {
    this.status = null;
  }

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

  public void setStatusIsSet(boolean value) {
    if (!value) {
      this.status = null;
    }
  }

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

  public TFrontendReportAliveSessionResult setMsg(@org.apache.thrift.annotation.Nullable java.lang.String msg) {
    this.msg = msg;
    return this;
  }

  public void unsetMsg() {
    this.msg = null;
  }

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

  public void setMsgIsSet(boolean value) {
    if (!value) {
      this.msg = null;
    }
  }

  public int getSessionIdListSize() {
    return (this.sessionIdList == null) ? 0 : this.sessionIdList.size();
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.Iterator<java.lang.String> getSessionIdListIterator() {
    return (this.sessionIdList == null) ? null : this.sessionIdList.iterator();
  }

  public void addToSessionIdList(java.lang.String elem) {
    if (this.sessionIdList == null) {
      this.sessionIdList = new java.util.ArrayList<java.lang.String>();
    }
    this.sessionIdList.add(elem);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.List<java.lang.String> getSessionIdList() {
    return this.sessionIdList;
  }

  public TFrontendReportAliveSessionResult setSessionIdList(@org.apache.thrift.annotation.Nullable java.util.List<java.lang.String> sessionIdList) {
    this.sessionIdList = sessionIdList;
    return this;
  }

  public void unsetSessionIdList() {
    this.sessionIdList = null;
  }

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

  public void setSessionIdListIsSet(boolean value) {
    if (!value) {
      this.sessionIdList = null;
    }
  }

  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case STATUS:
      if (value == null) {
        unsetStatus();
      } else {
        setStatus((org.apache.doris.thrift.TStatusCode)value);
      }
      break;

    case MSG:
      if (value == null) {
        unsetMsg();
      } else {
        setMsg((java.lang.String)value);
      }
      break;

    case SESSION_ID_LIST:
      if (value == null) {
        unsetSessionIdList();
      } else {
        setSessionIdList((java.util.List<java.lang.String>)value);
      }
      break;

    }
  }

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

    case MSG:
      return getMsg();

    case SESSION_ID_LIST:
      return getSessionIdList();

    }
    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 STATUS:
      return isSetStatus();
    case MSG:
      return isSetMsg();
    case SESSION_ID_LIST:
      return isSetSessionIdList();
    }
    throw new java.lang.IllegalStateException();
  }

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

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

    boolean this_present_status = true && this.isSetStatus();
    boolean that_present_status = true && that.isSetStatus();
    if (this_present_status || that_present_status) {
      if (!(this_present_status && that_present_status))
        return false;
      if (!this.status.equals(that.status))
        return false;
    }

    boolean this_present_msg = true && this.isSetMsg();
    boolean that_present_msg = true && that.isSetMsg();
    if (this_present_msg || that_present_msg) {
      if (!(this_present_msg && that_present_msg))
        return false;
      if (!this.msg.equals(that.msg))
        return false;
    }

    boolean this_present_sessionIdList = true && this.isSetSessionIdList();
    boolean that_present_sessionIdList = true && that.isSetSessionIdList();
    if (this_present_sessionIdList || that_present_sessionIdList) {
      if (!(this_present_sessionIdList && that_present_sessionIdList))
        return false;
      if (!this.sessionIdList.equals(that.sessionIdList))
        return false;
    }

    return true;
  }

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

    hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287);
    if (isSetStatus())
      hashCode = hashCode * 8191 + status.getValue();

    hashCode = hashCode * 8191 + ((isSetMsg()) ? 131071 : 524287);
    if (isSetMsg())
      hashCode = hashCode * 8191 + msg.hashCode();

    hashCode = hashCode * 8191 + ((isSetSessionIdList()) ? 131071 : 524287);
    if (isSetSessionIdList())
      hashCode = hashCode * 8191 + sessionIdList.hashCode();

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetStatus(), other.isSetStatus());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStatus()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetMsg(), other.isSetMsg());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMsg()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.msg, other.msg);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetSessionIdList(), other.isSetSessionIdList());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSessionIdList()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionIdList, other.sessionIdList);
      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("TFrontendReportAliveSessionResult(");
    boolean first = true;

    sb.append("status:");
    if (this.status == null) {
      sb.append("null");
    } else {
      sb.append(this.status);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("msg:");
    if (this.msg == null) {
      sb.append("null");
    } else {
      sb.append(this.msg);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("sessionIdList:");
    if (this.sessionIdList == null) {
      sb.append("null");
    } else {
      sb.append(this.sessionIdList);
    }
    first = false;
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    if (status == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' was not present! Struct: " + toString());
    }
    if (msg == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'msg' was not present! Struct: " + toString());
    }
    if (sessionIdList == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionIdList' was not present! Struct: " + toString());
    }
    // 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, java.lang.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 TFrontendReportAliveSessionResultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TFrontendReportAliveSessionResultStandardScheme getScheme() {
      return new TFrontendReportAliveSessionResultStandardScheme();
    }
  }

  private static class TFrontendReportAliveSessionResultStandardScheme extends org.apache.thrift.scheme.StandardScheme<TFrontendReportAliveSessionResult> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, TFrontendReportAliveSessionResult 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: // STATUS
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.status = org.apache.doris.thrift.TStatusCode.findByValue(iprot.readI32());
              struct.setStatusIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // MSG
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.msg = iprot.readString();
              struct.setMsgIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // SESSION_ID_LIST
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list450 = iprot.readListBegin();
                struct.sessionIdList = new java.util.ArrayList<java.lang.String>(_list450.size);
                @org.apache.thrift.annotation.Nullable java.lang.String _elem451;
                for (int _i452 = 0; _i452 < _list450.size; ++_i452)
                {
                  _elem451 = iprot.readString();
                  struct.sessionIdList.add(_elem451);
                }
                iprot.readListEnd();
              }
              struct.setSessionIdListIsSet(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, TFrontendReportAliveSessionResult struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.status != null) {
        oprot.writeFieldBegin(STATUS_FIELD_DESC);
        oprot.writeI32(struct.status.getValue());
        oprot.writeFieldEnd();
      }
      if (struct.msg != null) {
        oprot.writeFieldBegin(MSG_FIELD_DESC);
        oprot.writeString(struct.msg);
        oprot.writeFieldEnd();
      }
      if (struct.sessionIdList != null) {
        oprot.writeFieldBegin(SESSION_ID_LIST_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.sessionIdList.size()));
          for (java.lang.String _iter453 : struct.sessionIdList)
          {
            oprot.writeString(_iter453);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

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

  private static class TFrontendReportAliveSessionResultTupleScheme extends org.apache.thrift.scheme.TupleScheme<TFrontendReportAliveSessionResult> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TFrontendReportAliveSessionResult struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      oprot.writeI32(struct.status.getValue());
      oprot.writeString(struct.msg);
      {
        oprot.writeI32(struct.sessionIdList.size());
        for (java.lang.String _iter454 : struct.sessionIdList)
        {
          oprot.writeString(_iter454);
        }
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TFrontendReportAliveSessionResult struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      struct.status = org.apache.doris.thrift.TStatusCode.findByValue(iprot.readI32());
      struct.setStatusIsSet(true);
      struct.msg = iprot.readString();
      struct.setMsgIsSet(true);
      {
        org.apache.thrift.protocol.TList _list455 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING);
        struct.sessionIdList = new java.util.ArrayList<java.lang.String>(_list455.size);
        @org.apache.thrift.annotation.Nullable java.lang.String _elem456;
        for (int _i457 = 0; _i457 < _list455.size; ++_i457)
        {
          _elem456 = iprot.readString();
          struct.sessionIdList.add(_elem456);
        }
      }
      struct.setSessionIdListIsSet(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();
  }
}