/*
 * 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/bigtable/admin/v2/bigtable_table_admin.proto

package com.google.bigtable.admin.v2;

/**
 *
 *
 * <pre>
 * Metadata type for the long-running operation used to track the progress
 * of optimizations performed on a newly restored table. This long-running
 * operation is automatically created by the system after the successful
 * completion of a table restore, and cannot be cancelled.
 * </pre>
 *
 * Protobuf type {@code google.bigtable.admin.v2.OptimizeRestoredTableMetadata}
 */
public final class OptimizeRestoredTableMetadata extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.OptimizeRestoredTableMetadata)
    OptimizeRestoredTableMetadataOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use OptimizeRestoredTableMetadata.newBuilder() to construct.
  private OptimizeRestoredTableMetadata(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private OptimizeRestoredTableMetadata() {
    name_ = "";
  }

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

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

  private OptimizeRestoredTableMetadata(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    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();

              name_ = s;
              break;
            }
          case 18:
            {
              com.google.bigtable.admin.v2.OperationProgress.Builder subBuilder = null;
              if (progress_ != null) {
                subBuilder = progress_.toBuilder();
              }
              progress_ =
                  input.readMessage(
                      com.google.bigtable.admin.v2.OperationProgress.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(progress_);
                progress_ = subBuilder.buildPartial();
              }

              break;
            }
          default:
            {
              if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.bigtable.admin.v2.BigtableTableAdminProto
        .internal_static_google_bigtable_admin_v2_OptimizeRestoredTableMetadata_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.bigtable.admin.v2.BigtableTableAdminProto
        .internal_static_google_bigtable_admin_v2_OptimizeRestoredTableMetadata_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata.class,
            com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata.Builder.class);
  }

  public static final int NAME_FIELD_NUMBER = 1;
  private volatile java.lang.Object name_;
  /**
   *
   *
   * <pre>
   * Name of the restored table being optimized.
   * </pre>
   *
   * <code>string name = 1;</code>
   *
   * @return The name.
   */
  @java.lang.Override
  public java.lang.String getName() {
    java.lang.Object ref = name_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      name_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Name of the restored table being optimized.
   * </pre>
   *
   * <code>string name = 1;</code>
   *
   * @return The bytes for name.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getNameBytes() {
    java.lang.Object ref = name_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      name_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int PROGRESS_FIELD_NUMBER = 2;
  private com.google.bigtable.admin.v2.OperationProgress progress_;
  /**
   *
   *
   * <pre>
   * The progress of the post-restore optimizations.
   * </pre>
   *
   * <code>.google.bigtable.admin.v2.OperationProgress progress = 2;</code>
   *
   * @return Whether the progress field is set.
   */
  @java.lang.Override
  public boolean hasProgress() {
    return progress_ != null;
  }
  /**
   *
   *
   * <pre>
   * The progress of the post-restore optimizations.
   * </pre>
   *
   * <code>.google.bigtable.admin.v2.OperationProgress progress = 2;</code>
   *
   * @return The progress.
   */
  @java.lang.Override
  public com.google.bigtable.admin.v2.OperationProgress getProgress() {
    return progress_ == null
        ? com.google.bigtable.admin.v2.OperationProgress.getDefaultInstance()
        : progress_;
  }
  /**
   *
   *
   * <pre>
   * The progress of the post-restore optimizations.
   * </pre>
   *
   * <code>.google.bigtable.admin.v2.OperationProgress progress = 2;</code>
   */
  @java.lang.Override
  public com.google.bigtable.admin.v2.OperationProgressOrBuilder getProgressOrBuilder() {
    return getProgress();
  }

  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 {
    if (!getNameBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
    }
    if (progress_ != null) {
      output.writeMessage(2, getProgress());
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (!getNameBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
    }
    if (progress_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getProgress());
    }
    size += unknownFields.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.bigtable.admin.v2.OptimizeRestoredTableMetadata)) {
      return super.equals(obj);
    }
    com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata other =
        (com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata) obj;

    if (!getName().equals(other.getName())) return false;
    if (hasProgress() != other.hasProgress()) return false;
    if (hasProgress()) {
      if (!getProgress().equals(other.getProgress())) return false;
    }
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + NAME_FIELD_NUMBER;
    hash = (53 * hash) + getName().hashCode();
    if (hasProgress()) {
      hash = (37 * hash) + PROGRESS_FIELD_NUMBER;
      hash = (53 * hash) + getProgress().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata parseFrom(
      java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata 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.bigtable.admin.v2.OptimizeRestoredTableMetadata parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata parseFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata 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.bigtable.admin.v2.OptimizeRestoredTableMetadata parseDelimitedFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata 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.bigtable.admin.v2.OptimizeRestoredTableMetadata parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata 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.bigtable.admin.v2.OptimizeRestoredTableMetadata 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>
   * Metadata type for the long-running operation used to track the progress
   * of optimizations performed on a newly restored table. This long-running
   * operation is automatically created by the system after the successful
   * completion of a table restore, and cannot be cancelled.
   * </pre>
   *
   * Protobuf type {@code google.bigtable.admin.v2.OptimizeRestoredTableMetadata}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.OptimizeRestoredTableMetadata)
      com.google.bigtable.admin.v2.OptimizeRestoredTableMetadataOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.bigtable.admin.v2.BigtableTableAdminProto
          .internal_static_google_bigtable_admin_v2_OptimizeRestoredTableMetadata_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.bigtable.admin.v2.BigtableTableAdminProto
          .internal_static_google_bigtable_admin_v2_OptimizeRestoredTableMetadata_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata.class,
              com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata.Builder.class);
    }

    // Construct using com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

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

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      name_ = "";

      if (progressBuilder_ == null) {
        progress_ = null;
      } else {
        progress_ = null;
        progressBuilder_ = null;
      }
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.bigtable.admin.v2.BigtableTableAdminProto
          .internal_static_google_bigtable_admin_v2_OptimizeRestoredTableMetadata_descriptor;
    }

    @java.lang.Override
    public com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata getDefaultInstanceForType() {
      return com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata build() {
      com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata buildPartial() {
      com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata result =
          new com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata(this);
      result.name_ = name_;
      if (progressBuilder_ == null) {
        result.progress_ = progress_;
      } else {
        result.progress_ = progressBuilder_.build();
      }
      onBuilt();
      return result;
    }

    @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.bigtable.admin.v2.OptimizeRestoredTableMetadata) {
        return mergeFrom((com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata other) {
      if (other == com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata.getDefaultInstance())
        return this;
      if (!other.getName().isEmpty()) {
        name_ = other.name_;
        onChanged();
      }
      if (other.hasProgress()) {
        mergeProgress(other.getProgress());
      }
      this.mergeUnknownFields(other.unknownFields);
      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 {
      com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage =
            (com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private java.lang.Object name_ = "";
    /**
     *
     *
     * <pre>
     * Name of the restored table being optimized.
     * </pre>
     *
     * <code>string name = 1;</code>
     *
     * @return The name.
     */
    public java.lang.String getName() {
      java.lang.Object ref = name_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        name_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Name of the restored table being optimized.
     * </pre>
     *
     * <code>string name = 1;</code>
     *
     * @return The bytes for name.
     */
    public com.google.protobuf.ByteString getNameBytes() {
      java.lang.Object ref = name_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        name_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Name of the restored table being optimized.
     * </pre>
     *
     * <code>string name = 1;</code>
     *
     * @param value The name to set.
     * @return This builder for chaining.
     */
    public Builder setName(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      name_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Name of the restored table being optimized.
     * </pre>
     *
     * <code>string name = 1;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearName() {

      name_ = getDefaultInstance().getName();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Name of the restored table being optimized.
     * </pre>
     *
     * <code>string name = 1;</code>
     *
     * @param value The bytes for name to set.
     * @return This builder for chaining.
     */
    public Builder setNameBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

      name_ = value;
      onChanged();
      return this;
    }

    private com.google.bigtable.admin.v2.OperationProgress progress_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.bigtable.admin.v2.OperationProgress,
            com.google.bigtable.admin.v2.OperationProgress.Builder,
            com.google.bigtable.admin.v2.OperationProgressOrBuilder>
        progressBuilder_;
    /**
     *
     *
     * <pre>
     * The progress of the post-restore optimizations.
     * </pre>
     *
     * <code>.google.bigtable.admin.v2.OperationProgress progress = 2;</code>
     *
     * @return Whether the progress field is set.
     */
    public boolean hasProgress() {
      return progressBuilder_ != null || progress_ != null;
    }
    /**
     *
     *
     * <pre>
     * The progress of the post-restore optimizations.
     * </pre>
     *
     * <code>.google.bigtable.admin.v2.OperationProgress progress = 2;</code>
     *
     * @return The progress.
     */
    public com.google.bigtable.admin.v2.OperationProgress getProgress() {
      if (progressBuilder_ == null) {
        return progress_ == null
            ? com.google.bigtable.admin.v2.OperationProgress.getDefaultInstance()
            : progress_;
      } else {
        return progressBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * The progress of the post-restore optimizations.
     * </pre>
     *
     * <code>.google.bigtable.admin.v2.OperationProgress progress = 2;</code>
     */
    public Builder setProgress(com.google.bigtable.admin.v2.OperationProgress value) {
      if (progressBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        progress_ = value;
        onChanged();
      } else {
        progressBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The progress of the post-restore optimizations.
     * </pre>
     *
     * <code>.google.bigtable.admin.v2.OperationProgress progress = 2;</code>
     */
    public Builder setProgress(
        com.google.bigtable.admin.v2.OperationProgress.Builder builderForValue) {
      if (progressBuilder_ == null) {
        progress_ = builderForValue.build();
        onChanged();
      } else {
        progressBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The progress of the post-restore optimizations.
     * </pre>
     *
     * <code>.google.bigtable.admin.v2.OperationProgress progress = 2;</code>
     */
    public Builder mergeProgress(com.google.bigtable.admin.v2.OperationProgress value) {
      if (progressBuilder_ == null) {
        if (progress_ != null) {
          progress_ =
              com.google.bigtable.admin.v2.OperationProgress.newBuilder(progress_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          progress_ = value;
        }
        onChanged();
      } else {
        progressBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The progress of the post-restore optimizations.
     * </pre>
     *
     * <code>.google.bigtable.admin.v2.OperationProgress progress = 2;</code>
     */
    public Builder clearProgress() {
      if (progressBuilder_ == null) {
        progress_ = null;
        onChanged();
      } else {
        progress_ = null;
        progressBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * The progress of the post-restore optimizations.
     * </pre>
     *
     * <code>.google.bigtable.admin.v2.OperationProgress progress = 2;</code>
     */
    public com.google.bigtable.admin.v2.OperationProgress.Builder getProgressBuilder() {

      onChanged();
      return getProgressFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The progress of the post-restore optimizations.
     * </pre>
     *
     * <code>.google.bigtable.admin.v2.OperationProgress progress = 2;</code>
     */
    public com.google.bigtable.admin.v2.OperationProgressOrBuilder getProgressOrBuilder() {
      if (progressBuilder_ != null) {
        return progressBuilder_.getMessageOrBuilder();
      } else {
        return progress_ == null
            ? com.google.bigtable.admin.v2.OperationProgress.getDefaultInstance()
            : progress_;
      }
    }
    /**
     *
     *
     * <pre>
     * The progress of the post-restore optimizations.
     * </pre>
     *
     * <code>.google.bigtable.admin.v2.OperationProgress progress = 2;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.bigtable.admin.v2.OperationProgress,
            com.google.bigtable.admin.v2.OperationProgress.Builder,
            com.google.bigtable.admin.v2.OperationProgressOrBuilder>
        getProgressFieldBuilder() {
      if (progressBuilder_ == null) {
        progressBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.bigtable.admin.v2.OperationProgress,
                com.google.bigtable.admin.v2.OperationProgress.Builder,
                com.google.bigtable.admin.v2.OperationProgressOrBuilder>(
                getProgress(), getParentForChildren(), isClean());
        progress_ = null;
      }
      return progressBuilder_;
    }

    @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.bigtable.admin.v2.OptimizeRestoredTableMetadata)
  }

  // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.OptimizeRestoredTableMetadata)
  private static final com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata();
  }

  public static com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<OptimizeRestoredTableMetadata> PARSER =
      new com.google.protobuf.AbstractParser<OptimizeRestoredTableMetadata>() {
        @java.lang.Override
        public OptimizeRestoredTableMetadata parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new OptimizeRestoredTableMetadata(input, extensionRegistry);
        }
      };

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

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

  @java.lang.Override
  public com.google.bigtable.admin.v2.OptimizeRestoredTableMetadata getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
