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

  private static final org.apache.thrift.protocol.TField PROCESS_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("process_list", org.apache.thrift.protocol.TType.LIST, (short)1);

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

  public @org.apache.thrift.annotation.Nullable java.util.List<java.util.List<java.lang.String>> process_list; // 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 {
    PROCESS_LIST((short)1, "process_list");

    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: // PROCESS_LIST
          return PROCESS_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
  private static final _Fields optionals[] = {_Fields.PROCESS_LIST};
  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.PROCESS_LIST, new org.apache.thrift.meta_data.FieldMetaData("process_list", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            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(TShowProcessListResult.class, metaDataMap);
  }

  public TShowProcessListResult() {
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public TShowProcessListResult(TShowProcessListResult other) {
    if (other.isSetProcessList()) {
      java.util.List<java.util.List<java.lang.String>> __this__process_list = new java.util.ArrayList<java.util.List<java.lang.String>>(other.process_list.size());
      for (java.util.List<java.lang.String> other_element : other.process_list) {
        java.util.List<java.lang.String> __this__process_list_copy = new java.util.ArrayList<java.lang.String>(other_element);
        __this__process_list.add(__this__process_list_copy);
      }
      this.process_list = __this__process_list;
    }
  }

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

  @Override
  public void clear() {
    this.process_list = null;
  }

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

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

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

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

  public TShowProcessListResult setProcessList(@org.apache.thrift.annotation.Nullable java.util.List<java.util.List<java.lang.String>> process_list) {
    this.process_list = process_list;
    return this;
  }

  public void unsetProcessList() {
    this.process_list = null;
  }

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

  public void setProcessListIsSet(boolean value) {
    if (!value) {
      this.process_list = null;
    }
  }

  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case PROCESS_LIST:
      if (value == null) {
        unsetProcessList();
      } else {
        setProcessList((java.util.List<java.util.List<java.lang.String>>)value);
      }
      break;

    }
  }

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

    }
    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 PROCESS_LIST:
      return isSetProcessList();
    }
    throw new java.lang.IllegalStateException();
  }

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

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

    boolean this_present_process_list = true && this.isSetProcessList();
    boolean that_present_process_list = true && that.isSetProcessList();
    if (this_present_process_list || that_present_process_list) {
      if (!(this_present_process_list && that_present_process_list))
        return false;
      if (!this.process_list.equals(that.process_list))
        return false;
    }

    return true;
  }

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

    hashCode = hashCode * 8191 + ((isSetProcessList()) ? 131071 : 524287);
    if (isSetProcessList())
      hashCode = hashCode * 8191 + process_list.hashCode();

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetProcessList(), other.isSetProcessList());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetProcessList()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.process_list, other.process_list);
      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("TShowProcessListResult(");
    boolean first = true;

    if (isSetProcessList()) {
      sb.append("process_list:");
      if (this.process_list == null) {
        sb.append("null");
      } else {
        sb.append(this.process_list);
      }
      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, 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 TShowProcessListResultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TShowProcessListResultStandardScheme getScheme() {
      return new TShowProcessListResultStandardScheme();
    }
  }

  private static class TShowProcessListResultStandardScheme extends org.apache.thrift.scheme.StandardScheme<TShowProcessListResult> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, TShowProcessListResult 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: // PROCESS_LIST
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list872 = iprot.readListBegin();
                struct.process_list = new java.util.ArrayList<java.util.List<java.lang.String>>(_list872.size);
                @org.apache.thrift.annotation.Nullable java.util.List<java.lang.String> _elem873;
                for (int _i874 = 0; _i874 < _list872.size; ++_i874)
                {
                  {
                    org.apache.thrift.protocol.TList _list875 = iprot.readListBegin();
                    _elem873 = new java.util.ArrayList<java.lang.String>(_list875.size);
                    @org.apache.thrift.annotation.Nullable java.lang.String _elem876;
                    for (int _i877 = 0; _i877 < _list875.size; ++_i877)
                    {
                      _elem876 = iprot.readString();
                      _elem873.add(_elem876);
                    }
                    iprot.readListEnd();
                  }
                  struct.process_list.add(_elem873);
                }
                iprot.readListEnd();
              }
              struct.setProcessListIsSet(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, TShowProcessListResult struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.process_list != null) {
        if (struct.isSetProcessList()) {
          oprot.writeFieldBegin(PROCESS_LIST_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.LIST, struct.process_list.size()));
            for (java.util.List<java.lang.String> _iter878 : struct.process_list)
            {
              {
                oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, _iter878.size()));
                for (java.lang.String _iter879 : _iter878)
                {
                  oprot.writeString(_iter879);
                }
                oprot.writeListEnd();
              }
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

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

  private static class TShowProcessListResultTupleScheme extends org.apache.thrift.scheme.TupleScheme<TShowProcessListResult> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TShowProcessListResult 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.isSetProcessList()) {
        optionals.set(0);
      }
      oprot.writeBitSet(optionals, 1);
      if (struct.isSetProcessList()) {
        {
          oprot.writeI32(struct.process_list.size());
          for (java.util.List<java.lang.String> _iter880 : struct.process_list)
          {
            {
              oprot.writeI32(_iter880.size());
              for (java.lang.String _iter881 : _iter880)
              {
                oprot.writeString(_iter881);
              }
            }
          }
        }
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TShowProcessListResult struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet incoming = iprot.readBitSet(1);
      if (incoming.get(0)) {
        {
          org.apache.thrift.protocol.TList _list882 = iprot.readListBegin(org.apache.thrift.protocol.TType.LIST);
          struct.process_list = new java.util.ArrayList<java.util.List<java.lang.String>>(_list882.size);
          @org.apache.thrift.annotation.Nullable java.util.List<java.lang.String> _elem883;
          for (int _i884 = 0; _i884 < _list882.size; ++_i884)
          {
            {
              org.apache.thrift.protocol.TList _list885 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING);
              _elem883 = new java.util.ArrayList<java.lang.String>(_list885.size);
              @org.apache.thrift.annotation.Nullable java.lang.String _elem886;
              for (int _i887 = 0; _i887 < _list885.size; ++_i887)
              {
                _elem886 = iprot.readString();
                _elem883.add(_elem886);
              }
            }
            struct.process_list.add(_elem883);
          }
        }
        struct.setProcessListIsSet(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();
  }
}