/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/security/privateca/v1beta1/resources.proto

package com.google.cloud.security.privateca.v1beta1;

/**
 *
 *
 * <pre>
 * [SubjectAltNames][google.cloud.security.privateca.v1beta1.SubjectAltNames] corresponds to a more modern way of listing what
 * the asserted identity is in a certificate (i.e., compared to the "common
 * name" in the distinguished name).
 * </pre>
 *
 * Protobuf type {@code google.cloud.security.privateca.v1beta1.SubjectAltNames}
 */
public final class SubjectAltNames extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.security.privateca.v1beta1.SubjectAltNames)
    SubjectAltNamesOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use SubjectAltNames.newBuilder() to construct.
  private SubjectAltNames(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private SubjectAltNames() {
    dnsNames_ = com.google.protobuf.LazyStringArrayList.EMPTY;
    uris_ = com.google.protobuf.LazyStringArrayList.EMPTY;
    emailAddresses_ = com.google.protobuf.LazyStringArrayList.EMPTY;
    ipAddresses_ = com.google.protobuf.LazyStringArrayList.EMPTY;
    customSans_ = java.util.Collections.emptyList();
  }

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    return new SubjectAltNames();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    return this.unknownFields;
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
        .internal_static_google_cloud_security_privateca_v1beta1_SubjectAltNames_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
        .internal_static_google_cloud_security_privateca_v1beta1_SubjectAltNames_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.security.privateca.v1beta1.SubjectAltNames.class,
            com.google.cloud.security.privateca.v1beta1.SubjectAltNames.Builder.class);
  }

  public static final int DNS_NAMES_FIELD_NUMBER = 1;

  @SuppressWarnings("serial")
  private com.google.protobuf.LazyStringList dnsNames_;
  /**
   *
   *
   * <pre>
   * Contains only valid, fully-qualified host names.
   * </pre>
   *
   * <code>repeated string dns_names = 1;</code>
   *
   * @return A list containing the dnsNames.
   */
  public com.google.protobuf.ProtocolStringList getDnsNamesList() {
    return dnsNames_;
  }
  /**
   *
   *
   * <pre>
   * Contains only valid, fully-qualified host names.
   * </pre>
   *
   * <code>repeated string dns_names = 1;</code>
   *
   * @return The count of dnsNames.
   */
  public int getDnsNamesCount() {
    return dnsNames_.size();
  }
  /**
   *
   *
   * <pre>
   * Contains only valid, fully-qualified host names.
   * </pre>
   *
   * <code>repeated string dns_names = 1;</code>
   *
   * @param index The index of the element to return.
   * @return The dnsNames at the given index.
   */
  public java.lang.String getDnsNames(int index) {
    return dnsNames_.get(index);
  }
  /**
   *
   *
   * <pre>
   * Contains only valid, fully-qualified host names.
   * </pre>
   *
   * <code>repeated string dns_names = 1;</code>
   *
   * @param index The index of the value to return.
   * @return The bytes of the dnsNames at the given index.
   */
  public com.google.protobuf.ByteString getDnsNamesBytes(int index) {
    return dnsNames_.getByteString(index);
  }

  public static final int URIS_FIELD_NUMBER = 2;

  @SuppressWarnings("serial")
  private com.google.protobuf.LazyStringList uris_;
  /**
   *
   *
   * <pre>
   * Contains only valid RFC 3986 URIs.
   * </pre>
   *
   * <code>repeated string uris = 2;</code>
   *
   * @return A list containing the uris.
   */
  public com.google.protobuf.ProtocolStringList getUrisList() {
    return uris_;
  }
  /**
   *
   *
   * <pre>
   * Contains only valid RFC 3986 URIs.
   * </pre>
   *
   * <code>repeated string uris = 2;</code>
   *
   * @return The count of uris.
   */
  public int getUrisCount() {
    return uris_.size();
  }
  /**
   *
   *
   * <pre>
   * Contains only valid RFC 3986 URIs.
   * </pre>
   *
   * <code>repeated string uris = 2;</code>
   *
   * @param index The index of the element to return.
   * @return The uris at the given index.
   */
  public java.lang.String getUris(int index) {
    return uris_.get(index);
  }
  /**
   *
   *
   * <pre>
   * Contains only valid RFC 3986 URIs.
   * </pre>
   *
   * <code>repeated string uris = 2;</code>
   *
   * @param index The index of the value to return.
   * @return The bytes of the uris at the given index.
   */
  public com.google.protobuf.ByteString getUrisBytes(int index) {
    return uris_.getByteString(index);
  }

  public static final int EMAIL_ADDRESSES_FIELD_NUMBER = 3;

  @SuppressWarnings("serial")
  private com.google.protobuf.LazyStringList emailAddresses_;
  /**
   *
   *
   * <pre>
   * Contains only valid RFC 2822 E-mail addresses.
   * </pre>
   *
   * <code>repeated string email_addresses = 3;</code>
   *
   * @return A list containing the emailAddresses.
   */
  public com.google.protobuf.ProtocolStringList getEmailAddressesList() {
    return emailAddresses_;
  }
  /**
   *
   *
   * <pre>
   * Contains only valid RFC 2822 E-mail addresses.
   * </pre>
   *
   * <code>repeated string email_addresses = 3;</code>
   *
   * @return The count of emailAddresses.
   */
  public int getEmailAddressesCount() {
    return emailAddresses_.size();
  }
  /**
   *
   *
   * <pre>
   * Contains only valid RFC 2822 E-mail addresses.
   * </pre>
   *
   * <code>repeated string email_addresses = 3;</code>
   *
   * @param index The index of the element to return.
   * @return The emailAddresses at the given index.
   */
  public java.lang.String getEmailAddresses(int index) {
    return emailAddresses_.get(index);
  }
  /**
   *
   *
   * <pre>
   * Contains only valid RFC 2822 E-mail addresses.
   * </pre>
   *
   * <code>repeated string email_addresses = 3;</code>
   *
   * @param index The index of the value to return.
   * @return The bytes of the emailAddresses at the given index.
   */
  public com.google.protobuf.ByteString getEmailAddressesBytes(int index) {
    return emailAddresses_.getByteString(index);
  }

  public static final int IP_ADDRESSES_FIELD_NUMBER = 4;

  @SuppressWarnings("serial")
  private com.google.protobuf.LazyStringList ipAddresses_;
  /**
   *
   *
   * <pre>
   * Contains only valid 32-bit IPv4 addresses or RFC 4291 IPv6 addresses.
   * </pre>
   *
   * <code>repeated string ip_addresses = 4;</code>
   *
   * @return A list containing the ipAddresses.
   */
  public com.google.protobuf.ProtocolStringList getIpAddressesList() {
    return ipAddresses_;
  }
  /**
   *
   *
   * <pre>
   * Contains only valid 32-bit IPv4 addresses or RFC 4291 IPv6 addresses.
   * </pre>
   *
   * <code>repeated string ip_addresses = 4;</code>
   *
   * @return The count of ipAddresses.
   */
  public int getIpAddressesCount() {
    return ipAddresses_.size();
  }
  /**
   *
   *
   * <pre>
   * Contains only valid 32-bit IPv4 addresses or RFC 4291 IPv6 addresses.
   * </pre>
   *
   * <code>repeated string ip_addresses = 4;</code>
   *
   * @param index The index of the element to return.
   * @return The ipAddresses at the given index.
   */
  public java.lang.String getIpAddresses(int index) {
    return ipAddresses_.get(index);
  }
  /**
   *
   *
   * <pre>
   * Contains only valid 32-bit IPv4 addresses or RFC 4291 IPv6 addresses.
   * </pre>
   *
   * <code>repeated string ip_addresses = 4;</code>
   *
   * @param index The index of the value to return.
   * @return The bytes of the ipAddresses at the given index.
   */
  public com.google.protobuf.ByteString getIpAddressesBytes(int index) {
    return ipAddresses_.getByteString(index);
  }

  public static final int CUSTOM_SANS_FIELD_NUMBER = 5;

  @SuppressWarnings("serial")
  private java.util.List<com.google.cloud.security.privateca.v1beta1.X509Extension> customSans_;
  /**
   *
   *
   * <pre>
   * Contains additional subject alternative name values.
   * </pre>
   *
   * <code>repeated .google.cloud.security.privateca.v1beta1.X509Extension custom_sans = 5;</code>
   */
  @java.lang.Override
  public java.util.List<com.google.cloud.security.privateca.v1beta1.X509Extension>
      getCustomSansList() {
    return customSans_;
  }
  /**
   *
   *
   * <pre>
   * Contains additional subject alternative name values.
   * </pre>
   *
   * <code>repeated .google.cloud.security.privateca.v1beta1.X509Extension custom_sans = 5;</code>
   */
  @java.lang.Override
  public java.util.List<
          ? extends com.google.cloud.security.privateca.v1beta1.X509ExtensionOrBuilder>
      getCustomSansOrBuilderList() {
    return customSans_;
  }
  /**
   *
   *
   * <pre>
   * Contains additional subject alternative name values.
   * </pre>
   *
   * <code>repeated .google.cloud.security.privateca.v1beta1.X509Extension custom_sans = 5;</code>
   */
  @java.lang.Override
  public int getCustomSansCount() {
    return customSans_.size();
  }
  /**
   *
   *
   * <pre>
   * Contains additional subject alternative name values.
   * </pre>
   *
   * <code>repeated .google.cloud.security.privateca.v1beta1.X509Extension custom_sans = 5;</code>
   */
  @java.lang.Override
  public com.google.cloud.security.privateca.v1beta1.X509Extension getCustomSans(int index) {
    return customSans_.get(index);
  }
  /**
   *
   *
   * <pre>
   * Contains additional subject alternative name values.
   * </pre>
   *
   * <code>repeated .google.cloud.security.privateca.v1beta1.X509Extension custom_sans = 5;</code>
   */
  @java.lang.Override
  public com.google.cloud.security.privateca.v1beta1.X509ExtensionOrBuilder getCustomSansOrBuilder(
      int index) {
    return customSans_.get(index);
  }

  private byte memoizedIsInitialized = -1;

  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    for (int i = 0; i < dnsNames_.size(); i++) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, dnsNames_.getRaw(i));
    }
    for (int i = 0; i < uris_.size(); i++) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, uris_.getRaw(i));
    }
    for (int i = 0; i < emailAddresses_.size(); i++) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, emailAddresses_.getRaw(i));
    }
    for (int i = 0; i < ipAddresses_.size(); i++) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 4, ipAddresses_.getRaw(i));
    }
    for (int i = 0; i < customSans_.size(); i++) {
      output.writeMessage(5, customSans_.get(i));
    }
    getUnknownFields().writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    {
      int dataSize = 0;
      for (int i = 0; i < dnsNames_.size(); i++) {
        dataSize += computeStringSizeNoTag(dnsNames_.getRaw(i));
      }
      size += dataSize;
      size += 1 * getDnsNamesList().size();
    }
    {
      int dataSize = 0;
      for (int i = 0; i < uris_.size(); i++) {
        dataSize += computeStringSizeNoTag(uris_.getRaw(i));
      }
      size += dataSize;
      size += 1 * getUrisList().size();
    }
    {
      int dataSize = 0;
      for (int i = 0; i < emailAddresses_.size(); i++) {
        dataSize += computeStringSizeNoTag(emailAddresses_.getRaw(i));
      }
      size += dataSize;
      size += 1 * getEmailAddressesList().size();
    }
    {
      int dataSize = 0;
      for (int i = 0; i < ipAddresses_.size(); i++) {
        dataSize += computeStringSizeNoTag(ipAddresses_.getRaw(i));
      }
      size += dataSize;
      size += 1 * getIpAddressesList().size();
    }
    for (int i = 0; i < customSans_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, customSans_.get(i));
    }
    size += getUnknownFields().getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
      return true;
    }
    if (!(obj instanceof com.google.cloud.security.privateca.v1beta1.SubjectAltNames)) {
      return super.equals(obj);
    }
    com.google.cloud.security.privateca.v1beta1.SubjectAltNames other =
        (com.google.cloud.security.privateca.v1beta1.SubjectAltNames) obj;

    if (!getDnsNamesList().equals(other.getDnsNamesList())) return false;
    if (!getUrisList().equals(other.getUrisList())) return false;
    if (!getEmailAddressesList().equals(other.getEmailAddressesList())) return false;
    if (!getIpAddressesList().equals(other.getIpAddressesList())) return false;
    if (!getCustomSansList().equals(other.getCustomSansList())) return false;
    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    if (getDnsNamesCount() > 0) {
      hash = (37 * hash) + DNS_NAMES_FIELD_NUMBER;
      hash = (53 * hash) + getDnsNamesList().hashCode();
    }
    if (getUrisCount() > 0) {
      hash = (37 * hash) + URIS_FIELD_NUMBER;
      hash = (53 * hash) + getUrisList().hashCode();
    }
    if (getEmailAddressesCount() > 0) {
      hash = (37 * hash) + EMAIL_ADDRESSES_FIELD_NUMBER;
      hash = (53 * hash) + getEmailAddressesList().hashCode();
    }
    if (getIpAddressesCount() > 0) {
      hash = (37 * hash) + IP_ADDRESSES_FIELD_NUMBER;
      hash = (53 * hash) + getIpAddressesList().hashCode();
    }
    if (getCustomSansCount() > 0) {
      hash = (37 * hash) + CUSTOM_SANS_FIELD_NUMBER;
      hash = (53 * hash) + getCustomSansList().hashCode();
    }
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.security.privateca.v1beta1.SubjectAltNames parseFrom(
      java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.security.privateca.v1beta1.SubjectAltNames parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.security.privateca.v1beta1.SubjectAltNames parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.security.privateca.v1beta1.SubjectAltNames parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.security.privateca.v1beta1.SubjectAltNames parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.security.privateca.v1beta1.SubjectAltNames parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.security.privateca.v1beta1.SubjectAltNames parseFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.security.privateca.v1beta1.SubjectAltNames parseFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.security.privateca.v1beta1.SubjectAltNames parseDelimitedFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.cloud.security.privateca.v1beta1.SubjectAltNames parseDelimitedFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.security.privateca.v1beta1.SubjectAltNames parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.security.privateca.v1beta1.SubjectAltNames parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() {
    return newBuilder();
  }

  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }

  public static Builder newBuilder(
      com.google.cloud.security.privateca.v1beta1.SubjectAltNames prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }

  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   *
   *
   * <pre>
   * [SubjectAltNames][google.cloud.security.privateca.v1beta1.SubjectAltNames] corresponds to a more modern way of listing what
   * the asserted identity is in a certificate (i.e., compared to the "common
   * name" in the distinguished name).
   * </pre>
   *
   * Protobuf type {@code google.cloud.security.privateca.v1beta1.SubjectAltNames}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.security.privateca.v1beta1.SubjectAltNames)
      com.google.cloud.security.privateca.v1beta1.SubjectAltNamesOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
          .internal_static_google_cloud_security_privateca_v1beta1_SubjectAltNames_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
          .internal_static_google_cloud_security_privateca_v1beta1_SubjectAltNames_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.security.privateca.v1beta1.SubjectAltNames.class,
              com.google.cloud.security.privateca.v1beta1.SubjectAltNames.Builder.class);
    }

    // Construct using com.google.cloud.security.privateca.v1beta1.SubjectAltNames.newBuilder()
    private Builder() {}

    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      dnsNames_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000001);
      uris_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000002);
      emailAddresses_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000004);
      ipAddresses_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000008);
      if (customSansBuilder_ == null) {
        customSans_ = java.util.Collections.emptyList();
      } else {
        customSans_ = null;
        customSansBuilder_.clear();
      }
      bitField0_ = (bitField0_ & ~0x00000010);
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.security.privateca.v1beta1.PrivateCaResourcesProto
          .internal_static_google_cloud_security_privateca_v1beta1_SubjectAltNames_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.security.privateca.v1beta1.SubjectAltNames getDefaultInstanceForType() {
      return com.google.cloud.security.privateca.v1beta1.SubjectAltNames.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.cloud.security.privateca.v1beta1.SubjectAltNames build() {
      com.google.cloud.security.privateca.v1beta1.SubjectAltNames result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.cloud.security.privateca.v1beta1.SubjectAltNames buildPartial() {
      com.google.cloud.security.privateca.v1beta1.SubjectAltNames result =
          new com.google.cloud.security.privateca.v1beta1.SubjectAltNames(this);
      buildPartialRepeatedFields(result);
      if (bitField0_ != 0) {
        buildPartial0(result);
      }
      onBuilt();
      return result;
    }

    private void buildPartialRepeatedFields(
        com.google.cloud.security.privateca.v1beta1.SubjectAltNames result) {
      if (((bitField0_ & 0x00000001) != 0)) {
        dnsNames_ = dnsNames_.getUnmodifiableView();
        bitField0_ = (bitField0_ & ~0x00000001);
      }
      result.dnsNames_ = dnsNames_;
      if (((bitField0_ & 0x00000002) != 0)) {
        uris_ = uris_.getUnmodifiableView();
        bitField0_ = (bitField0_ & ~0x00000002);
      }
      result.uris_ = uris_;
      if (((bitField0_ & 0x00000004) != 0)) {
        emailAddresses_ = emailAddresses_.getUnmodifiableView();
        bitField0_ = (bitField0_ & ~0x00000004);
      }
      result.emailAddresses_ = emailAddresses_;
      if (((bitField0_ & 0x00000008) != 0)) {
        ipAddresses_ = ipAddresses_.getUnmodifiableView();
        bitField0_ = (bitField0_ & ~0x00000008);
      }
      result.ipAddresses_ = ipAddresses_;
      if (customSansBuilder_ == null) {
        if (((bitField0_ & 0x00000010) != 0)) {
          customSans_ = java.util.Collections.unmodifiableList(customSans_);
          bitField0_ = (bitField0_ & ~0x00000010);
        }
        result.customSans_ = customSans_;
      } else {
        result.customSans_ = customSansBuilder_.build();
      }
    }

    private void buildPartial0(com.google.cloud.security.privateca.v1beta1.SubjectAltNames result) {
      int from_bitField0_ = bitField0_;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }

    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.setField(field, value);
    }

    @java.lang.Override
    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }

    @java.lang.Override
    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }

    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }

    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.cloud.security.privateca.v1beta1.SubjectAltNames) {
        return mergeFrom((com.google.cloud.security.privateca.v1beta1.SubjectAltNames) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.security.privateca.v1beta1.SubjectAltNames other) {
      if (other == com.google.cloud.security.privateca.v1beta1.SubjectAltNames.getDefaultInstance())
        return this;
      if (!other.dnsNames_.isEmpty()) {
        if (dnsNames_.isEmpty()) {
          dnsNames_ = other.dnsNames_;
          bitField0_ = (bitField0_ & ~0x00000001);
        } else {
          ensureDnsNamesIsMutable();
          dnsNames_.addAll(other.dnsNames_);
        }
        onChanged();
      }
      if (!other.uris_.isEmpty()) {
        if (uris_.isEmpty()) {
          uris_ = other.uris_;
          bitField0_ = (bitField0_ & ~0x00000002);
        } else {
          ensureUrisIsMutable();
          uris_.addAll(other.uris_);
        }
        onChanged();
      }
      if (!other.emailAddresses_.isEmpty()) {
        if (emailAddresses_.isEmpty()) {
          emailAddresses_ = other.emailAddresses_;
          bitField0_ = (bitField0_ & ~0x00000004);
        } else {
          ensureEmailAddressesIsMutable();
          emailAddresses_.addAll(other.emailAddresses_);
        }
        onChanged();
      }
      if (!other.ipAddresses_.isEmpty()) {
        if (ipAddresses_.isEmpty()) {
          ipAddresses_ = other.ipAddresses_;
          bitField0_ = (bitField0_ & ~0x00000008);
        } else {
          ensureIpAddressesIsMutable();
          ipAddresses_.addAll(other.ipAddresses_);
        }
        onChanged();
      }
      if (customSansBuilder_ == null) {
        if (!other.customSans_.isEmpty()) {
          if (customSans_.isEmpty()) {
            customSans_ = other.customSans_;
            bitField0_ = (bitField0_ & ~0x00000010);
          } else {
            ensureCustomSansIsMutable();
            customSans_.addAll(other.customSans_);
          }
          onChanged();
        }
      } else {
        if (!other.customSans_.isEmpty()) {
          if (customSansBuilder_.isEmpty()) {
            customSansBuilder_.dispose();
            customSansBuilder_ = null;
            customSans_ = other.customSans_;
            bitField0_ = (bitField0_ & ~0x00000010);
            customSansBuilder_ =
                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
                    ? getCustomSansFieldBuilder()
                    : null;
          } else {
            customSansBuilder_.addAllMessages(other.customSans_);
          }
        }
      }
      this.mergeUnknownFields(other.getUnknownFields());
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 10:
              {
                java.lang.String s = input.readStringRequireUtf8();
                ensureDnsNamesIsMutable();
                dnsNames_.add(s);
                break;
              } // case 10
            case 18:
              {
                java.lang.String s = input.readStringRequireUtf8();
                ensureUrisIsMutable();
                uris_.add(s);
                break;
              } // case 18
            case 26:
              {
                java.lang.String s = input.readStringRequireUtf8();
                ensureEmailAddressesIsMutable();
                emailAddresses_.add(s);
                break;
              } // case 26
            case 34:
              {
                java.lang.String s = input.readStringRequireUtf8();
                ensureIpAddressesIsMutable();
                ipAddresses_.add(s);
                break;
              } // case 34
            case 42:
              {
                com.google.cloud.security.privateca.v1beta1.X509Extension m =
                    input.readMessage(
                        com.google.cloud.security.privateca.v1beta1.X509Extension.parser(),
                        extensionRegistry);
                if (customSansBuilder_ == null) {
                  ensureCustomSansIsMutable();
                  customSans_.add(m);
                } else {
                  customSansBuilder_.addMessage(m);
                }
                break;
              } // case 42
            default:
              {
                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                  done = true; // was an endgroup tag
                }
                break;
              } // default:
          } // switch (tag)
        } // while (!done)
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.unwrapIOException();
      } finally {
        onChanged();
      } // finally
      return this;
    }

    private int bitField0_;

    private com.google.protobuf.LazyStringList dnsNames_ =
        com.google.protobuf.LazyStringArrayList.EMPTY;

    private void ensureDnsNamesIsMutable() {
      if (!((bitField0_ & 0x00000001) != 0)) {
        dnsNames_ = new com.google.protobuf.LazyStringArrayList(dnsNames_);
        bitField0_ |= 0x00000001;
      }
    }
    /**
     *
     *
     * <pre>
     * Contains only valid, fully-qualified host names.
     * </pre>
     *
     * <code>repeated string dns_names = 1;</code>
     *
     * @return A list containing the dnsNames.
     */
    public com.google.protobuf.ProtocolStringList getDnsNamesList() {
      return dnsNames_.getUnmodifiableView();
    }
    /**
     *
     *
     * <pre>
     * Contains only valid, fully-qualified host names.
     * </pre>
     *
     * <code>repeated string dns_names = 1;</code>
     *
     * @return The count of dnsNames.
     */
    public int getDnsNamesCount() {
      return dnsNames_.size();
    }
    /**
     *
     *
     * <pre>
     * Contains only valid, fully-qualified host names.
     * </pre>
     *
     * <code>repeated string dns_names = 1;</code>
     *
     * @param index The index of the element to return.
     * @return The dnsNames at the given index.
     */
    public java.lang.String getDnsNames(int index) {
      return dnsNames_.get(index);
    }
    /**
     *
     *
     * <pre>
     * Contains only valid, fully-qualified host names.
     * </pre>
     *
     * <code>repeated string dns_names = 1;</code>
     *
     * @param index The index of the value to return.
     * @return The bytes of the dnsNames at the given index.
     */
    public com.google.protobuf.ByteString getDnsNamesBytes(int index) {
      return dnsNames_.getByteString(index);
    }
    /**
     *
     *
     * <pre>
     * Contains only valid, fully-qualified host names.
     * </pre>
     *
     * <code>repeated string dns_names = 1;</code>
     *
     * @param index The index to set the value at.
     * @param value The dnsNames to set.
     * @return This builder for chaining.
     */
    public Builder setDnsNames(int index, java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureDnsNamesIsMutable();
      dnsNames_.set(index, value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Contains only valid, fully-qualified host names.
     * </pre>
     *
     * <code>repeated string dns_names = 1;</code>
     *
     * @param value The dnsNames to add.
     * @return This builder for chaining.
     */
    public Builder addDnsNames(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureDnsNamesIsMutable();
      dnsNames_.add(value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Contains only valid, fully-qualified host names.
     * </pre>
     *
     * <code>repeated string dns_names = 1;</code>
     *
     * @param values The dnsNames to add.
     * @return This builder for chaining.
     */
    public Builder addAllDnsNames(java.lang.Iterable<java.lang.String> values) {
      ensureDnsNamesIsMutable();
      com.google.protobuf.AbstractMessageLite.Builder.addAll(values, dnsNames_);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Contains only valid, fully-qualified host names.
     * </pre>
     *
     * <code>repeated string dns_names = 1;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearDnsNames() {
      dnsNames_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000001);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Contains only valid, fully-qualified host names.
     * </pre>
     *
     * <code>repeated string dns_names = 1;</code>
     *
     * @param value The bytes of the dnsNames to add.
     * @return This builder for chaining.
     */
    public Builder addDnsNamesBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      ensureDnsNamesIsMutable();
      dnsNames_.add(value);
      onChanged();
      return this;
    }

    private com.google.protobuf.LazyStringList uris_ =
        com.google.protobuf.LazyStringArrayList.EMPTY;

    private void ensureUrisIsMutable() {
      if (!((bitField0_ & 0x00000002) != 0)) {
        uris_ = new com.google.protobuf.LazyStringArrayList(uris_);
        bitField0_ |= 0x00000002;
      }
    }
    /**
     *
     *
     * <pre>
     * Contains only valid RFC 3986 URIs.
     * </pre>
     *
     * <code>repeated string uris = 2;</code>
     *
     * @return A list containing the uris.
     */
    public com.google.protobuf.ProtocolStringList getUrisList() {
      return uris_.getUnmodifiableView();
    }
    /**
     *
     *
     * <pre>
     * Contains only valid RFC 3986 URIs.
     * </pre>
     *
     * <code>repeated string uris = 2;</code>
     *
     * @return The count of uris.
     */
    public int getUrisCount() {
      return uris_.size();
    }
    /**
     *
     *
     * <pre>
     * Contains only valid RFC 3986 URIs.
     * </pre>
     *
     * <code>repeated string uris = 2;</code>
     *
     * @param index The index of the element to return.
     * @return The uris at the given index.
     */
    public java.lang.String getUris(int index) {
      return uris_.get(index);
    }
    /**
     *
     *
     * <pre>
     * Contains only valid RFC 3986 URIs.
     * </pre>
     *
     * <code>repeated string uris = 2;</code>
     *
     * @param index The index of the value to return.
     * @return The bytes of the uris at the given index.
     */
    public com.google.protobuf.ByteString getUrisBytes(int index) {
      return uris_.getByteString(index);
    }
    /**
     *
     *
     * <pre>
     * Contains only valid RFC 3986 URIs.
     * </pre>
     *
     * <code>repeated string uris = 2;</code>
     *
     * @param index The index to set the value at.
     * @param value The uris to set.
     * @return This builder for chaining.
     */
    public Builder setUris(int index, java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureUrisIsMutable();
      uris_.set(index, value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Contains only valid RFC 3986 URIs.
     * </pre>
     *
     * <code>repeated string uris = 2;</code>
     *
     * @param value The uris to add.
     * @return This builder for chaining.
     */
    public Builder addUris(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureUrisIsMutable();
      uris_.add(value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Contains only valid RFC 3986 URIs.
     * </pre>
     *
     * <code>repeated string uris = 2;</code>
     *
     * @param values The uris to add.
     * @return This builder for chaining.
     */
    public Builder addAllUris(java.lang.Iterable<java.lang.String> values) {
      ensureUrisIsMutable();
      com.google.protobuf.AbstractMessageLite.Builder.addAll(values, uris_);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Contains only valid RFC 3986 URIs.
     * </pre>
     *
     * <code>repeated string uris = 2;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearUris() {
      uris_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000002);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Contains only valid RFC 3986 URIs.
     * </pre>
     *
     * <code>repeated string uris = 2;</code>
     *
     * @param value The bytes of the uris to add.
     * @return This builder for chaining.
     */
    public Builder addUrisBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      ensureUrisIsMutable();
      uris_.add(value);
      onChanged();
      return this;
    }

    private com.google.protobuf.LazyStringList emailAddresses_ =
        com.google.protobuf.LazyStringArrayList.EMPTY;

    private void ensureEmailAddressesIsMutable() {
      if (!((bitField0_ & 0x00000004) != 0)) {
        emailAddresses_ = new com.google.protobuf.LazyStringArrayList(emailAddresses_);
        bitField0_ |= 0x00000004;
      }
    }
    /**
     *
     *
     * <pre>
     * Contains only valid RFC 2822 E-mail addresses.
     * </pre>
     *
     * <code>repeated string email_addresses = 3;</code>
     *
     * @return A list containing the emailAddresses.
     */
    public com.google.protobuf.ProtocolStringList getEmailAddressesList() {
      return emailAddresses_.getUnmodifiableView();
    }
    /**
     *
     *
     * <pre>
     * Contains only valid RFC 2822 E-mail addresses.
     * </pre>
     *
     * <code>repeated string email_addresses = 3;</code>
     *
     * @return The count of emailAddresses.
     */
    public int getEmailAddressesCount() {
      return emailAddresses_.size();
    }
    /**
     *
     *
     * <pre>
     * Contains only valid RFC 2822 E-mail addresses.
     * </pre>
     *
     * <code>repeated string email_addresses = 3;</code>
     *
     * @param index The index of the element to return.
     * @return The emailAddresses at the given index.
     */
    public java.lang.String getEmailAddresses(int index) {
      return emailAddresses_.get(index);
    }
    /**
     *
     *
     * <pre>
     * Contains only valid RFC 2822 E-mail addresses.
     * </pre>
     *
     * <code>repeated string email_addresses = 3;</code>
     *
     * @param index The index of the value to return.
     * @return The bytes of the emailAddresses at the given index.
     */
    public com.google.protobuf.ByteString getEmailAddressesBytes(int index) {
      return emailAddresses_.getByteString(index);
    }
    /**
     *
     *
     * <pre>
     * Contains only valid RFC 2822 E-mail addresses.
     * </pre>
     *
     * <code>repeated string email_addresses = 3;</code>
     *
     * @param index The index to set the value at.
     * @param value The emailAddresses to set.
     * @return This builder for chaining.
     */
    public Builder setEmailAddresses(int index, java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureEmailAddressesIsMutable();
      emailAddresses_.set(index, value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Contains only valid RFC 2822 E-mail addresses.
     * </pre>
     *
     * <code>repeated string email_addresses = 3;</code>
     *
     * @param value The emailAddresses to add.
     * @return This builder for chaining.
     */
    public Builder addEmailAddresses(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureEmailAddressesIsMutable();
      emailAddresses_.add(value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Contains only valid RFC 2822 E-mail addresses.
     * </pre>
     *
     * <code>repeated string email_addresses = 3;</code>
     *
     * @param values The emailAddresses to add.
     * @return This builder for chaining.
     */
    public Builder addAllEmailAddresses(java.lang.Iterable<java.lang.String> values) {
      ensureEmailAddressesIsMutable();
      com.google.protobuf.AbstractMessageLite.Builder.addAll(values, emailAddresses_);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Contains only valid RFC 2822 E-mail addresses.
     * </pre>
     *
     * <code>repeated string email_addresses = 3;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearEmailAddresses() {
      emailAddresses_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000004);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Contains only valid RFC 2822 E-mail addresses.
     * </pre>
     *
     * <code>repeated string email_addresses = 3;</code>
     *
     * @param value The bytes of the emailAddresses to add.
     * @return This builder for chaining.
     */
    public Builder addEmailAddressesBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      ensureEmailAddressesIsMutable();
      emailAddresses_.add(value);
      onChanged();
      return this;
    }

    private com.google.protobuf.LazyStringList ipAddresses_ =
        com.google.protobuf.LazyStringArrayList.EMPTY;

    private void ensureIpAddressesIsMutable() {
      if (!((bitField0_ & 0x00000008) != 0)) {
        ipAddresses_ = new com.google.protobuf.LazyStringArrayList(ipAddresses_);
        bitField0_ |= 0x00000008;
      }
    }
    /**
     *
     *
     * <pre>
     * Contains only valid 32-bit IPv4 addresses or RFC 4291 IPv6 addresses.
     * </pre>
     *
     * <code>repeated string ip_addresses = 4;</code>
     *
     * @return A list containing the ipAddresses.
     */
    public com.google.protobuf.ProtocolStringList getIpAddressesList() {
      return ipAddresses_.getUnmodifiableView();
    }
    /**
     *
     *
     * <pre>
     * Contains only valid 32-bit IPv4 addresses or RFC 4291 IPv6 addresses.
     * </pre>
     *
     * <code>repeated string ip_addresses = 4;</code>
     *
     * @return The count of ipAddresses.
     */
    public int getIpAddressesCount() {
      return ipAddresses_.size();
    }
    /**
     *
     *
     * <pre>
     * Contains only valid 32-bit IPv4 addresses or RFC 4291 IPv6 addresses.
     * </pre>
     *
     * <code>repeated string ip_addresses = 4;</code>
     *
     * @param index The index of the element to return.
     * @return The ipAddresses at the given index.
     */
    public java.lang.String getIpAddresses(int index) {
      return ipAddresses_.get(index);
    }
    /**
     *
     *
     * <pre>
     * Contains only valid 32-bit IPv4 addresses or RFC 4291 IPv6 addresses.
     * </pre>
     *
     * <code>repeated string ip_addresses = 4;</code>
     *
     * @param index The index of the value to return.
     * @return The bytes of the ipAddresses at the given index.
     */
    public com.google.protobuf.ByteString getIpAddressesBytes(int index) {
      return ipAddresses_.getByteString(index);
    }
    /**
     *
     *
     * <pre>
     * Contains only valid 32-bit IPv4 addresses or RFC 4291 IPv6 addresses.
     * </pre>
     *
     * <code>repeated string ip_addresses = 4;</code>
     *
     * @param index The index to set the value at.
     * @param value The ipAddresses to set.
     * @return This builder for chaining.
     */
    public Builder setIpAddresses(int index, java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureIpAddressesIsMutable();
      ipAddresses_.set(index, value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Contains only valid 32-bit IPv4 addresses or RFC 4291 IPv6 addresses.
     * </pre>
     *
     * <code>repeated string ip_addresses = 4;</code>
     *
     * @param value The ipAddresses to add.
     * @return This builder for chaining.
     */
    public Builder addIpAddresses(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureIpAddressesIsMutable();
      ipAddresses_.add(value);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Contains only valid 32-bit IPv4 addresses or RFC 4291 IPv6 addresses.
     * </pre>
     *
     * <code>repeated string ip_addresses = 4;</code>
     *
     * @param values The ipAddresses to add.
     * @return This builder for chaining.
     */
    public Builder addAllIpAddresses(java.lang.Iterable<java.lang.String> values) {
      ensureIpAddressesIsMutable();
      com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ipAddresses_);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Contains only valid 32-bit IPv4 addresses or RFC 4291 IPv6 addresses.
     * </pre>
     *
     * <code>repeated string ip_addresses = 4;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearIpAddresses() {
      ipAddresses_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000008);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Contains only valid 32-bit IPv4 addresses or RFC 4291 IPv6 addresses.
     * </pre>
     *
     * <code>repeated string ip_addresses = 4;</code>
     *
     * @param value The bytes of the ipAddresses to add.
     * @return This builder for chaining.
     */
    public Builder addIpAddressesBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      ensureIpAddressesIsMutable();
      ipAddresses_.add(value);
      onChanged();
      return this;
    }

    private java.util.List<com.google.cloud.security.privateca.v1beta1.X509Extension> customSans_ =
        java.util.Collections.emptyList();

    private void ensureCustomSansIsMutable() {
      if (!((bitField0_ & 0x00000010) != 0)) {
        customSans_ =
            new java.util.ArrayList<com.google.cloud.security.privateca.v1beta1.X509Extension>(
                customSans_);
        bitField0_ |= 0x00000010;
      }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.security.privateca.v1beta1.X509Extension,
            com.google.cloud.security.privateca.v1beta1.X509Extension.Builder,
            com.google.cloud.security.privateca.v1beta1.X509ExtensionOrBuilder>
        customSansBuilder_;

    /**
     *
     *
     * <pre>
     * Contains additional subject alternative name values.
     * </pre>
     *
     * <code>repeated .google.cloud.security.privateca.v1beta1.X509Extension custom_sans = 5;</code>
     */
    public java.util.List<com.google.cloud.security.privateca.v1beta1.X509Extension>
        getCustomSansList() {
      if (customSansBuilder_ == null) {
        return java.util.Collections.unmodifiableList(customSans_);
      } else {
        return customSansBuilder_.getMessageList();
      }
    }
    /**
     *
     *
     * <pre>
     * Contains additional subject alternative name values.
     * </pre>
     *
     * <code>repeated .google.cloud.security.privateca.v1beta1.X509Extension custom_sans = 5;</code>
     */
    public int getCustomSansCount() {
      if (customSansBuilder_ == null) {
        return customSans_.size();
      } else {
        return customSansBuilder_.getCount();
      }
    }
    /**
     *
     *
     * <pre>
     * Contains additional subject alternative name values.
     * </pre>
     *
     * <code>repeated .google.cloud.security.privateca.v1beta1.X509Extension custom_sans = 5;</code>
     */
    public com.google.cloud.security.privateca.v1beta1.X509Extension getCustomSans(int index) {
      if (customSansBuilder_ == null) {
        return customSans_.get(index);
      } else {
        return customSansBuilder_.getMessage(index);
      }
    }
    /**
     *
     *
     * <pre>
     * Contains additional subject alternative name values.
     * </pre>
     *
     * <code>repeated .google.cloud.security.privateca.v1beta1.X509Extension custom_sans = 5;</code>
     */
    public Builder setCustomSans(
        int index, com.google.cloud.security.privateca.v1beta1.X509Extension value) {
      if (customSansBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureCustomSansIsMutable();
        customSans_.set(index, value);
        onChanged();
      } else {
        customSansBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Contains additional subject alternative name values.
     * </pre>
     *
     * <code>repeated .google.cloud.security.privateca.v1beta1.X509Extension custom_sans = 5;</code>
     */
    public Builder setCustomSans(
        int index,
        com.google.cloud.security.privateca.v1beta1.X509Extension.Builder builderForValue) {
      if (customSansBuilder_ == null) {
        ensureCustomSansIsMutable();
        customSans_.set(index, builderForValue.build());
        onChanged();
      } else {
        customSansBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Contains additional subject alternative name values.
     * </pre>
     *
     * <code>repeated .google.cloud.security.privateca.v1beta1.X509Extension custom_sans = 5;</code>
     */
    public Builder addCustomSans(com.google.cloud.security.privateca.v1beta1.X509Extension value) {
      if (customSansBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureCustomSansIsMutable();
        customSans_.add(value);
        onChanged();
      } else {
        customSansBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Contains additional subject alternative name values.
     * </pre>
     *
     * <code>repeated .google.cloud.security.privateca.v1beta1.X509Extension custom_sans = 5;</code>
     */
    public Builder addCustomSans(
        int index, com.google.cloud.security.privateca.v1beta1.X509Extension value) {
      if (customSansBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureCustomSansIsMutable();
        customSans_.add(index, value);
        onChanged();
      } else {
        customSansBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Contains additional subject alternative name values.
     * </pre>
     *
     * <code>repeated .google.cloud.security.privateca.v1beta1.X509Extension custom_sans = 5;</code>
     */
    public Builder addCustomSans(
        com.google.cloud.security.privateca.v1beta1.X509Extension.Builder builderForValue) {
      if (customSansBuilder_ == null) {
        ensureCustomSansIsMutable();
        customSans_.add(builderForValue.build());
        onChanged();
      } else {
        customSansBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Contains additional subject alternative name values.
     * </pre>
     *
     * <code>repeated .google.cloud.security.privateca.v1beta1.X509Extension custom_sans = 5;</code>
     */
    public Builder addCustomSans(
        int index,
        com.google.cloud.security.privateca.v1beta1.X509Extension.Builder builderForValue) {
      if (customSansBuilder_ == null) {
        ensureCustomSansIsMutable();
        customSans_.add(index, builderForValue.build());
        onChanged();
      } else {
        customSansBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Contains additional subject alternative name values.
     * </pre>
     *
     * <code>repeated .google.cloud.security.privateca.v1beta1.X509Extension custom_sans = 5;</code>
     */
    public Builder addAllCustomSans(
        java.lang.Iterable<? extends com.google.cloud.security.privateca.v1beta1.X509Extension>
            values) {
      if (customSansBuilder_ == null) {
        ensureCustomSansIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(values, customSans_);
        onChanged();
      } else {
        customSansBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Contains additional subject alternative name values.
     * </pre>
     *
     * <code>repeated .google.cloud.security.privateca.v1beta1.X509Extension custom_sans = 5;</code>
     */
    public Builder clearCustomSans() {
      if (customSansBuilder_ == null) {
        customSans_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000010);
        onChanged();
      } else {
        customSansBuilder_.clear();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Contains additional subject alternative name values.
     * </pre>
     *
     * <code>repeated .google.cloud.security.privateca.v1beta1.X509Extension custom_sans = 5;</code>
     */
    public Builder removeCustomSans(int index) {
      if (customSansBuilder_ == null) {
        ensureCustomSansIsMutable();
        customSans_.remove(index);
        onChanged();
      } else {
        customSansBuilder_.remove(index);
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * Contains additional subject alternative name values.
     * </pre>
     *
     * <code>repeated .google.cloud.security.privateca.v1beta1.X509Extension custom_sans = 5;</code>
     */
    public com.google.cloud.security.privateca.v1beta1.X509Extension.Builder getCustomSansBuilder(
        int index) {
      return getCustomSansFieldBuilder().getBuilder(index);
    }
    /**
     *
     *
     * <pre>
     * Contains additional subject alternative name values.
     * </pre>
     *
     * <code>repeated .google.cloud.security.privateca.v1beta1.X509Extension custom_sans = 5;</code>
     */
    public com.google.cloud.security.privateca.v1beta1.X509ExtensionOrBuilder
        getCustomSansOrBuilder(int index) {
      if (customSansBuilder_ == null) {
        return customSans_.get(index);
      } else {
        return customSansBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     *
     *
     * <pre>
     * Contains additional subject alternative name values.
     * </pre>
     *
     * <code>repeated .google.cloud.security.privateca.v1beta1.X509Extension custom_sans = 5;</code>
     */
    public java.util.List<
            ? extends com.google.cloud.security.privateca.v1beta1.X509ExtensionOrBuilder>
        getCustomSansOrBuilderList() {
      if (customSansBuilder_ != null) {
        return customSansBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(customSans_);
      }
    }
    /**
     *
     *
     * <pre>
     * Contains additional subject alternative name values.
     * </pre>
     *
     * <code>repeated .google.cloud.security.privateca.v1beta1.X509Extension custom_sans = 5;</code>
     */
    public com.google.cloud.security.privateca.v1beta1.X509Extension.Builder
        addCustomSansBuilder() {
      return getCustomSansFieldBuilder()
          .addBuilder(
              com.google.cloud.security.privateca.v1beta1.X509Extension.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * Contains additional subject alternative name values.
     * </pre>
     *
     * <code>repeated .google.cloud.security.privateca.v1beta1.X509Extension custom_sans = 5;</code>
     */
    public com.google.cloud.security.privateca.v1beta1.X509Extension.Builder addCustomSansBuilder(
        int index) {
      return getCustomSansFieldBuilder()
          .addBuilder(
              index,
              com.google.cloud.security.privateca.v1beta1.X509Extension.getDefaultInstance());
    }
    /**
     *
     *
     * <pre>
     * Contains additional subject alternative name values.
     * </pre>
     *
     * <code>repeated .google.cloud.security.privateca.v1beta1.X509Extension custom_sans = 5;</code>
     */
    public java.util.List<com.google.cloud.security.privateca.v1beta1.X509Extension.Builder>
        getCustomSansBuilderList() {
      return getCustomSansFieldBuilder().getBuilderList();
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.security.privateca.v1beta1.X509Extension,
            com.google.cloud.security.privateca.v1beta1.X509Extension.Builder,
            com.google.cloud.security.privateca.v1beta1.X509ExtensionOrBuilder>
        getCustomSansFieldBuilder() {
      if (customSansBuilder_ == null) {
        customSansBuilder_ =
            new com.google.protobuf.RepeatedFieldBuilderV3<
                com.google.cloud.security.privateca.v1beta1.X509Extension,
                com.google.cloud.security.privateca.v1beta1.X509Extension.Builder,
                com.google.cloud.security.privateca.v1beta1.X509ExtensionOrBuilder>(
                customSans_, ((bitField0_ & 0x00000010) != 0), getParentForChildren(), isClean());
        customSans_ = null;
      }
      return customSansBuilder_;
    }

    @java.lang.Override
    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

    @java.lang.Override
    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }

    // @@protoc_insertion_point(builder_scope:google.cloud.security.privateca.v1beta1.SubjectAltNames)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.security.privateca.v1beta1.SubjectAltNames)
  private static final com.google.cloud.security.privateca.v1beta1.SubjectAltNames DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.security.privateca.v1beta1.SubjectAltNames();
  }

  public static com.google.cloud.security.privateca.v1beta1.SubjectAltNames getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<SubjectAltNames> PARSER =
      new com.google.protobuf.AbstractParser<SubjectAltNames>() {
        @java.lang.Override
        public SubjectAltNames parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          Builder builder = newBuilder();
          try {
            builder.mergeFrom(input, extensionRegistry);
          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            throw e.setUnfinishedMessage(builder.buildPartial());
          } catch (com.google.protobuf.UninitializedMessageException e) {
            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
          } catch (java.io.IOException e) {
            throw new com.google.protobuf.InvalidProtocolBufferException(e)
                .setUnfinishedMessage(builder.buildPartial());
          }
          return builder.buildPartial();
        }
      };

  public static com.google.protobuf.Parser<SubjectAltNames> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<SubjectAltNames> getParserForType() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.cloud.security.privateca.v1beta1.SubjectAltNames getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
