All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.netease.arctic.ams.api.CatalogMeta Maven / Gradle / Ivy

/**
 * Autogenerated by Thrift Compiler (0.13.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package com.netease.arctic.ams.api;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2023-02-01")
public class CatalogMeta implements com.netease.arctic.shade.org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
  private static final com.netease.arctic.shade.org.apache.thrift.protocol.TStruct STRUCT_DESC = new com.netease.arctic.shade.org.apache.thrift.protocol.TStruct("CatalogMeta");

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

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

  public @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.lang.String catalogName; // required
  public @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.lang.String catalogType; // required
  public @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.util.Map storageConfigs; // required
  public @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.util.Map authConfigs; // required
  public @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.util.Map catalogProperties; // required

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements com.netease.arctic.shade.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 byName = new java.util.HashMap();

    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.
     */
    @com.netease.arctic.shade.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.
     */
    @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable
    public static _Fields findByName(java.lang.String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final java.lang.String _fieldName;

    _Fields(short thriftId, java.lang.String fieldName) {
      _thriftId = thriftId;
      _fieldName = fieldName;
    }

    public short getThriftFieldId() {
      return _thriftId;
    }

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

  // isset id assignments
  public static final java.util.Map<_Fields, com.netease.arctic.shade.org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    java.util.Map<_Fields, com.netease.arctic.shade.org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, com.netease.arctic.shade.org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.CATALOG_NAME, new com.netease.arctic.shade.org.apache.thrift.meta_data.FieldMetaData("catalogName", com.netease.arctic.shade.org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new com.netease.arctic.shade.org.apache.thrift.meta_data.FieldValueMetaData(com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.CATALOG_TYPE, new com.netease.arctic.shade.org.apache.thrift.meta_data.FieldMetaData("catalogType", com.netease.arctic.shade.org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new com.netease.arctic.shade.org.apache.thrift.meta_data.FieldValueMetaData(com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.STORAGE_CONFIGS, new com.netease.arctic.shade.org.apache.thrift.meta_data.FieldMetaData("storageConfigs", com.netease.arctic.shade.org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new com.netease.arctic.shade.org.apache.thrift.meta_data.MapMetaData(com.netease.arctic.shade.org.apache.thrift.protocol.TType.MAP, 
            new com.netease.arctic.shade.org.apache.thrift.meta_data.FieldValueMetaData(com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING), 
            new com.netease.arctic.shade.org.apache.thrift.meta_data.FieldValueMetaData(com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING))));
    tmpMap.put(_Fields.AUTH_CONFIGS, new com.netease.arctic.shade.org.apache.thrift.meta_data.FieldMetaData("authConfigs", com.netease.arctic.shade.org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new com.netease.arctic.shade.org.apache.thrift.meta_data.MapMetaData(com.netease.arctic.shade.org.apache.thrift.protocol.TType.MAP, 
            new com.netease.arctic.shade.org.apache.thrift.meta_data.FieldValueMetaData(com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING), 
            new com.netease.arctic.shade.org.apache.thrift.meta_data.FieldValueMetaData(com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING))));
    tmpMap.put(_Fields.CATALOG_PROPERTIES, new com.netease.arctic.shade.org.apache.thrift.meta_data.FieldMetaData("catalogProperties", com.netease.arctic.shade.org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new com.netease.arctic.shade.org.apache.thrift.meta_data.MapMetaData(com.netease.arctic.shade.org.apache.thrift.protocol.TType.MAP, 
            new com.netease.arctic.shade.org.apache.thrift.meta_data.FieldValueMetaData(com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING), 
            new com.netease.arctic.shade.org.apache.thrift.meta_data.FieldValueMetaData(com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING))));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    com.netease.arctic.shade.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 storageConfigs,
    java.util.Map authConfigs,
    java.util.Map catalogProperties)
  {
    this();
    this.catalogName = catalogName;
    this.catalogType = catalogType;
    this.storageConfigs = storageConfigs;
    this.authConfigs = authConfigs;
    this.catalogProperties = catalogProperties;
  }

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

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

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

  public CatalogMeta setCatalogName(@com.netease.arctic.shade.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;
    }
  }

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

  public CatalogMeta setCatalogType(@com.netease.arctic.shade.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();
    }
    this.storageConfigs.put(key, val);
  }

  @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable
  public java.util.Map getStorageConfigs() {
    return this.storageConfigs;
  }

  public CatalogMeta setStorageConfigs(@com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.util.Map 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();
    }
    this.authConfigs.put(key, val);
  }

  @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable
  public java.util.Map getAuthConfigs() {
    return this.authConfigs;
  }

  public CatalogMeta setAuthConfigs(@com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.util.Map 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();
    }
    this.catalogProperties.put(key, val);
  }

  @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable
  public java.util.Map getCatalogProperties() {
    return this.catalogProperties;
  }

  public CatalogMeta setCatalogProperties(@com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.util.Map 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;
    }
  }

  public void setFieldValue(_Fields field, @com.netease.arctic.shade.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)value);
      }
      break;

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

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

    }
  }

  @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable
  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 */
  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 == null)
      return false;
    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.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCatalogName()) {
      lastComparison = com.netease.arctic.shade.org.apache.thrift.TBaseHelper.compareTo(this.catalogName, other.catalogName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetCatalogType()).compareTo(other.isSetCatalogType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCatalogType()) {
      lastComparison = com.netease.arctic.shade.org.apache.thrift.TBaseHelper.compareTo(this.catalogType, other.catalogType);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetStorageConfigs()).compareTo(other.isSetStorageConfigs());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStorageConfigs()) {
      lastComparison = com.netease.arctic.shade.org.apache.thrift.TBaseHelper.compareTo(this.storageConfigs, other.storageConfigs);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetAuthConfigs()).compareTo(other.isSetAuthConfigs());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAuthConfigs()) {
      lastComparison = com.netease.arctic.shade.org.apache.thrift.TBaseHelper.compareTo(this.authConfigs, other.authConfigs);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetCatalogProperties()).compareTo(other.isSetCatalogProperties());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCatalogProperties()) {
      lastComparison = com.netease.arctic.shade.org.apache.thrift.TBaseHelper.compareTo(this.catalogProperties, other.catalogProperties);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

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

  public void read(com.netease.arctic.shade.org.apache.thrift.protocol.TProtocol iprot) throws com.netease.arctic.shade.org.apache.thrift.TException {
    scheme(iprot).read(iprot, this);
  }

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

  private static class CatalogMetaStandardSchemeFactory implements com.netease.arctic.shade.org.apache.thrift.scheme.SchemeFactory {
    public CatalogMetaStandardScheme getScheme() {
      return new CatalogMetaStandardScheme();
    }
  }

  private static class CatalogMetaStandardScheme extends com.netease.arctic.shade.org.apache.thrift.scheme.StandardScheme {

    public void read(com.netease.arctic.shade.org.apache.thrift.protocol.TProtocol iprot, CatalogMeta struct) throws com.netease.arctic.shade.org.apache.thrift.TException {
      com.netease.arctic.shade.org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true)
      {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == com.netease.arctic.shade.org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (schemeField.id) {
          case 1: // CATALOG_NAME
            if (schemeField.type == com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING) {
              struct.catalogName = iprot.readString();
              struct.setCatalogNameIsSet(true);
            } else { 
              com.netease.arctic.shade.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // CATALOG_TYPE
            if (schemeField.type == com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING) {
              struct.catalogType = iprot.readString();
              struct.setCatalogTypeIsSet(true);
            } else { 
              com.netease.arctic.shade.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // STORAGE_CONFIGS
            if (schemeField.type == com.netease.arctic.shade.org.apache.thrift.protocol.TType.MAP) {
              {
                com.netease.arctic.shade.org.apache.thrift.protocol.TMap _map0 = iprot.readMapBegin();
                struct.storageConfigs = new java.util.HashMap(2*_map0.size);
                @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.lang.String _key1;
                @com.netease.arctic.shade.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 { 
              com.netease.arctic.shade.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // AUTH_CONFIGS
            if (schemeField.type == com.netease.arctic.shade.org.apache.thrift.protocol.TType.MAP) {
              {
                com.netease.arctic.shade.org.apache.thrift.protocol.TMap _map4 = iprot.readMapBegin();
                struct.authConfigs = new java.util.HashMap(2*_map4.size);
                @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.lang.String _key5;
                @com.netease.arctic.shade.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 { 
              com.netease.arctic.shade.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // CATALOG_PROPERTIES
            if (schemeField.type == com.netease.arctic.shade.org.apache.thrift.protocol.TType.MAP) {
              {
                com.netease.arctic.shade.org.apache.thrift.protocol.TMap _map8 = iprot.readMapBegin();
                struct.catalogProperties = new java.util.HashMap(2*_map8.size);
                @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.lang.String _key9;
                @com.netease.arctic.shade.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 { 
              com.netease.arctic.shade.org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            com.netease.arctic.shade.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(com.netease.arctic.shade.org.apache.thrift.protocol.TProtocol oprot, CatalogMeta struct) throws com.netease.arctic.shade.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 com.netease.arctic.shade.org.apache.thrift.protocol.TMap(com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING, com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING, struct.storageConfigs.size()));
          for (java.util.Map.Entry _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 com.netease.arctic.shade.org.apache.thrift.protocol.TMap(com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING, com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING, struct.authConfigs.size()));
          for (java.util.Map.Entry _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 com.netease.arctic.shade.org.apache.thrift.protocol.TMap(com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING, com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING, struct.catalogProperties.size()));
          for (java.util.Map.Entry _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 com.netease.arctic.shade.org.apache.thrift.scheme.SchemeFactory {
    public CatalogMetaTupleScheme getScheme() {
      return new CatalogMetaTupleScheme();
    }
  }

  private static class CatalogMetaTupleScheme extends com.netease.arctic.shade.org.apache.thrift.scheme.TupleScheme {

    @Override
    public void write(com.netease.arctic.shade.org.apache.thrift.protocol.TProtocol prot, CatalogMeta struct) throws com.netease.arctic.shade.org.apache.thrift.TException {
      com.netease.arctic.shade.org.apache.thrift.protocol.TTupleProtocol oprot = (com.netease.arctic.shade.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 _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 _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 _iter17 : struct.catalogProperties.entrySet())
          {
            oprot.writeString(_iter17.getKey());
            oprot.writeString(_iter17.getValue());
          }
        }
      }
    }

    @Override
    public void read(com.netease.arctic.shade.org.apache.thrift.protocol.TProtocol prot, CatalogMeta struct) throws com.netease.arctic.shade.org.apache.thrift.TException {
      com.netease.arctic.shade.org.apache.thrift.protocol.TTupleProtocol iprot = (com.netease.arctic.shade.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)) {
        {
          com.netease.arctic.shade.org.apache.thrift.protocol.TMap _map18 = new com.netease.arctic.shade.org.apache.thrift.protocol.TMap(com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING, com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.storageConfigs = new java.util.HashMap(2*_map18.size);
          @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.lang.String _key19;
          @com.netease.arctic.shade.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)) {
        {
          com.netease.arctic.shade.org.apache.thrift.protocol.TMap _map22 = new com.netease.arctic.shade.org.apache.thrift.protocol.TMap(com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING, com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.authConfigs = new java.util.HashMap(2*_map22.size);
          @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.lang.String _key23;
          @com.netease.arctic.shade.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)) {
        {
          com.netease.arctic.shade.org.apache.thrift.protocol.TMap _map26 = new com.netease.arctic.shade.org.apache.thrift.protocol.TMap(com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING, com.netease.arctic.shade.org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.catalogProperties = new java.util.HashMap(2*_map26.size);
          @com.netease.arctic.shade.org.apache.thrift.annotation.Nullable java.lang.String _key27;
          @com.netease.arctic.shade.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 scheme(com.netease.arctic.shade.org.apache.thrift.protocol.TProtocol proto) {
    return (com.netease.arctic.shade.org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
  }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy