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

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

  private static final org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TField CATALOG_NAME_FIELD_DESC = new org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TField("catalogName", org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TField CATALOG_TYPE_FIELD_DESC = new org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TField("catalogType", org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.STRING, (short)2);
  private static final org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TField STORAGE_CONFIGS_FIELD_DESC = new org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TField("storageConfigs", org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.MAP, (short)3);
  private static final org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TField AUTH_CONFIGS_FIELD_DESC = new org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TField("authConfigs", org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.MAP, (short)4);
  private static final org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TField CATALOG_PROPERTIES_FIELD_DESC = new org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TField("catalogProperties", org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.MAP, (short)5);

  private static final org.apache.amoro.shade.thrift.org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new CatalogMetaStandardSchemeFactory();
  private static final org.apache.amoro.shade.thrift.org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new CatalogMetaTupleSchemeFactory();

  public @org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable java.lang.String catalogName; // required
  public @org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable java.lang.String catalogType; // required
  public @org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.lang.String> storageConfigs; // required
  public @org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.lang.String> authConfigs; // required
  public @org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.lang.String> catalogProperties; // required

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.amoro.shade.thrift.org.apache.thrift.TFieldIdEnum {
    CATALOG_NAME((short)1, "catalogName"),
    CATALOG_TYPE((short)2, "catalogType"),
    STORAGE_CONFIGS((short)3, "storageConfigs"),
    AUTH_CONFIGS((short)4, "authConfigs"),
    CATALOG_PROPERTIES((short)5, "catalogProperties");

    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.amoro.shade.thrift.org.apache.thrift.annotation.Nullable
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // CATALOG_NAME
          return CATALOG_NAME;
        case 2: // CATALOG_TYPE
          return CATALOG_TYPE;
        case 3: // STORAGE_CONFIGS
          return STORAGE_CONFIGS;
        case 4: // AUTH_CONFIGS
          return AUTH_CONFIGS;
        case 5: // CATALOG_PROPERTIES
          return CATALOG_PROPERTIES;
        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.amoro.shade.thrift.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
  public static final java.util.Map<_Fields, org.apache.amoro.shade.thrift.org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    java.util.Map<_Fields, org.apache.amoro.shade.thrift.org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.amoro.shade.thrift.org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.CATALOG_NAME, new org.apache.amoro.shade.thrift.org.apache.thrift.meta_data.FieldMetaData("catalogName", org.apache.amoro.shade.thrift.org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.amoro.shade.thrift.org.apache.thrift.meta_data.FieldValueMetaData(org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.CATALOG_TYPE, new org.apache.amoro.shade.thrift.org.apache.thrift.meta_data.FieldMetaData("catalogType", org.apache.amoro.shade.thrift.org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.amoro.shade.thrift.org.apache.thrift.meta_data.FieldValueMetaData(org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.STORAGE_CONFIGS, new org.apache.amoro.shade.thrift.org.apache.thrift.meta_data.FieldMetaData("storageConfigs", org.apache.amoro.shade.thrift.org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.amoro.shade.thrift.org.apache.thrift.meta_data.MapMetaData(org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.MAP, 
            new org.apache.amoro.shade.thrift.org.apache.thrift.meta_data.FieldValueMetaData(org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.STRING), 
            new org.apache.amoro.shade.thrift.org.apache.thrift.meta_data.FieldValueMetaData(org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.STRING))));
    tmpMap.put(_Fields.AUTH_CONFIGS, new org.apache.amoro.shade.thrift.org.apache.thrift.meta_data.FieldMetaData("authConfigs", org.apache.amoro.shade.thrift.org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.amoro.shade.thrift.org.apache.thrift.meta_data.MapMetaData(org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.MAP, 
            new org.apache.amoro.shade.thrift.org.apache.thrift.meta_data.FieldValueMetaData(org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.STRING), 
            new org.apache.amoro.shade.thrift.org.apache.thrift.meta_data.FieldValueMetaData(org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.STRING))));
    tmpMap.put(_Fields.CATALOG_PROPERTIES, new org.apache.amoro.shade.thrift.org.apache.thrift.meta_data.FieldMetaData("catalogProperties", org.apache.amoro.shade.thrift.org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.amoro.shade.thrift.org.apache.thrift.meta_data.MapMetaData(org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.MAP, 
            new org.apache.amoro.shade.thrift.org.apache.thrift.meta_data.FieldValueMetaData(org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.STRING), 
            new org.apache.amoro.shade.thrift.org.apache.thrift.meta_data.FieldValueMetaData(org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.STRING))));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.amoro.shade.thrift.org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CatalogMeta.class, metaDataMap);
  }

  public CatalogMeta() {
  }

  public CatalogMeta(
    java.lang.String catalogName,
    java.lang.String catalogType,
    java.util.Map<java.lang.String,java.lang.String> storageConfigs,
    java.util.Map<java.lang.String,java.lang.String> authConfigs,
    java.util.Map<java.lang.String,java.lang.String> catalogProperties)
  {
    this();
    this.catalogName = catalogName;
    this.catalogType = catalogType;
    this.storageConfigs = storageConfigs;
    this.authConfigs = authConfigs;
    this.catalogProperties = catalogProperties;
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public CatalogMeta(CatalogMeta other) {
    if (other.isSetCatalogName()) {
      this.catalogName = other.catalogName;
    }
    if (other.isSetCatalogType()) {
      this.catalogType = other.catalogType;
    }
    if (other.isSetStorageConfigs()) {
      java.util.Map<java.lang.String,java.lang.String> __this__storageConfigs = new java.util.HashMap<java.lang.String,java.lang.String>(other.storageConfigs);
      this.storageConfigs = __this__storageConfigs;
    }
    if (other.isSetAuthConfigs()) {
      java.util.Map<java.lang.String,java.lang.String> __this__authConfigs = new java.util.HashMap<java.lang.String,java.lang.String>(other.authConfigs);
      this.authConfigs = __this__authConfigs;
    }
    if (other.isSetCatalogProperties()) {
      java.util.Map<java.lang.String,java.lang.String> __this__catalogProperties = new java.util.HashMap<java.lang.String,java.lang.String>(other.catalogProperties);
      this.catalogProperties = __this__catalogProperties;
    }
  }

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

  @Override
  public void clear() {
    this.catalogName = null;
    this.catalogType = null;
    this.storageConfigs = null;
    this.authConfigs = null;
    this.catalogProperties = null;
  }

  @org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable
  public java.lang.String getCatalogName() {
    return this.catalogName;
  }

  public CatalogMeta setCatalogName(@org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable java.lang.String catalogName) {
    this.catalogName = catalogName;
    return this;
  }

  public void unsetCatalogName() {
    this.catalogName = null;
  }

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

  public void setCatalogNameIsSet(boolean value) {
    if (!value) {
      this.catalogName = null;
    }
  }

  @org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable
  public java.lang.String getCatalogType() {
    return this.catalogType;
  }

  public CatalogMeta setCatalogType(@org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable java.lang.String catalogType) {
    this.catalogType = catalogType;
    return this;
  }

  public void unsetCatalogType() {
    this.catalogType = null;
  }

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

  public void setCatalogTypeIsSet(boolean value) {
    if (!value) {
      this.catalogType = null;
    }
  }

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

  public void putToStorageConfigs(java.lang.String key, java.lang.String val) {
    if (this.storageConfigs == null) {
      this.storageConfigs = new java.util.HashMap<java.lang.String,java.lang.String>();
    }
    this.storageConfigs.put(key, val);
  }

  @org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable
  public java.util.Map<java.lang.String,java.lang.String> getStorageConfigs() {
    return this.storageConfigs;
  }

  public CatalogMeta setStorageConfigs(@org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.lang.String> storageConfigs) {
    this.storageConfigs = storageConfigs;
    return this;
  }

  public void unsetStorageConfigs() {
    this.storageConfigs = null;
  }

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

  public void setStorageConfigsIsSet(boolean value) {
    if (!value) {
      this.storageConfigs = null;
    }
  }

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

  public void putToAuthConfigs(java.lang.String key, java.lang.String val) {
    if (this.authConfigs == null) {
      this.authConfigs = new java.util.HashMap<java.lang.String,java.lang.String>();
    }
    this.authConfigs.put(key, val);
  }

  @org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable
  public java.util.Map<java.lang.String,java.lang.String> getAuthConfigs() {
    return this.authConfigs;
  }

  public CatalogMeta setAuthConfigs(@org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.lang.String> authConfigs) {
    this.authConfigs = authConfigs;
    return this;
  }

  public void unsetAuthConfigs() {
    this.authConfigs = null;
  }

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

  public void setAuthConfigsIsSet(boolean value) {
    if (!value) {
      this.authConfigs = null;
    }
  }

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

  public void putToCatalogProperties(java.lang.String key, java.lang.String val) {
    if (this.catalogProperties == null) {
      this.catalogProperties = new java.util.HashMap<java.lang.String,java.lang.String>();
    }
    this.catalogProperties.put(key, val);
  }

  @org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable
  public java.util.Map<java.lang.String,java.lang.String> getCatalogProperties() {
    return this.catalogProperties;
  }

  public CatalogMeta setCatalogProperties(@org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.lang.String> catalogProperties) {
    this.catalogProperties = catalogProperties;
    return this;
  }

  public void unsetCatalogProperties() {
    this.catalogProperties = null;
  }

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

  public void setCatalogPropertiesIsSet(boolean value) {
    if (!value) {
      this.catalogProperties = null;
    }
  }

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

    case CATALOG_TYPE:
      if (value == null) {
        unsetCatalogType();
      } else {
        setCatalogType((java.lang.String)value);
      }
      break;

    case STORAGE_CONFIGS:
      if (value == null) {
        unsetStorageConfigs();
      } else {
        setStorageConfigs((java.util.Map<java.lang.String,java.lang.String>)value);
      }
      break;

    case AUTH_CONFIGS:
      if (value == null) {
        unsetAuthConfigs();
      } else {
        setAuthConfigs((java.util.Map<java.lang.String,java.lang.String>)value);
      }
      break;

    case CATALOG_PROPERTIES:
      if (value == null) {
        unsetCatalogProperties();
      } else {
        setCatalogProperties((java.util.Map<java.lang.String,java.lang.String>)value);
      }
      break;

    }
  }

  @org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable
  @Override
  public java.lang.Object getFieldValue(_Fields field) {
    switch (field) {
    case CATALOG_NAME:
      return getCatalogName();

    case CATALOG_TYPE:
      return getCatalogType();

    case STORAGE_CONFIGS:
      return getStorageConfigs();

    case AUTH_CONFIGS:
      return getAuthConfigs();

    case CATALOG_PROPERTIES:
      return getCatalogProperties();

    }
    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 CATALOG_NAME:
      return isSetCatalogName();
    case CATALOG_TYPE:
      return isSetCatalogType();
    case STORAGE_CONFIGS:
      return isSetStorageConfigs();
    case AUTH_CONFIGS:
      return isSetAuthConfigs();
    case CATALOG_PROPERTIES:
      return isSetCatalogProperties();
    }
    throw new java.lang.IllegalStateException();
  }

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

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

    boolean this_present_catalogName = true && this.isSetCatalogName();
    boolean that_present_catalogName = true && that.isSetCatalogName();
    if (this_present_catalogName || that_present_catalogName) {
      if (!(this_present_catalogName && that_present_catalogName))
        return false;
      if (!this.catalogName.equals(that.catalogName))
        return false;
    }

    boolean this_present_catalogType = true && this.isSetCatalogType();
    boolean that_present_catalogType = true && that.isSetCatalogType();
    if (this_present_catalogType || that_present_catalogType) {
      if (!(this_present_catalogType && that_present_catalogType))
        return false;
      if (!this.catalogType.equals(that.catalogType))
        return false;
    }

    boolean this_present_storageConfigs = true && this.isSetStorageConfigs();
    boolean that_present_storageConfigs = true && that.isSetStorageConfigs();
    if (this_present_storageConfigs || that_present_storageConfigs) {
      if (!(this_present_storageConfigs && that_present_storageConfigs))
        return false;
      if (!this.storageConfigs.equals(that.storageConfigs))
        return false;
    }

    boolean this_present_authConfigs = true && this.isSetAuthConfigs();
    boolean that_present_authConfigs = true && that.isSetAuthConfigs();
    if (this_present_authConfigs || that_present_authConfigs) {
      if (!(this_present_authConfigs && that_present_authConfigs))
        return false;
      if (!this.authConfigs.equals(that.authConfigs))
        return false;
    }

    boolean this_present_catalogProperties = true && this.isSetCatalogProperties();
    boolean that_present_catalogProperties = true && that.isSetCatalogProperties();
    if (this_present_catalogProperties || that_present_catalogProperties) {
      if (!(this_present_catalogProperties && that_present_catalogProperties))
        return false;
      if (!this.catalogProperties.equals(that.catalogProperties))
        return false;
    }

    return true;
  }

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

    hashCode = hashCode * 8191 + ((isSetCatalogName()) ? 131071 : 524287);
    if (isSetCatalogName())
      hashCode = hashCode * 8191 + catalogName.hashCode();

    hashCode = hashCode * 8191 + ((isSetCatalogType()) ? 131071 : 524287);
    if (isSetCatalogType())
      hashCode = hashCode * 8191 + catalogType.hashCode();

    hashCode = hashCode * 8191 + ((isSetStorageConfigs()) ? 131071 : 524287);
    if (isSetStorageConfigs())
      hashCode = hashCode * 8191 + storageConfigs.hashCode();

    hashCode = hashCode * 8191 + ((isSetAuthConfigs()) ? 131071 : 524287);
    if (isSetAuthConfigs())
      hashCode = hashCode * 8191 + authConfigs.hashCode();

    hashCode = hashCode * 8191 + ((isSetCatalogProperties()) ? 131071 : 524287);
    if (isSetCatalogProperties())
      hashCode = hashCode * 8191 + catalogProperties.hashCode();

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetCatalogName(), other.isSetCatalogName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCatalogName()) {
      lastComparison = org.apache.amoro.shade.thrift.org.apache.thrift.TBaseHelper.compareTo(this.catalogName, other.catalogName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetCatalogType(), other.isSetCatalogType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCatalogType()) {
      lastComparison = org.apache.amoro.shade.thrift.org.apache.thrift.TBaseHelper.compareTo(this.catalogType, other.catalogType);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetStorageConfigs(), other.isSetStorageConfigs());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStorageConfigs()) {
      lastComparison = org.apache.amoro.shade.thrift.org.apache.thrift.TBaseHelper.compareTo(this.storageConfigs, other.storageConfigs);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetAuthConfigs(), other.isSetAuthConfigs());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAuthConfigs()) {
      lastComparison = org.apache.amoro.shade.thrift.org.apache.thrift.TBaseHelper.compareTo(this.authConfigs, other.authConfigs);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetCatalogProperties(), other.isSetCatalogProperties());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCatalogProperties()) {
      lastComparison = org.apache.amoro.shade.thrift.org.apache.thrift.TBaseHelper.compareTo(this.catalogProperties, other.catalogProperties);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

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

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

  @Override
  public void write(org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TProtocol oprot) throws org.apache.amoro.shade.thrift.org.apache.thrift.TException {
    scheme(oprot).write(oprot, this);
  }

  @Override
  public java.lang.String toString() {
    java.lang.StringBuilder sb = new java.lang.StringBuilder("CatalogMeta(");
    boolean first = true;

    sb.append("catalogName:");
    if (this.catalogName == null) {
      sb.append("null");
    } else {
      sb.append(this.catalogName);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("catalogType:");
    if (this.catalogType == null) {
      sb.append("null");
    } else {
      sb.append(this.catalogType);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("storageConfigs:");
    if (this.storageConfigs == null) {
      sb.append("null");
    } else {
      sb.append(this.storageConfigs);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("authConfigs:");
    if (this.authConfigs == null) {
      sb.append("null");
    } else {
      sb.append(this.authConfigs);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("catalogProperties:");
    if (this.catalogProperties == null) {
      sb.append("null");
    } else {
      sb.append(this.catalogProperties);
    }
    first = false;
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.amoro.shade.thrift.org.apache.thrift.TException {
    // check for required fields
    if (catalogName == null) {
      throw new org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TProtocolException("Required field 'catalogName' was not present! Struct: " + toString());
    }
    if (catalogType == null) {
      throw new org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TProtocolException("Required field 'catalogType' 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.amoro.shade.thrift.org.apache.thrift.protocol.TCompactProtocol(new org.apache.amoro.shade.thrift.org.apache.thrift.transport.TIOStreamTransport(out)));
    } catch (org.apache.amoro.shade.thrift.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.amoro.shade.thrift.org.apache.thrift.protocol.TCompactProtocol(new org.apache.amoro.shade.thrift.org.apache.thrift.transport.TIOStreamTransport(in)));
    } catch (org.apache.amoro.shade.thrift.org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private static class CatalogMetaStandardSchemeFactory implements org.apache.amoro.shade.thrift.org.apache.thrift.scheme.SchemeFactory {
    @Override
    public CatalogMetaStandardScheme getScheme() {
      return new CatalogMetaStandardScheme();
    }
  }

  private static class CatalogMetaStandardScheme extends org.apache.amoro.shade.thrift.org.apache.thrift.scheme.StandardScheme<CatalogMeta> {

    @Override
    public void read(org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TProtocol iprot, CatalogMeta struct) throws org.apache.amoro.shade.thrift.org.apache.thrift.TException {
      org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true)
      {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (schemeField.id) {
          case 1: // CATALOG_NAME
            if (schemeField.type == org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.STRING) {
              struct.catalogName = iprot.readString();
              struct.setCatalogNameIsSet(true);
            } else { 
              org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // CATALOG_TYPE
            if (schemeField.type == org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.STRING) {
              struct.catalogType = iprot.readString();
              struct.setCatalogTypeIsSet(true);
            } else { 
              org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // STORAGE_CONFIGS
            if (schemeField.type == org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TMap _map0 = iprot.readMapBegin();
                struct.storageConfigs = new java.util.HashMap<java.lang.String,java.lang.String>(2*_map0.size);
                @org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable java.lang.String _key1;
                @org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable java.lang.String _val2;
                for (int _i3 = 0; _i3 < _map0.size; ++_i3)
                {
                  _key1 = iprot.readString();
                  _val2 = iprot.readString();
                  struct.storageConfigs.put(_key1, _val2);
                }
                iprot.readMapEnd();
              }
              struct.setStorageConfigsIsSet(true);
            } else { 
              org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // AUTH_CONFIGS
            if (schemeField.type == org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TMap _map4 = iprot.readMapBegin();
                struct.authConfigs = new java.util.HashMap<java.lang.String,java.lang.String>(2*_map4.size);
                @org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable java.lang.String _key5;
                @org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable java.lang.String _val6;
                for (int _i7 = 0; _i7 < _map4.size; ++_i7)
                {
                  _key5 = iprot.readString();
                  _val6 = iprot.readString();
                  struct.authConfigs.put(_key5, _val6);
                }
                iprot.readMapEnd();
              }
              struct.setAuthConfigsIsSet(true);
            } else { 
              org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // CATALOG_PROPERTIES
            if (schemeField.type == org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TMap _map8 = iprot.readMapBegin();
                struct.catalogProperties = new java.util.HashMap<java.lang.String,java.lang.String>(2*_map8.size);
                @org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable java.lang.String _key9;
                @org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable java.lang.String _val10;
                for (int _i11 = 0; _i11 < _map8.size; ++_i11)
                {
                  _key9 = iprot.readString();
                  _val10 = iprot.readString();
                  struct.catalogProperties.put(_key9, _val10);
                }
                iprot.readMapEnd();
              }
              struct.setCatalogPropertiesIsSet(true);
            } else { 
              org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.amoro.shade.thrift.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();
    }

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

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.catalogName != null) {
        oprot.writeFieldBegin(CATALOG_NAME_FIELD_DESC);
        oprot.writeString(struct.catalogName);
        oprot.writeFieldEnd();
      }
      if (struct.catalogType != null) {
        oprot.writeFieldBegin(CATALOG_TYPE_FIELD_DESC);
        oprot.writeString(struct.catalogType);
        oprot.writeFieldEnd();
      }
      if (struct.storageConfigs != null) {
        oprot.writeFieldBegin(STORAGE_CONFIGS_FIELD_DESC);
        {
          oprot.writeMapBegin(new org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TMap(org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.STRING, org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.STRING, struct.storageConfigs.size()));
          for (java.util.Map.Entry<java.lang.String, java.lang.String> _iter12 : struct.storageConfigs.entrySet())
          {
            oprot.writeString(_iter12.getKey());
            oprot.writeString(_iter12.getValue());
          }
          oprot.writeMapEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.authConfigs != null) {
        oprot.writeFieldBegin(AUTH_CONFIGS_FIELD_DESC);
        {
          oprot.writeMapBegin(new org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TMap(org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.STRING, org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.STRING, struct.authConfigs.size()));
          for (java.util.Map.Entry<java.lang.String, java.lang.String> _iter13 : struct.authConfigs.entrySet())
          {
            oprot.writeString(_iter13.getKey());
            oprot.writeString(_iter13.getValue());
          }
          oprot.writeMapEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.catalogProperties != null) {
        oprot.writeFieldBegin(CATALOG_PROPERTIES_FIELD_DESC);
        {
          oprot.writeMapBegin(new org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TMap(org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.STRING, org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.STRING, struct.catalogProperties.size()));
          for (java.util.Map.Entry<java.lang.String, java.lang.String> _iter14 : struct.catalogProperties.entrySet())
          {
            oprot.writeString(_iter14.getKey());
            oprot.writeString(_iter14.getValue());
          }
          oprot.writeMapEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class CatalogMetaTupleSchemeFactory implements org.apache.amoro.shade.thrift.org.apache.thrift.scheme.SchemeFactory {
    @Override
    public CatalogMetaTupleScheme getScheme() {
      return new CatalogMetaTupleScheme();
    }
  }

  private static class CatalogMetaTupleScheme extends org.apache.amoro.shade.thrift.org.apache.thrift.scheme.TupleScheme<CatalogMeta> {

    @Override
    public void write(org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TProtocol prot, CatalogMeta struct) throws org.apache.amoro.shade.thrift.org.apache.thrift.TException {
      org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TTupleProtocol) prot;
      oprot.writeString(struct.catalogName);
      oprot.writeString(struct.catalogType);
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetStorageConfigs()) {
        optionals.set(0);
      }
      if (struct.isSetAuthConfigs()) {
        optionals.set(1);
      }
      if (struct.isSetCatalogProperties()) {
        optionals.set(2);
      }
      oprot.writeBitSet(optionals, 3);
      if (struct.isSetStorageConfigs()) {
        {
          oprot.writeI32(struct.storageConfigs.size());
          for (java.util.Map.Entry<java.lang.String, java.lang.String> _iter15 : struct.storageConfigs.entrySet())
          {
            oprot.writeString(_iter15.getKey());
            oprot.writeString(_iter15.getValue());
          }
        }
      }
      if (struct.isSetAuthConfigs()) {
        {
          oprot.writeI32(struct.authConfigs.size());
          for (java.util.Map.Entry<java.lang.String, java.lang.String> _iter16 : struct.authConfigs.entrySet())
          {
            oprot.writeString(_iter16.getKey());
            oprot.writeString(_iter16.getValue());
          }
        }
      }
      if (struct.isSetCatalogProperties()) {
        {
          oprot.writeI32(struct.catalogProperties.size());
          for (java.util.Map.Entry<java.lang.String, java.lang.String> _iter17 : struct.catalogProperties.entrySet())
          {
            oprot.writeString(_iter17.getKey());
            oprot.writeString(_iter17.getValue());
          }
        }
      }
    }

    @Override
    public void read(org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TProtocol prot, CatalogMeta struct) throws org.apache.amoro.shade.thrift.org.apache.thrift.TException {
      org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TTupleProtocol) prot;
      struct.catalogName = iprot.readString();
      struct.setCatalogNameIsSet(true);
      struct.catalogType = iprot.readString();
      struct.setCatalogTypeIsSet(true);
      java.util.BitSet incoming = iprot.readBitSet(3);
      if (incoming.get(0)) {
        {
          org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TMap _map18 = iprot.readMapBegin(org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.STRING, org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.STRING); 
          struct.storageConfigs = new java.util.HashMap<java.lang.String,java.lang.String>(2*_map18.size);
          @org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable java.lang.String _key19;
          @org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable java.lang.String _val20;
          for (int _i21 = 0; _i21 < _map18.size; ++_i21)
          {
            _key19 = iprot.readString();
            _val20 = iprot.readString();
            struct.storageConfigs.put(_key19, _val20);
          }
        }
        struct.setStorageConfigsIsSet(true);
      }
      if (incoming.get(1)) {
        {
          org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TMap _map22 = iprot.readMapBegin(org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.STRING, org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.STRING); 
          struct.authConfigs = new java.util.HashMap<java.lang.String,java.lang.String>(2*_map22.size);
          @org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable java.lang.String _key23;
          @org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable java.lang.String _val24;
          for (int _i25 = 0; _i25 < _map22.size; ++_i25)
          {
            _key23 = iprot.readString();
            _val24 = iprot.readString();
            struct.authConfigs.put(_key23, _val24);
          }
        }
        struct.setAuthConfigsIsSet(true);
      }
      if (incoming.get(2)) {
        {
          org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TMap _map26 = iprot.readMapBegin(org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.STRING, org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TType.STRING); 
          struct.catalogProperties = new java.util.HashMap<java.lang.String,java.lang.String>(2*_map26.size);
          @org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable java.lang.String _key27;
          @org.apache.amoro.shade.thrift.org.apache.thrift.annotation.Nullable java.lang.String _val28;
          for (int _i29 = 0; _i29 < _map26.size; ++_i29)
          {
            _key27 = iprot.readString();
            _val28 = iprot.readString();
            struct.catalogProperties.put(_key27, _val28);
          }
        }
        struct.setCatalogPropertiesIsSet(true);
      }
    }
  }

  private static <S extends org.apache.amoro.shade.thrift.org.apache.thrift.scheme.IScheme> S scheme(org.apache.amoro.shade.thrift.org.apache.thrift.protocol.TProtocol proto) {
    return (org.apache.amoro.shade.thrift.org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
  }
}

