TCertBasedAuth.java

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

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

  private static final org.apache.thrift.protocol.TField CERT_PEM_FIELD_DESC = new org.apache.thrift.protocol.TField("cert_pem", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField SUBJECT_FIELD_DESC = new org.apache.thrift.protocol.TField("subject", org.apache.thrift.protocol.TType.STRING, (short)2);
  private static final org.apache.thrift.protocol.TField SAN_FIELD_DESC = new org.apache.thrift.protocol.TField("san", org.apache.thrift.protocol.TType.STRING, (short)3);
  private static final org.apache.thrift.protocol.TField ISSUER_FIELD_DESC = new org.apache.thrift.protocol.TField("issuer", org.apache.thrift.protocol.TType.STRING, (short)4);
  private static final org.apache.thrift.protocol.TField CIPHER_FIELD_DESC = new org.apache.thrift.protocol.TField("cipher", org.apache.thrift.protocol.TType.STRING, (short)5);
  private static final org.apache.thrift.protocol.TField VALIDITY_NOT_BEFORE_FIELD_DESC = new org.apache.thrift.protocol.TField("validity_not_before", org.apache.thrift.protocol.TType.STRING, (short)6);
  private static final org.apache.thrift.protocol.TField VALIDITY_NOT_AFTER_FIELD_DESC = new org.apache.thrift.protocol.TField("validity_not_after", org.apache.thrift.protocol.TType.STRING, (short)7);

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

  public @org.apache.thrift.annotation.Nullable java.lang.String cert_pem; // optional
  public @org.apache.thrift.annotation.Nullable java.lang.String subject; // optional
  public @org.apache.thrift.annotation.Nullable java.lang.String san; // optional
  public @org.apache.thrift.annotation.Nullable java.lang.String issuer; // optional
  public @org.apache.thrift.annotation.Nullable java.lang.String cipher; // optional
  public @org.apache.thrift.annotation.Nullable java.lang.String validity_not_before; // optional
  public @org.apache.thrift.annotation.Nullable java.lang.String validity_not_after; // 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 {
    CERT_PEM((short)1, "cert_pem"),
    SUBJECT((short)2, "subject"),
    SAN((short)3, "san"),
    ISSUER((short)4, "issuer"),
    CIPHER((short)5, "cipher"),
    VALIDITY_NOT_BEFORE((short)6, "validity_not_before"),
    VALIDITY_NOT_AFTER((short)7, "validity_not_after");

    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: // CERT_PEM
          return CERT_PEM;
        case 2: // SUBJECT
          return SUBJECT;
        case 3: // SAN
          return SAN;
        case 4: // ISSUER
          return ISSUER;
        case 5: // CIPHER
          return CIPHER;
        case 6: // VALIDITY_NOT_BEFORE
          return VALIDITY_NOT_BEFORE;
        case 7: // VALIDITY_NOT_AFTER
          return VALIDITY_NOT_AFTER;
        default:
          return null;
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, throwing an exception
     * if it is not found.
     */
    public static _Fields findByThriftIdOrThrow(int fieldId) {
      _Fields fields = findByThriftId(fieldId);
      if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
      return fields;
    }

    /**
     * Find the _Fields constant that matches name, or null if its not found.
     */
    @org.apache.thrift.annotation.Nullable
    public static _Fields findByName(java.lang.String name) {
      return byName.get(name);
    }

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

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

    public short getThriftFieldId() {
      return _thriftId;
    }

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

  // isset id assignments
  private static final _Fields optionals[] = {_Fields.CERT_PEM,_Fields.SUBJECT,_Fields.SAN,_Fields.ISSUER,_Fields.CIPHER,_Fields.VALIDITY_NOT_BEFORE,_Fields.VALIDITY_NOT_AFTER};
  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.CERT_PEM, new org.apache.thrift.meta_data.FieldMetaData("cert_pem", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.SUBJECT, new org.apache.thrift.meta_data.FieldMetaData("subject", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.SAN, new org.apache.thrift.meta_data.FieldMetaData("san", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.ISSUER, new org.apache.thrift.meta_data.FieldMetaData("issuer", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.CIPHER, new org.apache.thrift.meta_data.FieldMetaData("cipher", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.VALIDITY_NOT_BEFORE, new org.apache.thrift.meta_data.FieldMetaData("validity_not_before", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.VALIDITY_NOT_AFTER, new org.apache.thrift.meta_data.FieldMetaData("validity_not_after", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCertBasedAuth.class, metaDataMap);
  }

  public TCertBasedAuth() {
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public TCertBasedAuth(TCertBasedAuth other) {
    if (other.isSetCertPem()) {
      this.cert_pem = other.cert_pem;
    }
    if (other.isSetSubject()) {
      this.subject = other.subject;
    }
    if (other.isSetSan()) {
      this.san = other.san;
    }
    if (other.isSetIssuer()) {
      this.issuer = other.issuer;
    }
    if (other.isSetCipher()) {
      this.cipher = other.cipher;
    }
    if (other.isSetValidityNotBefore()) {
      this.validity_not_before = other.validity_not_before;
    }
    if (other.isSetValidityNotAfter()) {
      this.validity_not_after = other.validity_not_after;
    }
  }

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

  @Override
  public void clear() {
    this.cert_pem = null;
    this.subject = null;
    this.san = null;
    this.issuer = null;
    this.cipher = null;
    this.validity_not_before = null;
    this.validity_not_after = null;
  }

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

  public TCertBasedAuth setCertPem(@org.apache.thrift.annotation.Nullable java.lang.String cert_pem) {
    this.cert_pem = cert_pem;
    return this;
  }

  public void unsetCertPem() {
    this.cert_pem = null;
  }

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

  public void setCertPemIsSet(boolean value) {
    if (!value) {
      this.cert_pem = null;
    }
  }

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

  public TCertBasedAuth setSubject(@org.apache.thrift.annotation.Nullable java.lang.String subject) {
    this.subject = subject;
    return this;
  }

  public void unsetSubject() {
    this.subject = null;
  }

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

  public void setSubjectIsSet(boolean value) {
    if (!value) {
      this.subject = null;
    }
  }

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

  public TCertBasedAuth setSan(@org.apache.thrift.annotation.Nullable java.lang.String san) {
    this.san = san;
    return this;
  }

  public void unsetSan() {
    this.san = null;
  }

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

  public void setSanIsSet(boolean value) {
    if (!value) {
      this.san = null;
    }
  }

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

  public TCertBasedAuth setIssuer(@org.apache.thrift.annotation.Nullable java.lang.String issuer) {
    this.issuer = issuer;
    return this;
  }

  public void unsetIssuer() {
    this.issuer = null;
  }

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

  public void setIssuerIsSet(boolean value) {
    if (!value) {
      this.issuer = null;
    }
  }

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

  public TCertBasedAuth setCipher(@org.apache.thrift.annotation.Nullable java.lang.String cipher) {
    this.cipher = cipher;
    return this;
  }

  public void unsetCipher() {
    this.cipher = null;
  }

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

  public void setCipherIsSet(boolean value) {
    if (!value) {
      this.cipher = null;
    }
  }

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

  public TCertBasedAuth setValidityNotBefore(@org.apache.thrift.annotation.Nullable java.lang.String validity_not_before) {
    this.validity_not_before = validity_not_before;
    return this;
  }

  public void unsetValidityNotBefore() {
    this.validity_not_before = null;
  }

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

  public void setValidityNotBeforeIsSet(boolean value) {
    if (!value) {
      this.validity_not_before = null;
    }
  }

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

  public TCertBasedAuth setValidityNotAfter(@org.apache.thrift.annotation.Nullable java.lang.String validity_not_after) {
    this.validity_not_after = validity_not_after;
    return this;
  }

  public void unsetValidityNotAfter() {
    this.validity_not_after = null;
  }

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

  public void setValidityNotAfterIsSet(boolean value) {
    if (!value) {
      this.validity_not_after = null;
    }
  }

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

    case SUBJECT:
      if (value == null) {
        unsetSubject();
      } else {
        setSubject((java.lang.String)value);
      }
      break;

    case SAN:
      if (value == null) {
        unsetSan();
      } else {
        setSan((java.lang.String)value);
      }
      break;

    case ISSUER:
      if (value == null) {
        unsetIssuer();
      } else {
        setIssuer((java.lang.String)value);
      }
      break;

    case CIPHER:
      if (value == null) {
        unsetCipher();
      } else {
        setCipher((java.lang.String)value);
      }
      break;

    case VALIDITY_NOT_BEFORE:
      if (value == null) {
        unsetValidityNotBefore();
      } else {
        setValidityNotBefore((java.lang.String)value);
      }
      break;

    case VALIDITY_NOT_AFTER:
      if (value == null) {
        unsetValidityNotAfter();
      } else {
        setValidityNotAfter((java.lang.String)value);
      }
      break;

    }
  }

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

    case SUBJECT:
      return getSubject();

    case SAN:
      return getSan();

    case ISSUER:
      return getIssuer();

    case CIPHER:
      return getCipher();

    case VALIDITY_NOT_BEFORE:
      return getValidityNotBefore();

    case VALIDITY_NOT_AFTER:
      return getValidityNotAfter();

    }
    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 CERT_PEM:
      return isSetCertPem();
    case SUBJECT:
      return isSetSubject();
    case SAN:
      return isSetSan();
    case ISSUER:
      return isSetIssuer();
    case CIPHER:
      return isSetCipher();
    case VALIDITY_NOT_BEFORE:
      return isSetValidityNotBefore();
    case VALIDITY_NOT_AFTER:
      return isSetValidityNotAfter();
    }
    throw new java.lang.IllegalStateException();
  }

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

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

    boolean this_present_cert_pem = true && this.isSetCertPem();
    boolean that_present_cert_pem = true && that.isSetCertPem();
    if (this_present_cert_pem || that_present_cert_pem) {
      if (!(this_present_cert_pem && that_present_cert_pem))
        return false;
      if (!this.cert_pem.equals(that.cert_pem))
        return false;
    }

    boolean this_present_subject = true && this.isSetSubject();
    boolean that_present_subject = true && that.isSetSubject();
    if (this_present_subject || that_present_subject) {
      if (!(this_present_subject && that_present_subject))
        return false;
      if (!this.subject.equals(that.subject))
        return false;
    }

    boolean this_present_san = true && this.isSetSan();
    boolean that_present_san = true && that.isSetSan();
    if (this_present_san || that_present_san) {
      if (!(this_present_san && that_present_san))
        return false;
      if (!this.san.equals(that.san))
        return false;
    }

    boolean this_present_issuer = true && this.isSetIssuer();
    boolean that_present_issuer = true && that.isSetIssuer();
    if (this_present_issuer || that_present_issuer) {
      if (!(this_present_issuer && that_present_issuer))
        return false;
      if (!this.issuer.equals(that.issuer))
        return false;
    }

    boolean this_present_cipher = true && this.isSetCipher();
    boolean that_present_cipher = true && that.isSetCipher();
    if (this_present_cipher || that_present_cipher) {
      if (!(this_present_cipher && that_present_cipher))
        return false;
      if (!this.cipher.equals(that.cipher))
        return false;
    }

    boolean this_present_validity_not_before = true && this.isSetValidityNotBefore();
    boolean that_present_validity_not_before = true && that.isSetValidityNotBefore();
    if (this_present_validity_not_before || that_present_validity_not_before) {
      if (!(this_present_validity_not_before && that_present_validity_not_before))
        return false;
      if (!this.validity_not_before.equals(that.validity_not_before))
        return false;
    }

    boolean this_present_validity_not_after = true && this.isSetValidityNotAfter();
    boolean that_present_validity_not_after = true && that.isSetValidityNotAfter();
    if (this_present_validity_not_after || that_present_validity_not_after) {
      if (!(this_present_validity_not_after && that_present_validity_not_after))
        return false;
      if (!this.validity_not_after.equals(that.validity_not_after))
        return false;
    }

    return true;
  }

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

    hashCode = hashCode * 8191 + ((isSetCertPem()) ? 131071 : 524287);
    if (isSetCertPem())
      hashCode = hashCode * 8191 + cert_pem.hashCode();

    hashCode = hashCode * 8191 + ((isSetSubject()) ? 131071 : 524287);
    if (isSetSubject())
      hashCode = hashCode * 8191 + subject.hashCode();

    hashCode = hashCode * 8191 + ((isSetSan()) ? 131071 : 524287);
    if (isSetSan())
      hashCode = hashCode * 8191 + san.hashCode();

    hashCode = hashCode * 8191 + ((isSetIssuer()) ? 131071 : 524287);
    if (isSetIssuer())
      hashCode = hashCode * 8191 + issuer.hashCode();

    hashCode = hashCode * 8191 + ((isSetCipher()) ? 131071 : 524287);
    if (isSetCipher())
      hashCode = hashCode * 8191 + cipher.hashCode();

    hashCode = hashCode * 8191 + ((isSetValidityNotBefore()) ? 131071 : 524287);
    if (isSetValidityNotBefore())
      hashCode = hashCode * 8191 + validity_not_before.hashCode();

    hashCode = hashCode * 8191 + ((isSetValidityNotAfter()) ? 131071 : 524287);
    if (isSetValidityNotAfter())
      hashCode = hashCode * 8191 + validity_not_after.hashCode();

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetCertPem(), other.isSetCertPem());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCertPem()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cert_pem, other.cert_pem);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetSubject(), other.isSetSubject());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSubject()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.subject, other.subject);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetSan(), other.isSetSan());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSan()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.san, other.san);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetIssuer(), other.isSetIssuer());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetIssuer()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.issuer, other.issuer);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetCipher(), other.isSetCipher());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCipher()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cipher, other.cipher);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetValidityNotBefore(), other.isSetValidityNotBefore());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetValidityNotBefore()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.validity_not_before, other.validity_not_before);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetValidityNotAfter(), other.isSetValidityNotAfter());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetValidityNotAfter()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.validity_not_after, other.validity_not_after);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

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

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

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

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

    if (isSetCertPem()) {
      sb.append("cert_pem:");
      if (this.cert_pem == null) {
        sb.append("null");
      } else {
        sb.append(this.cert_pem);
      }
      first = false;
    }
    if (isSetSubject()) {
      if (!first) sb.append(", ");
      sb.append("subject:");
      if (this.subject == null) {
        sb.append("null");
      } else {
        sb.append(this.subject);
      }
      first = false;
    }
    if (isSetSan()) {
      if (!first) sb.append(", ");
      sb.append("san:");
      if (this.san == null) {
        sb.append("null");
      } else {
        sb.append(this.san);
      }
      first = false;
    }
    if (isSetIssuer()) {
      if (!first) sb.append(", ");
      sb.append("issuer:");
      if (this.issuer == null) {
        sb.append("null");
      } else {
        sb.append(this.issuer);
      }
      first = false;
    }
    if (isSetCipher()) {
      if (!first) sb.append(", ");
      sb.append("cipher:");
      if (this.cipher == null) {
        sb.append("null");
      } else {
        sb.append(this.cipher);
      }
      first = false;
    }
    if (isSetValidityNotBefore()) {
      if (!first) sb.append(", ");
      sb.append("validity_not_before:");
      if (this.validity_not_before == null) {
        sb.append("null");
      } else {
        sb.append(this.validity_not_before);
      }
      first = false;
    }
    if (isSetValidityNotAfter()) {
      if (!first) sb.append(", ");
      sb.append("validity_not_after:");
      if (this.validity_not_after == null) {
        sb.append("null");
      } else {
        sb.append(this.validity_not_after);
      }
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // check for sub-struct validity
  }

  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
    try {
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
    try {
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

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

  private static class TCertBasedAuthStandardScheme extends org.apache.thrift.scheme.StandardScheme<TCertBasedAuth> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, TCertBasedAuth struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true)
      {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (schemeField.id) {
          case 1: // CERT_PEM
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.cert_pem = iprot.readString();
              struct.setCertPemIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // SUBJECT
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.subject = iprot.readString();
              struct.setSubjectIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // SAN
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.san = iprot.readString();
              struct.setSanIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // ISSUER
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.issuer = iprot.readString();
              struct.setIssuerIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // CIPHER
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.cipher = iprot.readString();
              struct.setCipherIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // VALIDITY_NOT_BEFORE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.validity_not_before = iprot.readString();
              struct.setValidityNotBeforeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // VALIDITY_NOT_AFTER
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.validity_not_after = iprot.readString();
              struct.setValidityNotAfterIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      struct.validate();
    }

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

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.cert_pem != null) {
        if (struct.isSetCertPem()) {
          oprot.writeFieldBegin(CERT_PEM_FIELD_DESC);
          oprot.writeString(struct.cert_pem);
          oprot.writeFieldEnd();
        }
      }
      if (struct.subject != null) {
        if (struct.isSetSubject()) {
          oprot.writeFieldBegin(SUBJECT_FIELD_DESC);
          oprot.writeString(struct.subject);
          oprot.writeFieldEnd();
        }
      }
      if (struct.san != null) {
        if (struct.isSetSan()) {
          oprot.writeFieldBegin(SAN_FIELD_DESC);
          oprot.writeString(struct.san);
          oprot.writeFieldEnd();
        }
      }
      if (struct.issuer != null) {
        if (struct.isSetIssuer()) {
          oprot.writeFieldBegin(ISSUER_FIELD_DESC);
          oprot.writeString(struct.issuer);
          oprot.writeFieldEnd();
        }
      }
      if (struct.cipher != null) {
        if (struct.isSetCipher()) {
          oprot.writeFieldBegin(CIPHER_FIELD_DESC);
          oprot.writeString(struct.cipher);
          oprot.writeFieldEnd();
        }
      }
      if (struct.validity_not_before != null) {
        if (struct.isSetValidityNotBefore()) {
          oprot.writeFieldBegin(VALIDITY_NOT_BEFORE_FIELD_DESC);
          oprot.writeString(struct.validity_not_before);
          oprot.writeFieldEnd();
        }
      }
      if (struct.validity_not_after != null) {
        if (struct.isSetValidityNotAfter()) {
          oprot.writeFieldBegin(VALIDITY_NOT_AFTER_FIELD_DESC);
          oprot.writeString(struct.validity_not_after);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

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

  private static class TCertBasedAuthTupleScheme extends org.apache.thrift.scheme.TupleScheme<TCertBasedAuth> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TCertBasedAuth struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetCertPem()) {
        optionals.set(0);
      }
      if (struct.isSetSubject()) {
        optionals.set(1);
      }
      if (struct.isSetSan()) {
        optionals.set(2);
      }
      if (struct.isSetIssuer()) {
        optionals.set(3);
      }
      if (struct.isSetCipher()) {
        optionals.set(4);
      }
      if (struct.isSetValidityNotBefore()) {
        optionals.set(5);
      }
      if (struct.isSetValidityNotAfter()) {
        optionals.set(6);
      }
      oprot.writeBitSet(optionals, 7);
      if (struct.isSetCertPem()) {
        oprot.writeString(struct.cert_pem);
      }
      if (struct.isSetSubject()) {
        oprot.writeString(struct.subject);
      }
      if (struct.isSetSan()) {
        oprot.writeString(struct.san);
      }
      if (struct.isSetIssuer()) {
        oprot.writeString(struct.issuer);
      }
      if (struct.isSetCipher()) {
        oprot.writeString(struct.cipher);
      }
      if (struct.isSetValidityNotBefore()) {
        oprot.writeString(struct.validity_not_before);
      }
      if (struct.isSetValidityNotAfter()) {
        oprot.writeString(struct.validity_not_after);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TCertBasedAuth struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet incoming = iprot.readBitSet(7);
      if (incoming.get(0)) {
        struct.cert_pem = iprot.readString();
        struct.setCertPemIsSet(true);
      }
      if (incoming.get(1)) {
        struct.subject = iprot.readString();
        struct.setSubjectIsSet(true);
      }
      if (incoming.get(2)) {
        struct.san = iprot.readString();
        struct.setSanIsSet(true);
      }
      if (incoming.get(3)) {
        struct.issuer = iprot.readString();
        struct.setIssuerIsSet(true);
      }
      if (incoming.get(4)) {
        struct.cipher = iprot.readString();
        struct.setCipherIsSet(true);
      }
      if (incoming.get(5)) {
        struct.validity_not_before = iprot.readString();
        struct.setValidityNotBeforeIsSet(true);
      }
      if (incoming.get(6)) {
        struct.validity_not_after = iprot.readString();
        struct.setValidityNotAfterIsSet(true);
      }
    }
  }

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