TPaimonCatalogEnvironment.java

/**
 * Autogenerated by Thrift Compiler (0.24.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"})
public class TPaimonCatalogEnvironment implements org.apache.thrift.TBase<TPaimonCatalogEnvironment, TPaimonCatalogEnvironment._Fields>, java.io.Serializable, Cloneable, Comparable<TPaimonCatalogEnvironment> {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TPaimonCatalogEnvironment");

  private static final org.apache.thrift.protocol.TField DATABASE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("database_name", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField OBJECT_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("object_name", org.apache.thrift.protocol.TType.STRING, (short)2);
  private static final org.apache.thrift.protocol.TField UUID_FIELD_DESC = new org.apache.thrift.protocol.TField("uuid", org.apache.thrift.protocol.TType.STRING, (short)3);
  private static final org.apache.thrift.protocol.TField SNAPSHOT_LOADER_FIELD_DESC = new org.apache.thrift.protocol.TField("snapshot_loader", org.apache.thrift.protocol.TType.BOOL, (short)4);
  private static final org.apache.thrift.protocol.TField VERSION_MANAGEMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("version_management", org.apache.thrift.protocol.TType.BOOL, (short)5);
  private static final org.apache.thrift.protocol.TField REST_TOKEN_ENABLED_FIELD_DESC = new org.apache.thrift.protocol.TField("rest_token_enabled", org.apache.thrift.protocol.TType.BOOL, (short)6);

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

  public @org.apache.thrift.annotation.Nullable java.lang.String database_name; // required
  public @org.apache.thrift.annotation.Nullable java.lang.String object_name; // required
  public @org.apache.thrift.annotation.Nullable java.lang.String uuid; // optional
  public boolean snapshot_loader; // optional
  public boolean version_management; // optional
  public boolean rest_token_enabled; // 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 {
    DATABASE_NAME((short)1, "database_name"),
    OBJECT_NAME((short)2, "object_name"),
    UUID((short)3, "uuid"),
    SNAPSHOT_LOADER((short)4, "snapshot_loader"),
    VERSION_MANAGEMENT((short)5, "version_management"),
    REST_TOKEN_ENABLED((short)6, "rest_token_enabled");

    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: // DATABASE_NAME
          return DATABASE_NAME;
        case 2: // OBJECT_NAME
          return OBJECT_NAME;
        case 3: // UUID
          return UUID;
        case 4: // SNAPSHOT_LOADER
          return SNAPSHOT_LOADER;
        case 5: // VERSION_MANAGEMENT
          return VERSION_MANAGEMENT;
        case 6: // REST_TOKEN_ENABLED
          return REST_TOKEN_ENABLED;
        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;
    }

    @Override
    public short getThriftFieldId() {
      return _thriftId;
    }

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

  // isset id assignments
  private static final int __SNAPSHOT_LOADER_ISSET_ID = 0;
  private static final int __VERSION_MANAGEMENT_ISSET_ID = 1;
  private static final int __REST_TOKEN_ENABLED_ISSET_ID = 2;
  private byte __isset_bitfield = 0;
  private static final _Fields[] optionals = {_Fields.UUID,_Fields.SNAPSHOT_LOADER,_Fields.VERSION_MANAGEMENT,_Fields.REST_TOKEN_ENABLED};
  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.DATABASE_NAME, new org.apache.thrift.meta_data.FieldMetaData("database_name", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.OBJECT_NAME, new org.apache.thrift.meta_data.FieldMetaData("object_name", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.UUID, new org.apache.thrift.meta_data.FieldMetaData("uuid", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.SNAPSHOT_LOADER, new org.apache.thrift.meta_data.FieldMetaData("snapshot_loader", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.VERSION_MANAGEMENT, new org.apache.thrift.meta_data.FieldMetaData("version_management", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.REST_TOKEN_ENABLED, new org.apache.thrift.meta_data.FieldMetaData("rest_token_enabled", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TPaimonCatalogEnvironment.class, metaDataMap);
  }

  public TPaimonCatalogEnvironment() {
    this.snapshot_loader = false;

    this.version_management = false;

    this.rest_token_enabled = false;

  }

  public TPaimonCatalogEnvironment(
    java.lang.String database_name,
    java.lang.String object_name)
  {
    this();
    this.database_name = database_name;
    this.object_name = object_name;
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public TPaimonCatalogEnvironment(TPaimonCatalogEnvironment other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetDatabaseName()) {
      this.database_name = other.database_name;
    }
    if (other.isSetObjectName()) {
      this.object_name = other.object_name;
    }
    if (other.isSetUuid()) {
      this.uuid = other.uuid;
    }
    this.snapshot_loader = other.snapshot_loader;
    this.version_management = other.version_management;
    this.rest_token_enabled = other.rest_token_enabled;
  }

  @Override
  public TPaimonCatalogEnvironment deepCopy() {
    return new TPaimonCatalogEnvironment(this);
  }

  @Override
  public void clear() {
    this.database_name = null;
    this.object_name = null;
    this.uuid = null;
    this.snapshot_loader = false;

    this.version_management = false;

    this.rest_token_enabled = false;

  }

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

  public TPaimonCatalogEnvironment setDatabaseName(@org.apache.thrift.annotation.Nullable java.lang.String database_name) {
    this.database_name = database_name;
    return this;
  }

  public void unsetDatabaseName() {
    this.database_name = null;
  }

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

  public void setDatabaseNameIsSet(boolean value) {
    if (!value) {
      this.database_name = null;
    }
  }

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

  public TPaimonCatalogEnvironment setObjectName(@org.apache.thrift.annotation.Nullable java.lang.String object_name) {
    this.object_name = object_name;
    return this;
  }

  public void unsetObjectName() {
    this.object_name = null;
  }

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

  public void setObjectNameIsSet(boolean value) {
    if (!value) {
      this.object_name = null;
    }
  }

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

  public TPaimonCatalogEnvironment setUuid(@org.apache.thrift.annotation.Nullable java.lang.String uuid) {
    this.uuid = uuid;
    return this;
  }

  public void unsetUuid() {
    this.uuid = null;
  }

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

  public void setUuidIsSet(boolean value) {
    if (!value) {
      this.uuid = null;
    }
  }

  public boolean isSnapshotLoader() {
    return this.snapshot_loader;
  }

  public TPaimonCatalogEnvironment setSnapshotLoader(boolean snapshot_loader) {
    this.snapshot_loader = snapshot_loader;
    setSnapshotLoaderIsSet(true);
    return this;
  }

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

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

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

  public boolean isVersionManagement() {
    return this.version_management;
  }

  public TPaimonCatalogEnvironment setVersionManagement(boolean version_management) {
    this.version_management = version_management;
    setVersionManagementIsSet(true);
    return this;
  }

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

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

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

  public boolean isRestTokenEnabled() {
    return this.rest_token_enabled;
  }

  public TPaimonCatalogEnvironment setRestTokenEnabled(boolean rest_token_enabled) {
    this.rest_token_enabled = rest_token_enabled;
    setRestTokenEnabledIsSet(true);
    return this;
  }

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

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

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

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

    case OBJECT_NAME:
      if (value == null) {
        unsetObjectName();
      } else {
        setObjectName((java.lang.String)value);
      }
      break;

    case UUID:
      if (value == null) {
        unsetUuid();
      } else {
        setUuid((java.lang.String)value);
      }
      break;

    case SNAPSHOT_LOADER:
      if (value == null) {
        unsetSnapshotLoader();
      } else {
        setSnapshotLoader((java.lang.Boolean)value);
      }
      break;

    case VERSION_MANAGEMENT:
      if (value == null) {
        unsetVersionManagement();
      } else {
        setVersionManagement((java.lang.Boolean)value);
      }
      break;

    case REST_TOKEN_ENABLED:
      if (value == null) {
        unsetRestTokenEnabled();
      } else {
        setRestTokenEnabled((java.lang.Boolean)value);
      }
      break;

    }
  }

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

    case OBJECT_NAME:
      return getObjectName();

    case UUID:
      return getUuid();

    case SNAPSHOT_LOADER:
      return isSnapshotLoader();

    case VERSION_MANAGEMENT:
      return isVersionManagement();

    case REST_TOKEN_ENABLED:
      return isRestTokenEnabled();

    }
    throw new java.lang.IllegalStateException();
  }

  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
  @Override
  public boolean isSet(_Fields field) {
    if (field == null) {
      throw new java.lang.IllegalArgumentException();
    }

    switch (field) {
    case DATABASE_NAME:
      return isSetDatabaseName();
    case OBJECT_NAME:
      return isSetObjectName();
    case UUID:
      return isSetUuid();
    case SNAPSHOT_LOADER:
      return isSetSnapshotLoader();
    case VERSION_MANAGEMENT:
      return isSetVersionManagement();
    case REST_TOKEN_ENABLED:
      return isSetRestTokenEnabled();
    }
    throw new java.lang.IllegalStateException();
  }

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

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

    boolean this_present_database_name = true && this.isSetDatabaseName();
    boolean that_present_database_name = true && that.isSetDatabaseName();
    if (this_present_database_name || that_present_database_name) {
      if (!(this_present_database_name && that_present_database_name))
        return false;
      if (!this.database_name.equals(that.database_name))
        return false;
    }

    boolean this_present_object_name = true && this.isSetObjectName();
    boolean that_present_object_name = true && that.isSetObjectName();
    if (this_present_object_name || that_present_object_name) {
      if (!(this_present_object_name && that_present_object_name))
        return false;
      if (!this.object_name.equals(that.object_name))
        return false;
    }

    boolean this_present_uuid = true && this.isSetUuid();
    boolean that_present_uuid = true && that.isSetUuid();
    if (this_present_uuid || that_present_uuid) {
      if (!(this_present_uuid && that_present_uuid))
        return false;
      if (!this.uuid.equals(that.uuid))
        return false;
    }

    boolean this_present_snapshot_loader = true && this.isSetSnapshotLoader();
    boolean that_present_snapshot_loader = true && that.isSetSnapshotLoader();
    if (this_present_snapshot_loader || that_present_snapshot_loader) {
      if (!(this_present_snapshot_loader && that_present_snapshot_loader))
        return false;
      if (this.snapshot_loader != that.snapshot_loader)
        return false;
    }

    boolean this_present_version_management = true && this.isSetVersionManagement();
    boolean that_present_version_management = true && that.isSetVersionManagement();
    if (this_present_version_management || that_present_version_management) {
      if (!(this_present_version_management && that_present_version_management))
        return false;
      if (this.version_management != that.version_management)
        return false;
    }

    boolean this_present_rest_token_enabled = true && this.isSetRestTokenEnabled();
    boolean that_present_rest_token_enabled = true && that.isSetRestTokenEnabled();
    if (this_present_rest_token_enabled || that_present_rest_token_enabled) {
      if (!(this_present_rest_token_enabled && that_present_rest_token_enabled))
        return false;
      if (this.rest_token_enabled != that.rest_token_enabled)
        return false;
    }

    return true;
  }

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

    hashCode = hashCode * 8191 + ((isSetDatabaseName()) ? 131071 : 524287);
    if (isSetDatabaseName())
      hashCode = hashCode * 8191 + database_name.hashCode();

    hashCode = hashCode * 8191 + ((isSetObjectName()) ? 131071 : 524287);
    if (isSetObjectName())
      hashCode = hashCode * 8191 + object_name.hashCode();

    hashCode = hashCode * 8191 + ((isSetUuid()) ? 131071 : 524287);
    if (isSetUuid())
      hashCode = hashCode * 8191 + uuid.hashCode();

    hashCode = hashCode * 8191 + ((isSetSnapshotLoader()) ? 131071 : 524287);
    if (isSetSnapshotLoader())
      hashCode = hashCode * 8191 + ((snapshot_loader) ? 131071 : 524287);

    hashCode = hashCode * 8191 + ((isSetVersionManagement()) ? 131071 : 524287);
    if (isSetVersionManagement())
      hashCode = hashCode * 8191 + ((version_management) ? 131071 : 524287);

    hashCode = hashCode * 8191 + ((isSetRestTokenEnabled()) ? 131071 : 524287);
    if (isSetRestTokenEnabled())
      hashCode = hashCode * 8191 + ((rest_token_enabled) ? 131071 : 524287);

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetDatabaseName(), other.isSetDatabaseName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDatabaseName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.database_name, other.database_name);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetObjectName(), other.isSetObjectName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetObjectName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.object_name, other.object_name);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetUuid(), other.isSetUuid());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUuid()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uuid, other.uuid);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetSnapshotLoader(), other.isSetSnapshotLoader());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSnapshotLoader()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.snapshot_loader, other.snapshot_loader);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetVersionManagement(), other.isSetVersionManagement());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetVersionManagement()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.version_management, other.version_management);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetRestTokenEnabled(), other.isSetRestTokenEnabled());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRestTokenEnabled()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rest_token_enabled, other.rest_token_enabled);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  @org.apache.thrift.annotation.Nullable
  @Override
  public _Fields fieldForId(int fieldId) {
    return _Fields.findByThriftId(fieldId);
  }

  @Override
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    scheme(iprot).read(iprot, this);
  }

  @Override
  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("TPaimonCatalogEnvironment(");
    boolean first = true;

    sb.append("database_name:");
    if (this.database_name == null) {
      sb.append("null");
    } else {
      sb.append(this.database_name);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("object_name:");
    if (this.object_name == null) {
      sb.append("null");
    } else {
      sb.append(this.object_name);
    }
    first = false;
    if (isSetUuid()) {
      if (!first) sb.append(", ");
      sb.append("uuid:");
      if (this.uuid == null) {
        sb.append("null");
      } else {
        sb.append(this.uuid);
      }
      first = false;
    }
    if (isSetSnapshotLoader()) {
      if (!first) sb.append(", ");
      sb.append("snapshot_loader:");
      sb.append(this.snapshot_loader);
      first = false;
    }
    if (isSetVersionManagement()) {
      if (!first) sb.append(", ");
      sb.append("version_management:");
      sb.append(this.version_management);
      first = false;
    }
    if (isSetRestTokenEnabled()) {
      if (!first) sb.append(", ");
      sb.append("rest_token_enabled:");
      sb.append(this.rest_token_enabled);
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    if (database_name == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'database_name' was not present! Struct: " + toString());
    }
    if (object_name == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'object_name' 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 {
      // 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 TPaimonCatalogEnvironmentStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    @Override
    public TPaimonCatalogEnvironmentStandardScheme getScheme() {
      return new TPaimonCatalogEnvironmentStandardScheme();
    }
  }

  private static class TPaimonCatalogEnvironmentStandardScheme extends org.apache.thrift.scheme.StandardScheme<TPaimonCatalogEnvironment> {

    @Override
    public void read(org.apache.thrift.protocol.TProtocol iprot, TPaimonCatalogEnvironment struct) throws org.apache.thrift.TException {
      iprot.incrementRecursionDepth();
      try {
        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: // DATABASE_NAME
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.database_name = iprot.readString();
                struct.setDatabaseNameIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // OBJECT_NAME
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.object_name = iprot.readString();
                struct.setObjectNameIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // UUID
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.uuid = iprot.readString();
                struct.setUuidIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // SNAPSHOT_LOADER
              if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
                struct.snapshot_loader = iprot.readBool();
                struct.setSnapshotLoaderIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 5: // VERSION_MANAGEMENT
              if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
                struct.version_management = iprot.readBool();
                struct.setVersionManagementIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 6: // REST_TOKEN_ENABLED
              if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
                struct.rest_token_enabled = iprot.readBool();
                struct.setRestTokenEnabledIsSet(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();
      } finally {
        iprot.decrementRecursionDepth();
      }
    }

    @Override
    public void write(org.apache.thrift.protocol.TProtocol oprot, TPaimonCatalogEnvironment struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.database_name != null) {
        oprot.writeFieldBegin(DATABASE_NAME_FIELD_DESC);
        oprot.writeString(struct.database_name);
        oprot.writeFieldEnd();
      }
      if (struct.object_name != null) {
        oprot.writeFieldBegin(OBJECT_NAME_FIELD_DESC);
        oprot.writeString(struct.object_name);
        oprot.writeFieldEnd();
      }
      if (struct.uuid != null) {
        if (struct.isSetUuid()) {
          oprot.writeFieldBegin(UUID_FIELD_DESC);
          oprot.writeString(struct.uuid);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetSnapshotLoader()) {
        oprot.writeFieldBegin(SNAPSHOT_LOADER_FIELD_DESC);
        oprot.writeBool(struct.snapshot_loader);
        oprot.writeFieldEnd();
      }
      if (struct.isSetVersionManagement()) {
        oprot.writeFieldBegin(VERSION_MANAGEMENT_FIELD_DESC);
        oprot.writeBool(struct.version_management);
        oprot.writeFieldEnd();
      }
      if (struct.isSetRestTokenEnabled()) {
        oprot.writeFieldBegin(REST_TOKEN_ENABLED_FIELD_DESC);
        oprot.writeBool(struct.rest_token_enabled);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class TPaimonCatalogEnvironmentTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    @Override
    public TPaimonCatalogEnvironmentTupleScheme getScheme() {
      return new TPaimonCatalogEnvironmentTupleScheme();
    }
  }

  private static class TPaimonCatalogEnvironmentTupleScheme extends org.apache.thrift.scheme.TupleScheme<TPaimonCatalogEnvironment> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TPaimonCatalogEnvironment struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      oprot.writeString(struct.database_name);
      oprot.writeString(struct.object_name);
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetUuid()) {
        optionals.set(0);
      }
      if (struct.isSetSnapshotLoader()) {
        optionals.set(1);
      }
      if (struct.isSetVersionManagement()) {
        optionals.set(2);
      }
      if (struct.isSetRestTokenEnabled()) {
        optionals.set(3);
      }
      oprot.writeBitSet(optionals, 4);
      if (struct.isSetUuid()) {
        oprot.writeString(struct.uuid);
      }
      if (struct.isSetSnapshotLoader()) {
        oprot.writeBool(struct.snapshot_loader);
      }
      if (struct.isSetVersionManagement()) {
        oprot.writeBool(struct.version_management);
      }
      if (struct.isSetRestTokenEnabled()) {
        oprot.writeBool(struct.rest_token_enabled);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TPaimonCatalogEnvironment struct) throws org.apache.thrift.TException {
      prot.incrementRecursionDepth();
      try {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        struct.database_name = iprot.readString();
        struct.setDatabaseNameIsSet(true);
        struct.object_name = iprot.readString();
        struct.setObjectNameIsSet(true);
        java.util.BitSet incoming = iprot.readBitSet(4);
        if (incoming.get(0)) {
          struct.uuid = iprot.readString();
          struct.setUuidIsSet(true);
        }
        if (incoming.get(1)) {
          struct.snapshot_loader = iprot.readBool();
          struct.setSnapshotLoaderIsSet(true);
        }
        if (incoming.get(2)) {
          struct.version_management = iprot.readBool();
          struct.setVersionManagementIsSet(true);
        }
        if (incoming.get(3)) {
          struct.rest_token_enabled = iprot.readBool();
          struct.setRestTokenEnabledIsSet(true);
        }
      } finally {
        prot.decrementRecursionDepth();
      }
    }
  }

  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();
  }
}