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

  private static final org.apache.thrift.protocol.TField DIRECTORY_LOCATION_FIELD_DESC = new org.apache.thrift.protocol.TField("directory_location", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField FILE_NAMES_FIELD_DESC = new org.apache.thrift.protocol.TField("file_names", org.apache.thrift.protocol.TType.LIST, (short)2);

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

  public @org.apache.thrift.annotation.Nullable java.lang.String directory_location; // optional
  public @org.apache.thrift.annotation.Nullable java.util.List<java.lang.String> file_names; // 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 {
    DIRECTORY_LOCATION((short)1, "directory_location"),
    FILE_NAMES((short)2, "file_names");

    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: // DIRECTORY_LOCATION
          return DIRECTORY_LOCATION;
        case 2: // FILE_NAMES
          return FILE_NAMES;
        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.DIRECTORY_LOCATION,_Fields.FILE_NAMES};
  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.DIRECTORY_LOCATION, new org.apache.thrift.meta_data.FieldMetaData("directory_location", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.FILE_NAMES, new org.apache.thrift.meta_data.FieldMetaData("file_names", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        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(TTransactionalHiveDeleteDeltaDesc.class, metaDataMap);
  }

  public TTransactionalHiveDeleteDeltaDesc() {
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public TTransactionalHiveDeleteDeltaDesc(TTransactionalHiveDeleteDeltaDesc other) {
    if (other.isSetDirectoryLocation()) {
      this.directory_location = other.directory_location;
    }
    if (other.isSetFileNames()) {
      java.util.List<java.lang.String> __this__file_names = new java.util.ArrayList<java.lang.String>(other.file_names);
      this.file_names = __this__file_names;
    }
  }

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

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

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

  public TTransactionalHiveDeleteDeltaDesc setDirectoryLocation(@org.apache.thrift.annotation.Nullable java.lang.String directory_location) {
    this.directory_location = directory_location;
    return this;
  }

  public void unsetDirectoryLocation() {
    this.directory_location = null;
  }

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

  public void setDirectoryLocationIsSet(boolean value) {
    if (!value) {
      this.directory_location = null;
    }
  }

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

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

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

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

  public TTransactionalHiveDeleteDeltaDesc setFileNames(@org.apache.thrift.annotation.Nullable java.util.List<java.lang.String> file_names) {
    this.file_names = file_names;
    return this;
  }

  public void unsetFileNames() {
    this.file_names = null;
  }

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

  public void setFileNamesIsSet(boolean value) {
    if (!value) {
      this.file_names = null;
    }
  }

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

    case FILE_NAMES:
      if (value == null) {
        unsetFileNames();
      } else {
        setFileNames((java.util.List<java.lang.String>)value);
      }
      break;

    }
  }

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

    case FILE_NAMES:
      return getFileNames();

    }
    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 DIRECTORY_LOCATION:
      return isSetDirectoryLocation();
    case FILE_NAMES:
      return isSetFileNames();
    }
    throw new java.lang.IllegalStateException();
  }

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

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

    boolean this_present_directory_location = true && this.isSetDirectoryLocation();
    boolean that_present_directory_location = true && that.isSetDirectoryLocation();
    if (this_present_directory_location || that_present_directory_location) {
      if (!(this_present_directory_location && that_present_directory_location))
        return false;
      if (!this.directory_location.equals(that.directory_location))
        return false;
    }

    boolean this_present_file_names = true && this.isSetFileNames();
    boolean that_present_file_names = true && that.isSetFileNames();
    if (this_present_file_names || that_present_file_names) {
      if (!(this_present_file_names && that_present_file_names))
        return false;
      if (!this.file_names.equals(that.file_names))
        return false;
    }

    return true;
  }

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

    hashCode = hashCode * 8191 + ((isSetDirectoryLocation()) ? 131071 : 524287);
    if (isSetDirectoryLocation())
      hashCode = hashCode * 8191 + directory_location.hashCode();

    hashCode = hashCode * 8191 + ((isSetFileNames()) ? 131071 : 524287);
    if (isSetFileNames())
      hashCode = hashCode * 8191 + file_names.hashCode();

    return hashCode;
  }

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

    int lastComparison = 0;

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

    if (isSetDirectoryLocation()) {
      sb.append("directory_location:");
      if (this.directory_location == null) {
        sb.append("null");
      } else {
        sb.append(this.directory_location);
      }
      first = false;
    }
    if (isSetFileNames()) {
      if (!first) sb.append(", ");
      sb.append("file_names:");
      if (this.file_names == null) {
        sb.append("null");
      } else {
        sb.append(this.file_names);
      }
      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 TTransactionalHiveDeleteDeltaDescStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TTransactionalHiveDeleteDeltaDescStandardScheme getScheme() {
      return new TTransactionalHiveDeleteDeltaDescStandardScheme();
    }
  }

  private static class TTransactionalHiveDeleteDeltaDescStandardScheme extends org.apache.thrift.scheme.StandardScheme<TTransactionalHiveDeleteDeltaDesc> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, TTransactionalHiveDeleteDeltaDesc 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: // DIRECTORY_LOCATION
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.directory_location = iprot.readString();
              struct.setDirectoryLocationIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // FILE_NAMES
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list204 = iprot.readListBegin();
                struct.file_names = new java.util.ArrayList<java.lang.String>(_list204.size);
                @org.apache.thrift.annotation.Nullable java.lang.String _elem205;
                for (int _i206 = 0; _i206 < _list204.size; ++_i206)
                {
                  _elem205 = iprot.readString();
                  struct.file_names.add(_elem205);
                }
                iprot.readListEnd();
              }
              struct.setFileNamesIsSet(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, TTransactionalHiveDeleteDeltaDesc struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.directory_location != null) {
        if (struct.isSetDirectoryLocation()) {
          oprot.writeFieldBegin(DIRECTORY_LOCATION_FIELD_DESC);
          oprot.writeString(struct.directory_location);
          oprot.writeFieldEnd();
        }
      }
      if (struct.file_names != null) {
        if (struct.isSetFileNames()) {
          oprot.writeFieldBegin(FILE_NAMES_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.file_names.size()));
            for (java.lang.String _iter207 : struct.file_names)
            {
              oprot.writeString(_iter207);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

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

  private static class TTransactionalHiveDeleteDeltaDescTupleScheme extends org.apache.thrift.scheme.TupleScheme<TTransactionalHiveDeleteDeltaDesc> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TTransactionalHiveDeleteDeltaDesc 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.isSetDirectoryLocation()) {
        optionals.set(0);
      }
      if (struct.isSetFileNames()) {
        optionals.set(1);
      }
      oprot.writeBitSet(optionals, 2);
      if (struct.isSetDirectoryLocation()) {
        oprot.writeString(struct.directory_location);
      }
      if (struct.isSetFileNames()) {
        {
          oprot.writeI32(struct.file_names.size());
          for (java.lang.String _iter208 : struct.file_names)
          {
            oprot.writeString(_iter208);
          }
        }
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TTransactionalHiveDeleteDeltaDesc struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet incoming = iprot.readBitSet(2);
      if (incoming.get(0)) {
        struct.directory_location = iprot.readString();
        struct.setDirectoryLocationIsSet(true);
      }
      if (incoming.get(1)) {
        {
          org.apache.thrift.protocol.TList _list209 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING);
          struct.file_names = new java.util.ArrayList<java.lang.String>(_list209.size);
          @org.apache.thrift.annotation.Nullable java.lang.String _elem210;
          for (int _i211 = 0; _i211 < _list209.size; ++_i211)
          {
            _elem210 = iprot.readString();
            struct.file_names.add(_elem210);
          }
        }
        struct.setFileNamesIsSet(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();
  }
}