/*
 * Copyright 2019 The Grafeas Authors. All rights reserved.
 *
 * 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: grafeas/v1/intoto_provenance.proto

package io.grafeas.v1;

/** Protobuf type {@code grafeas.v1.InTotoProvenance} */
public final class InTotoProvenance extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:grafeas.v1.InTotoProvenance)
    InTotoProvenanceOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use InTotoProvenance.newBuilder() to construct.
  private InTotoProvenance(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private InTotoProvenance() {
    materials_ = com.google.protobuf.LazyStringArrayList.emptyList();
  }

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

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return io.grafeas.v1.InTotoProvenanceProto
        .internal_static_grafeas_v1_InTotoProvenance_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return io.grafeas.v1.InTotoProvenanceProto
        .internal_static_grafeas_v1_InTotoProvenance_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            io.grafeas.v1.InTotoProvenance.class, io.grafeas.v1.InTotoProvenance.Builder.class);
  }

  public static final int BUILDER_CONFIG_FIELD_NUMBER = 1;
  private io.grafeas.v1.BuilderConfig builderConfig_;
  /**
   *
   *
   * <pre>
   * required
   * </pre>
   *
   * <code>.grafeas.v1.BuilderConfig builder_config = 1;</code>
   *
   * @return Whether the builderConfig field is set.
   */
  @java.lang.Override
  public boolean hasBuilderConfig() {
    return builderConfig_ != null;
  }
  /**
   *
   *
   * <pre>
   * required
   * </pre>
   *
   * <code>.grafeas.v1.BuilderConfig builder_config = 1;</code>
   *
   * @return The builderConfig.
   */
  @java.lang.Override
  public io.grafeas.v1.BuilderConfig getBuilderConfig() {
    return builderConfig_ == null
        ? io.grafeas.v1.BuilderConfig.getDefaultInstance()
        : builderConfig_;
  }
  /**
   *
   *
   * <pre>
   * required
   * </pre>
   *
   * <code>.grafeas.v1.BuilderConfig builder_config = 1;</code>
   */
  @java.lang.Override
  public io.grafeas.v1.BuilderConfigOrBuilder getBuilderConfigOrBuilder() {
    return builderConfig_ == null
        ? io.grafeas.v1.BuilderConfig.getDefaultInstance()
        : builderConfig_;
  }

  public static final int RECIPE_FIELD_NUMBER = 2;
  private io.grafeas.v1.Recipe recipe_;
  /**
   *
   *
   * <pre>
   * Identifies the configuration used for the build.
   * When combined with materials, this SHOULD fully describe the build,
   * such that re-running this recipe results in bit-for-bit identical output
   * (if the build is reproducible).
   * </pre>
   *
   * <code>.grafeas.v1.Recipe recipe = 2;</code>
   *
   * @return Whether the recipe field is set.
   */
  @java.lang.Override
  public boolean hasRecipe() {
    return recipe_ != null;
  }
  /**
   *
   *
   * <pre>
   * Identifies the configuration used for the build.
   * When combined with materials, this SHOULD fully describe the build,
   * such that re-running this recipe results in bit-for-bit identical output
   * (if the build is reproducible).
   * </pre>
   *
   * <code>.grafeas.v1.Recipe recipe = 2;</code>
   *
   * @return The recipe.
   */
  @java.lang.Override
  public io.grafeas.v1.Recipe getRecipe() {
    return recipe_ == null ? io.grafeas.v1.Recipe.getDefaultInstance() : recipe_;
  }
  /**
   *
   *
   * <pre>
   * Identifies the configuration used for the build.
   * When combined with materials, this SHOULD fully describe the build,
   * such that re-running this recipe results in bit-for-bit identical output
   * (if the build is reproducible).
   * </pre>
   *
   * <code>.grafeas.v1.Recipe recipe = 2;</code>
   */
  @java.lang.Override
  public io.grafeas.v1.RecipeOrBuilder getRecipeOrBuilder() {
    return recipe_ == null ? io.grafeas.v1.Recipe.getDefaultInstance() : recipe_;
  }

  public static final int METADATA_FIELD_NUMBER = 3;
  private io.grafeas.v1.Metadata metadata_;
  /**
   * <code>.grafeas.v1.Metadata metadata = 3;</code>
   *
   * @return Whether the metadata field is set.
   */
  @java.lang.Override
  public boolean hasMetadata() {
    return metadata_ != null;
  }
  /**
   * <code>.grafeas.v1.Metadata metadata = 3;</code>
   *
   * @return The metadata.
   */
  @java.lang.Override
  public io.grafeas.v1.Metadata getMetadata() {
    return metadata_ == null ? io.grafeas.v1.Metadata.getDefaultInstance() : metadata_;
  }
  /** <code>.grafeas.v1.Metadata metadata = 3;</code> */
  @java.lang.Override
  public io.grafeas.v1.MetadataOrBuilder getMetadataOrBuilder() {
    return metadata_ == null ? io.grafeas.v1.Metadata.getDefaultInstance() : metadata_;
  }

  public static final int MATERIALS_FIELD_NUMBER = 4;

  @SuppressWarnings("serial")
  private com.google.protobuf.LazyStringArrayList materials_ =
      com.google.protobuf.LazyStringArrayList.emptyList();
  /**
   *
   *
   * <pre>
   * The collection of artifacts that influenced the build including sources,
   * dependencies, build tools, base images, and so on. This is considered to be
   * incomplete unless metadata.completeness.materials is true. Unset or null is
   * equivalent to empty.
   * </pre>
   *
   * <code>repeated string materials = 4;</code>
   *
   * @return A list containing the materials.
   */
  public com.google.protobuf.ProtocolStringList getMaterialsList() {
    return materials_;
  }
  /**
   *
   *
   * <pre>
   * The collection of artifacts that influenced the build including sources,
   * dependencies, build tools, base images, and so on. This is considered to be
   * incomplete unless metadata.completeness.materials is true. Unset or null is
   * equivalent to empty.
   * </pre>
   *
   * <code>repeated string materials = 4;</code>
   *
   * @return The count of materials.
   */
  public int getMaterialsCount() {
    return materials_.size();
  }
  /**
   *
   *
   * <pre>
   * The collection of artifacts that influenced the build including sources,
   * dependencies, build tools, base images, and so on. This is considered to be
   * incomplete unless metadata.completeness.materials is true. Unset or null is
   * equivalent to empty.
   * </pre>
   *
   * <code>repeated string materials = 4;</code>
   *
   * @param index The index of the element to return.
   * @return The materials at the given index.
   */
  public java.lang.String getMaterials(int index) {
    return materials_.get(index);
  }
  /**
   *
   *
   * <pre>
   * The collection of artifacts that influenced the build including sources,
   * dependencies, build tools, base images, and so on. This is considered to be
   * incomplete unless metadata.completeness.materials is true. Unset or null is
   * equivalent to empty.
   * </pre>
   *
   * <code>repeated string materials = 4;</code>
   *
   * @param index The index of the value to return.
   * @return The bytes of the materials at the given index.
   */
  public com.google.protobuf.ByteString getMaterialsBytes(int index) {
    return materials_.getByteString(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 {
    if (builderConfig_ != null) {
      output.writeMessage(1, getBuilderConfig());
    }
    if (recipe_ != null) {
      output.writeMessage(2, getRecipe());
    }
    if (metadata_ != null) {
      output.writeMessage(3, getMetadata());
    }
    for (int i = 0; i < materials_.size(); i++) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 4, materials_.getRaw(i));
    }
    getUnknownFields().writeTo(output);
  }

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

    size = 0;
    if (builderConfig_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getBuilderConfig());
    }
    if (recipe_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRecipe());
    }
    if (metadata_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getMetadata());
    }
    {
      int dataSize = 0;
      for (int i = 0; i < materials_.size(); i++) {
        dataSize += computeStringSizeNoTag(materials_.getRaw(i));
      }
      size += dataSize;
      size += 1 * getMaterialsList().size();
    }
    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 io.grafeas.v1.InTotoProvenance)) {
      return super.equals(obj);
    }
    io.grafeas.v1.InTotoProvenance other = (io.grafeas.v1.InTotoProvenance) obj;

    if (hasBuilderConfig() != other.hasBuilderConfig()) return false;
    if (hasBuilderConfig()) {
      if (!getBuilderConfig().equals(other.getBuilderConfig())) return false;
    }
    if (hasRecipe() != other.hasRecipe()) return false;
    if (hasRecipe()) {
      if (!getRecipe().equals(other.getRecipe())) return false;
    }
    if (hasMetadata() != other.hasMetadata()) return false;
    if (hasMetadata()) {
      if (!getMetadata().equals(other.getMetadata())) return false;
    }
    if (!getMaterialsList().equals(other.getMaterialsList())) 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 (hasBuilderConfig()) {
      hash = (37 * hash) + BUILDER_CONFIG_FIELD_NUMBER;
      hash = (53 * hash) + getBuilderConfig().hashCode();
    }
    if (hasRecipe()) {
      hash = (37 * hash) + RECIPE_FIELD_NUMBER;
      hash = (53 * hash) + getRecipe().hashCode();
    }
    if (hasMetadata()) {
      hash = (37 * hash) + METADATA_FIELD_NUMBER;
      hash = (53 * hash) + getMetadata().hashCode();
    }
    if (getMaterialsCount() > 0) {
      hash = (37 * hash) + MATERIALS_FIELD_NUMBER;
      hash = (53 * hash) + getMaterialsList().hashCode();
    }
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static io.grafeas.v1.InTotoProvenance parseFrom(java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static io.grafeas.v1.InTotoProvenance parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static io.grafeas.v1.InTotoProvenance parseFrom(com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static io.grafeas.v1.InTotoProvenance parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static io.grafeas.v1.InTotoProvenance parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static io.grafeas.v1.InTotoProvenance parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static io.grafeas.v1.InTotoProvenance parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

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

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

  public static io.grafeas.v1.InTotoProvenance 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(io.grafeas.v1.InTotoProvenance 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;
  }
  /** Protobuf type {@code grafeas.v1.InTotoProvenance} */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:grafeas.v1.InTotoProvenance)
      io.grafeas.v1.InTotoProvenanceOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return io.grafeas.v1.InTotoProvenanceProto
          .internal_static_grafeas_v1_InTotoProvenance_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return io.grafeas.v1.InTotoProvenanceProto
          .internal_static_grafeas_v1_InTotoProvenance_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              io.grafeas.v1.InTotoProvenance.class, io.grafeas.v1.InTotoProvenance.Builder.class);
    }

    // Construct using io.grafeas.v1.InTotoProvenance.newBuilder()
    private Builder() {}

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

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      builderConfig_ = null;
      if (builderConfigBuilder_ != null) {
        builderConfigBuilder_.dispose();
        builderConfigBuilder_ = null;
      }
      recipe_ = null;
      if (recipeBuilder_ != null) {
        recipeBuilder_.dispose();
        recipeBuilder_ = null;
      }
      metadata_ = null;
      if (metadataBuilder_ != null) {
        metadataBuilder_.dispose();
        metadataBuilder_ = null;
      }
      materials_ = com.google.protobuf.LazyStringArrayList.emptyList();
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return io.grafeas.v1.InTotoProvenanceProto
          .internal_static_grafeas_v1_InTotoProvenance_descriptor;
    }

    @java.lang.Override
    public io.grafeas.v1.InTotoProvenance getDefaultInstanceForType() {
      return io.grafeas.v1.InTotoProvenance.getDefaultInstance();
    }

    @java.lang.Override
    public io.grafeas.v1.InTotoProvenance build() {
      io.grafeas.v1.InTotoProvenance result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public io.grafeas.v1.InTotoProvenance buildPartial() {
      io.grafeas.v1.InTotoProvenance result = new io.grafeas.v1.InTotoProvenance(this);
      if (bitField0_ != 0) {
        buildPartial0(result);
      }
      onBuilt();
      return result;
    }

    private void buildPartial0(io.grafeas.v1.InTotoProvenance result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.builderConfig_ =
            builderConfigBuilder_ == null ? builderConfig_ : builderConfigBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000002) != 0)) {
        result.recipe_ = recipeBuilder_ == null ? recipe_ : recipeBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000004) != 0)) {
        result.metadata_ = metadataBuilder_ == null ? metadata_ : metadataBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000008) != 0)) {
        materials_.makeImmutable();
        result.materials_ = materials_;
      }
    }

    @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 io.grafeas.v1.InTotoProvenance) {
        return mergeFrom((io.grafeas.v1.InTotoProvenance) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(io.grafeas.v1.InTotoProvenance other) {
      if (other == io.grafeas.v1.InTotoProvenance.getDefaultInstance()) return this;
      if (other.hasBuilderConfig()) {
        mergeBuilderConfig(other.getBuilderConfig());
      }
      if (other.hasRecipe()) {
        mergeRecipe(other.getRecipe());
      }
      if (other.hasMetadata()) {
        mergeMetadata(other.getMetadata());
      }
      if (!other.materials_.isEmpty()) {
        if (materials_.isEmpty()) {
          materials_ = other.materials_;
          bitField0_ |= 0x00000008;
        } else {
          ensureMaterialsIsMutable();
          materials_.addAll(other.materials_);
        }
        onChanged();
      }
      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:
              {
                input.readMessage(getBuilderConfigFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000001;
                break;
              } // case 10
            case 18:
              {
                input.readMessage(getRecipeFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000002;
                break;
              } // case 18
            case 26:
              {
                input.readMessage(getMetadataFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000004;
                break;
              } // case 26
            case 34:
              {
                java.lang.String s = input.readStringRequireUtf8();
                ensureMaterialsIsMutable();
                materials_.add(s);
                break;
              } // case 34
            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 io.grafeas.v1.BuilderConfig builderConfig_;
    private com.google.protobuf.SingleFieldBuilderV3<
            io.grafeas.v1.BuilderConfig,
            io.grafeas.v1.BuilderConfig.Builder,
            io.grafeas.v1.BuilderConfigOrBuilder>
        builderConfigBuilder_;
    /**
     *
     *
     * <pre>
     * required
     * </pre>
     *
     * <code>.grafeas.v1.BuilderConfig builder_config = 1;</code>
     *
     * @return Whether the builderConfig field is set.
     */
    public boolean hasBuilderConfig() {
      return ((bitField0_ & 0x00000001) != 0);
    }
    /**
     *
     *
     * <pre>
     * required
     * </pre>
     *
     * <code>.grafeas.v1.BuilderConfig builder_config = 1;</code>
     *
     * @return The builderConfig.
     */
    public io.grafeas.v1.BuilderConfig getBuilderConfig() {
      if (builderConfigBuilder_ == null) {
        return builderConfig_ == null
            ? io.grafeas.v1.BuilderConfig.getDefaultInstance()
            : builderConfig_;
      } else {
        return builderConfigBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * required
     * </pre>
     *
     * <code>.grafeas.v1.BuilderConfig builder_config = 1;</code>
     */
    public Builder setBuilderConfig(io.grafeas.v1.BuilderConfig value) {
      if (builderConfigBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        builderConfig_ = value;
      } else {
        builderConfigBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * required
     * </pre>
     *
     * <code>.grafeas.v1.BuilderConfig builder_config = 1;</code>
     */
    public Builder setBuilderConfig(io.grafeas.v1.BuilderConfig.Builder builderForValue) {
      if (builderConfigBuilder_ == null) {
        builderConfig_ = builderForValue.build();
      } else {
        builderConfigBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * required
     * </pre>
     *
     * <code>.grafeas.v1.BuilderConfig builder_config = 1;</code>
     */
    public Builder mergeBuilderConfig(io.grafeas.v1.BuilderConfig value) {
      if (builderConfigBuilder_ == null) {
        if (((bitField0_ & 0x00000001) != 0)
            && builderConfig_ != null
            && builderConfig_ != io.grafeas.v1.BuilderConfig.getDefaultInstance()) {
          getBuilderConfigBuilder().mergeFrom(value);
        } else {
          builderConfig_ = value;
        }
      } else {
        builderConfigBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * required
     * </pre>
     *
     * <code>.grafeas.v1.BuilderConfig builder_config = 1;</code>
     */
    public Builder clearBuilderConfig() {
      bitField0_ = (bitField0_ & ~0x00000001);
      builderConfig_ = null;
      if (builderConfigBuilder_ != null) {
        builderConfigBuilder_.dispose();
        builderConfigBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * required
     * </pre>
     *
     * <code>.grafeas.v1.BuilderConfig builder_config = 1;</code>
     */
    public io.grafeas.v1.BuilderConfig.Builder getBuilderConfigBuilder() {
      bitField0_ |= 0x00000001;
      onChanged();
      return getBuilderConfigFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * required
     * </pre>
     *
     * <code>.grafeas.v1.BuilderConfig builder_config = 1;</code>
     */
    public io.grafeas.v1.BuilderConfigOrBuilder getBuilderConfigOrBuilder() {
      if (builderConfigBuilder_ != null) {
        return builderConfigBuilder_.getMessageOrBuilder();
      } else {
        return builderConfig_ == null
            ? io.grafeas.v1.BuilderConfig.getDefaultInstance()
            : builderConfig_;
      }
    }
    /**
     *
     *
     * <pre>
     * required
     * </pre>
     *
     * <code>.grafeas.v1.BuilderConfig builder_config = 1;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            io.grafeas.v1.BuilderConfig,
            io.grafeas.v1.BuilderConfig.Builder,
            io.grafeas.v1.BuilderConfigOrBuilder>
        getBuilderConfigFieldBuilder() {
      if (builderConfigBuilder_ == null) {
        builderConfigBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                io.grafeas.v1.BuilderConfig,
                io.grafeas.v1.BuilderConfig.Builder,
                io.grafeas.v1.BuilderConfigOrBuilder>(
                getBuilderConfig(), getParentForChildren(), isClean());
        builderConfig_ = null;
      }
      return builderConfigBuilder_;
    }

    private io.grafeas.v1.Recipe recipe_;
    private com.google.protobuf.SingleFieldBuilderV3<
            io.grafeas.v1.Recipe, io.grafeas.v1.Recipe.Builder, io.grafeas.v1.RecipeOrBuilder>
        recipeBuilder_;
    /**
     *
     *
     * <pre>
     * Identifies the configuration used for the build.
     * When combined with materials, this SHOULD fully describe the build,
     * such that re-running this recipe results in bit-for-bit identical output
     * (if the build is reproducible).
     * </pre>
     *
     * <code>.grafeas.v1.Recipe recipe = 2;</code>
     *
     * @return Whether the recipe field is set.
     */
    public boolean hasRecipe() {
      return ((bitField0_ & 0x00000002) != 0);
    }
    /**
     *
     *
     * <pre>
     * Identifies the configuration used for the build.
     * When combined with materials, this SHOULD fully describe the build,
     * such that re-running this recipe results in bit-for-bit identical output
     * (if the build is reproducible).
     * </pre>
     *
     * <code>.grafeas.v1.Recipe recipe = 2;</code>
     *
     * @return The recipe.
     */
    public io.grafeas.v1.Recipe getRecipe() {
      if (recipeBuilder_ == null) {
        return recipe_ == null ? io.grafeas.v1.Recipe.getDefaultInstance() : recipe_;
      } else {
        return recipeBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Identifies the configuration used for the build.
     * When combined with materials, this SHOULD fully describe the build,
     * such that re-running this recipe results in bit-for-bit identical output
     * (if the build is reproducible).
     * </pre>
     *
     * <code>.grafeas.v1.Recipe recipe = 2;</code>
     */
    public Builder setRecipe(io.grafeas.v1.Recipe value) {
      if (recipeBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        recipe_ = value;
      } else {
        recipeBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Identifies the configuration used for the build.
     * When combined with materials, this SHOULD fully describe the build,
     * such that re-running this recipe results in bit-for-bit identical output
     * (if the build is reproducible).
     * </pre>
     *
     * <code>.grafeas.v1.Recipe recipe = 2;</code>
     */
    public Builder setRecipe(io.grafeas.v1.Recipe.Builder builderForValue) {
      if (recipeBuilder_ == null) {
        recipe_ = builderForValue.build();
      } else {
        recipeBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Identifies the configuration used for the build.
     * When combined with materials, this SHOULD fully describe the build,
     * such that re-running this recipe results in bit-for-bit identical output
     * (if the build is reproducible).
     * </pre>
     *
     * <code>.grafeas.v1.Recipe recipe = 2;</code>
     */
    public Builder mergeRecipe(io.grafeas.v1.Recipe value) {
      if (recipeBuilder_ == null) {
        if (((bitField0_ & 0x00000002) != 0)
            && recipe_ != null
            && recipe_ != io.grafeas.v1.Recipe.getDefaultInstance()) {
          getRecipeBuilder().mergeFrom(value);
        } else {
          recipe_ = value;
        }
      } else {
        recipeBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Identifies the configuration used for the build.
     * When combined with materials, this SHOULD fully describe the build,
     * such that re-running this recipe results in bit-for-bit identical output
     * (if the build is reproducible).
     * </pre>
     *
     * <code>.grafeas.v1.Recipe recipe = 2;</code>
     */
    public Builder clearRecipe() {
      bitField0_ = (bitField0_ & ~0x00000002);
      recipe_ = null;
      if (recipeBuilder_ != null) {
        recipeBuilder_.dispose();
        recipeBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Identifies the configuration used for the build.
     * When combined with materials, this SHOULD fully describe the build,
     * such that re-running this recipe results in bit-for-bit identical output
     * (if the build is reproducible).
     * </pre>
     *
     * <code>.grafeas.v1.Recipe recipe = 2;</code>
     */
    public io.grafeas.v1.Recipe.Builder getRecipeBuilder() {
      bitField0_ |= 0x00000002;
      onChanged();
      return getRecipeFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Identifies the configuration used for the build.
     * When combined with materials, this SHOULD fully describe the build,
     * such that re-running this recipe results in bit-for-bit identical output
     * (if the build is reproducible).
     * </pre>
     *
     * <code>.grafeas.v1.Recipe recipe = 2;</code>
     */
    public io.grafeas.v1.RecipeOrBuilder getRecipeOrBuilder() {
      if (recipeBuilder_ != null) {
        return recipeBuilder_.getMessageOrBuilder();
      } else {
        return recipe_ == null ? io.grafeas.v1.Recipe.getDefaultInstance() : recipe_;
      }
    }
    /**
     *
     *
     * <pre>
     * Identifies the configuration used for the build.
     * When combined with materials, this SHOULD fully describe the build,
     * such that re-running this recipe results in bit-for-bit identical output
     * (if the build is reproducible).
     * </pre>
     *
     * <code>.grafeas.v1.Recipe recipe = 2;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            io.grafeas.v1.Recipe, io.grafeas.v1.Recipe.Builder, io.grafeas.v1.RecipeOrBuilder>
        getRecipeFieldBuilder() {
      if (recipeBuilder_ == null) {
        recipeBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                io.grafeas.v1.Recipe, io.grafeas.v1.Recipe.Builder, io.grafeas.v1.RecipeOrBuilder>(
                getRecipe(), getParentForChildren(), isClean());
        recipe_ = null;
      }
      return recipeBuilder_;
    }

    private io.grafeas.v1.Metadata metadata_;
    private com.google.protobuf.SingleFieldBuilderV3<
            io.grafeas.v1.Metadata, io.grafeas.v1.Metadata.Builder, io.grafeas.v1.MetadataOrBuilder>
        metadataBuilder_;
    /**
     * <code>.grafeas.v1.Metadata metadata = 3;</code>
     *
     * @return Whether the metadata field is set.
     */
    public boolean hasMetadata() {
      return ((bitField0_ & 0x00000004) != 0);
    }
    /**
     * <code>.grafeas.v1.Metadata metadata = 3;</code>
     *
     * @return The metadata.
     */
    public io.grafeas.v1.Metadata getMetadata() {
      if (metadataBuilder_ == null) {
        return metadata_ == null ? io.grafeas.v1.Metadata.getDefaultInstance() : metadata_;
      } else {
        return metadataBuilder_.getMessage();
      }
    }
    /** <code>.grafeas.v1.Metadata metadata = 3;</code> */
    public Builder setMetadata(io.grafeas.v1.Metadata value) {
      if (metadataBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        metadata_ = value;
      } else {
        metadataBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /** <code>.grafeas.v1.Metadata metadata = 3;</code> */
    public Builder setMetadata(io.grafeas.v1.Metadata.Builder builderForValue) {
      if (metadataBuilder_ == null) {
        metadata_ = builderForValue.build();
      } else {
        metadataBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /** <code>.grafeas.v1.Metadata metadata = 3;</code> */
    public Builder mergeMetadata(io.grafeas.v1.Metadata value) {
      if (metadataBuilder_ == null) {
        if (((bitField0_ & 0x00000004) != 0)
            && metadata_ != null
            && metadata_ != io.grafeas.v1.Metadata.getDefaultInstance()) {
          getMetadataBuilder().mergeFrom(value);
        } else {
          metadata_ = value;
        }
      } else {
        metadataBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /** <code>.grafeas.v1.Metadata metadata = 3;</code> */
    public Builder clearMetadata() {
      bitField0_ = (bitField0_ & ~0x00000004);
      metadata_ = null;
      if (metadataBuilder_ != null) {
        metadataBuilder_.dispose();
        metadataBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /** <code>.grafeas.v1.Metadata metadata = 3;</code> */
    public io.grafeas.v1.Metadata.Builder getMetadataBuilder() {
      bitField0_ |= 0x00000004;
      onChanged();
      return getMetadataFieldBuilder().getBuilder();
    }
    /** <code>.grafeas.v1.Metadata metadata = 3;</code> */
    public io.grafeas.v1.MetadataOrBuilder getMetadataOrBuilder() {
      if (metadataBuilder_ != null) {
        return metadataBuilder_.getMessageOrBuilder();
      } else {
        return metadata_ == null ? io.grafeas.v1.Metadata.getDefaultInstance() : metadata_;
      }
    }
    /** <code>.grafeas.v1.Metadata metadata = 3;</code> */
    private com.google.protobuf.SingleFieldBuilderV3<
            io.grafeas.v1.Metadata, io.grafeas.v1.Metadata.Builder, io.grafeas.v1.MetadataOrBuilder>
        getMetadataFieldBuilder() {
      if (metadataBuilder_ == null) {
        metadataBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                io.grafeas.v1.Metadata,
                io.grafeas.v1.Metadata.Builder,
                io.grafeas.v1.MetadataOrBuilder>(getMetadata(), getParentForChildren(), isClean());
        metadata_ = null;
      }
      return metadataBuilder_;
    }

    private com.google.protobuf.LazyStringArrayList materials_ =
        com.google.protobuf.LazyStringArrayList.emptyList();

    private void ensureMaterialsIsMutable() {
      if (!materials_.isModifiable()) {
        materials_ = new com.google.protobuf.LazyStringArrayList(materials_);
      }
      bitField0_ |= 0x00000008;
    }
    /**
     *
     *
     * <pre>
     * The collection of artifacts that influenced the build including sources,
     * dependencies, build tools, base images, and so on. This is considered to be
     * incomplete unless metadata.completeness.materials is true. Unset or null is
     * equivalent to empty.
     * </pre>
     *
     * <code>repeated string materials = 4;</code>
     *
     * @return A list containing the materials.
     */
    public com.google.protobuf.ProtocolStringList getMaterialsList() {
      materials_.makeImmutable();
      return materials_;
    }
    /**
     *
     *
     * <pre>
     * The collection of artifacts that influenced the build including sources,
     * dependencies, build tools, base images, and so on. This is considered to be
     * incomplete unless metadata.completeness.materials is true. Unset or null is
     * equivalent to empty.
     * </pre>
     *
     * <code>repeated string materials = 4;</code>
     *
     * @return The count of materials.
     */
    public int getMaterialsCount() {
      return materials_.size();
    }
    /**
     *
     *
     * <pre>
     * The collection of artifacts that influenced the build including sources,
     * dependencies, build tools, base images, and so on. This is considered to be
     * incomplete unless metadata.completeness.materials is true. Unset or null is
     * equivalent to empty.
     * </pre>
     *
     * <code>repeated string materials = 4;</code>
     *
     * @param index The index of the element to return.
     * @return The materials at the given index.
     */
    public java.lang.String getMaterials(int index) {
      return materials_.get(index);
    }
    /**
     *
     *
     * <pre>
     * The collection of artifacts that influenced the build including sources,
     * dependencies, build tools, base images, and so on. This is considered to be
     * incomplete unless metadata.completeness.materials is true. Unset or null is
     * equivalent to empty.
     * </pre>
     *
     * <code>repeated string materials = 4;</code>
     *
     * @param index The index of the value to return.
     * @return The bytes of the materials at the given index.
     */
    public com.google.protobuf.ByteString getMaterialsBytes(int index) {
      return materials_.getByteString(index);
    }
    /**
     *
     *
     * <pre>
     * The collection of artifacts that influenced the build including sources,
     * dependencies, build tools, base images, and so on. This is considered to be
     * incomplete unless metadata.completeness.materials is true. Unset or null is
     * equivalent to empty.
     * </pre>
     *
     * <code>repeated string materials = 4;</code>
     *
     * @param index The index to set the value at.
     * @param value The materials to set.
     * @return This builder for chaining.
     */
    public Builder setMaterials(int index, java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureMaterialsIsMutable();
      materials_.set(index, value);
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The collection of artifacts that influenced the build including sources,
     * dependencies, build tools, base images, and so on. This is considered to be
     * incomplete unless metadata.completeness.materials is true. Unset or null is
     * equivalent to empty.
     * </pre>
     *
     * <code>repeated string materials = 4;</code>
     *
     * @param value The materials to add.
     * @return This builder for chaining.
     */
    public Builder addMaterials(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      ensureMaterialsIsMutable();
      materials_.add(value);
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The collection of artifacts that influenced the build including sources,
     * dependencies, build tools, base images, and so on. This is considered to be
     * incomplete unless metadata.completeness.materials is true. Unset or null is
     * equivalent to empty.
     * </pre>
     *
     * <code>repeated string materials = 4;</code>
     *
     * @param values The materials to add.
     * @return This builder for chaining.
     */
    public Builder addAllMaterials(java.lang.Iterable<java.lang.String> values) {
      ensureMaterialsIsMutable();
      com.google.protobuf.AbstractMessageLite.Builder.addAll(values, materials_);
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The collection of artifacts that influenced the build including sources,
     * dependencies, build tools, base images, and so on. This is considered to be
     * incomplete unless metadata.completeness.materials is true. Unset or null is
     * equivalent to empty.
     * </pre>
     *
     * <code>repeated string materials = 4;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearMaterials() {
      materials_ = com.google.protobuf.LazyStringArrayList.emptyList();
      bitField0_ = (bitField0_ & ~0x00000008);
      ;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The collection of artifacts that influenced the build including sources,
     * dependencies, build tools, base images, and so on. This is considered to be
     * incomplete unless metadata.completeness.materials is true. Unset or null is
     * equivalent to empty.
     * </pre>
     *
     * <code>repeated string materials = 4;</code>
     *
     * @param value The bytes of the materials to add.
     * @return This builder for chaining.
     */
    public Builder addMaterialsBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      ensureMaterialsIsMutable();
      materials_.add(value);
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }

    @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:grafeas.v1.InTotoProvenance)
  }

  // @@protoc_insertion_point(class_scope:grafeas.v1.InTotoProvenance)
  private static final io.grafeas.v1.InTotoProvenance DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new io.grafeas.v1.InTotoProvenance();
  }

  public static io.grafeas.v1.InTotoProvenance getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<InTotoProvenance> PARSER =
      new com.google.protobuf.AbstractParser<InTotoProvenance>() {
        @java.lang.Override
        public InTotoProvenance 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<InTotoProvenance> parser() {
    return PARSER;
  }

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

  @java.lang.Override
  public io.grafeas.v1.InTotoProvenance getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
