/*
 * 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;

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

  private Metadata() {
    buildInvocationId_ = "";
  }

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

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

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

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

  public static final int BUILD_INVOCATION_ID_FIELD_NUMBER = 1;

  @SuppressWarnings("serial")
  private volatile java.lang.Object buildInvocationId_ = "";
  /**
   *
   *
   * <pre>
   * Identifies the particular build invocation, which can be useful for finding
   * associated logs or other ad-hoc analysis. The value SHOULD be globally
   * unique, per in-toto Provenance spec.
   * </pre>
   *
   * <code>string build_invocation_id = 1;</code>
   *
   * @return The buildInvocationId.
   */
  @java.lang.Override
  public java.lang.String getBuildInvocationId() {
    java.lang.Object ref = buildInvocationId_;
    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();
      buildInvocationId_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Identifies the particular build invocation, which can be useful for finding
   * associated logs or other ad-hoc analysis. The value SHOULD be globally
   * unique, per in-toto Provenance spec.
   * </pre>
   *
   * <code>string build_invocation_id = 1;</code>
   *
   * @return The bytes for buildInvocationId.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getBuildInvocationIdBytes() {
    java.lang.Object ref = buildInvocationId_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      buildInvocationId_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int BUILD_STARTED_ON_FIELD_NUMBER = 2;
  private com.google.protobuf.Timestamp buildStartedOn_;
  /**
   *
   *
   * <pre>
   * The timestamp of when the build started.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp build_started_on = 2;</code>
   *
   * @return Whether the buildStartedOn field is set.
   */
  @java.lang.Override
  public boolean hasBuildStartedOn() {
    return buildStartedOn_ != null;
  }
  /**
   *
   *
   * <pre>
   * The timestamp of when the build started.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp build_started_on = 2;</code>
   *
   * @return The buildStartedOn.
   */
  @java.lang.Override
  public com.google.protobuf.Timestamp getBuildStartedOn() {
    return buildStartedOn_ == null
        ? com.google.protobuf.Timestamp.getDefaultInstance()
        : buildStartedOn_;
  }
  /**
   *
   *
   * <pre>
   * The timestamp of when the build started.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp build_started_on = 2;</code>
   */
  @java.lang.Override
  public com.google.protobuf.TimestampOrBuilder getBuildStartedOnOrBuilder() {
    return buildStartedOn_ == null
        ? com.google.protobuf.Timestamp.getDefaultInstance()
        : buildStartedOn_;
  }

  public static final int BUILD_FINISHED_ON_FIELD_NUMBER = 3;
  private com.google.protobuf.Timestamp buildFinishedOn_;
  /**
   *
   *
   * <pre>
   * The timestamp of when the build completed.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp build_finished_on = 3;</code>
   *
   * @return Whether the buildFinishedOn field is set.
   */
  @java.lang.Override
  public boolean hasBuildFinishedOn() {
    return buildFinishedOn_ != null;
  }
  /**
   *
   *
   * <pre>
   * The timestamp of when the build completed.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp build_finished_on = 3;</code>
   *
   * @return The buildFinishedOn.
   */
  @java.lang.Override
  public com.google.protobuf.Timestamp getBuildFinishedOn() {
    return buildFinishedOn_ == null
        ? com.google.protobuf.Timestamp.getDefaultInstance()
        : buildFinishedOn_;
  }
  /**
   *
   *
   * <pre>
   * The timestamp of when the build completed.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp build_finished_on = 3;</code>
   */
  @java.lang.Override
  public com.google.protobuf.TimestampOrBuilder getBuildFinishedOnOrBuilder() {
    return buildFinishedOn_ == null
        ? com.google.protobuf.Timestamp.getDefaultInstance()
        : buildFinishedOn_;
  }

  public static final int COMPLETENESS_FIELD_NUMBER = 4;
  private io.grafeas.v1.Completeness completeness_;
  /**
   *
   *
   * <pre>
   * Indicates that the builder claims certain fields in this message to be
   * complete.
   * </pre>
   *
   * <code>.grafeas.v1.Completeness completeness = 4;</code>
   *
   * @return Whether the completeness field is set.
   */
  @java.lang.Override
  public boolean hasCompleteness() {
    return completeness_ != null;
  }
  /**
   *
   *
   * <pre>
   * Indicates that the builder claims certain fields in this message to be
   * complete.
   * </pre>
   *
   * <code>.grafeas.v1.Completeness completeness = 4;</code>
   *
   * @return The completeness.
   */
  @java.lang.Override
  public io.grafeas.v1.Completeness getCompleteness() {
    return completeness_ == null ? io.grafeas.v1.Completeness.getDefaultInstance() : completeness_;
  }
  /**
   *
   *
   * <pre>
   * Indicates that the builder claims certain fields in this message to be
   * complete.
   * </pre>
   *
   * <code>.grafeas.v1.Completeness completeness = 4;</code>
   */
  @java.lang.Override
  public io.grafeas.v1.CompletenessOrBuilder getCompletenessOrBuilder() {
    return completeness_ == null ? io.grafeas.v1.Completeness.getDefaultInstance() : completeness_;
  }

  public static final int REPRODUCIBLE_FIELD_NUMBER = 5;
  private boolean reproducible_ = false;
  /**
   *
   *
   * <pre>
   * If true, the builder claims that running the recipe on materials will
   * produce bit-for-bit identical output.
   * </pre>
   *
   * <code>bool reproducible = 5;</code>
   *
   * @return The reproducible.
   */
  @java.lang.Override
  public boolean getReproducible() {
    return reproducible_;
  }

  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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(buildInvocationId_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, buildInvocationId_);
    }
    if (buildStartedOn_ != null) {
      output.writeMessage(2, getBuildStartedOn());
    }
    if (buildFinishedOn_ != null) {
      output.writeMessage(3, getBuildFinishedOn());
    }
    if (completeness_ != null) {
      output.writeMessage(4, getCompleteness());
    }
    if (reproducible_ != false) {
      output.writeBool(5, reproducible_);
    }
    getUnknownFields().writeTo(output);
  }

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

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(buildInvocationId_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, buildInvocationId_);
    }
    if (buildStartedOn_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getBuildStartedOn());
    }
    if (buildFinishedOn_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getBuildFinishedOn());
    }
    if (completeness_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCompleteness());
    }
    if (reproducible_ != false) {
      size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, reproducible_);
    }
    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.Metadata)) {
      return super.equals(obj);
    }
    io.grafeas.v1.Metadata other = (io.grafeas.v1.Metadata) obj;

    if (!getBuildInvocationId().equals(other.getBuildInvocationId())) return false;
    if (hasBuildStartedOn() != other.hasBuildStartedOn()) return false;
    if (hasBuildStartedOn()) {
      if (!getBuildStartedOn().equals(other.getBuildStartedOn())) return false;
    }
    if (hasBuildFinishedOn() != other.hasBuildFinishedOn()) return false;
    if (hasBuildFinishedOn()) {
      if (!getBuildFinishedOn().equals(other.getBuildFinishedOn())) return false;
    }
    if (hasCompleteness() != other.hasCompleteness()) return false;
    if (hasCompleteness()) {
      if (!getCompleteness().equals(other.getCompleteness())) return false;
    }
    if (getReproducible() != other.getReproducible()) 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();
    hash = (37 * hash) + BUILD_INVOCATION_ID_FIELD_NUMBER;
    hash = (53 * hash) + getBuildInvocationId().hashCode();
    if (hasBuildStartedOn()) {
      hash = (37 * hash) + BUILD_STARTED_ON_FIELD_NUMBER;
      hash = (53 * hash) + getBuildStartedOn().hashCode();
    }
    if (hasBuildFinishedOn()) {
      hash = (37 * hash) + BUILD_FINISHED_ON_FIELD_NUMBER;
      hash = (53 * hash) + getBuildFinishedOn().hashCode();
    }
    if (hasCompleteness()) {
      hash = (37 * hash) + COMPLETENESS_FIELD_NUMBER;
      hash = (53 * hash) + getCompleteness().hashCode();
    }
    hash = (37 * hash) + REPRODUCIBLE_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReproducible());
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

  public static io.grafeas.v1.Metadata 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.Metadata parseFrom(com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static io.grafeas.v1.Metadata 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.Metadata parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

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

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

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

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

  public static io.grafeas.v1.Metadata 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.Metadata 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>
   * Other properties of the build.
   * </pre>
   *
   * Protobuf type {@code grafeas.v1.Metadata}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:grafeas.v1.Metadata)
      io.grafeas.v1.MetadataOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return io.grafeas.v1.InTotoProvenanceProto.internal_static_grafeas_v1_Metadata_descriptor;
    }

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

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

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

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      buildInvocationId_ = "";
      buildStartedOn_ = null;
      if (buildStartedOnBuilder_ != null) {
        buildStartedOnBuilder_.dispose();
        buildStartedOnBuilder_ = null;
      }
      buildFinishedOn_ = null;
      if (buildFinishedOnBuilder_ != null) {
        buildFinishedOnBuilder_.dispose();
        buildFinishedOnBuilder_ = null;
      }
      completeness_ = null;
      if (completenessBuilder_ != null) {
        completenessBuilder_.dispose();
        completenessBuilder_ = null;
      }
      reproducible_ = false;
      return this;
    }

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

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

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

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

    private void buildPartial0(io.grafeas.v1.Metadata result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.buildInvocationId_ = buildInvocationId_;
      }
      if (((from_bitField0_ & 0x00000002) != 0)) {
        result.buildStartedOn_ =
            buildStartedOnBuilder_ == null ? buildStartedOn_ : buildStartedOnBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000004) != 0)) {
        result.buildFinishedOn_ =
            buildFinishedOnBuilder_ == null ? buildFinishedOn_ : buildFinishedOnBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000008) != 0)) {
        result.completeness_ =
            completenessBuilder_ == null ? completeness_ : completenessBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000010) != 0)) {
        result.reproducible_ = reproducible_;
      }
    }

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

    public Builder mergeFrom(io.grafeas.v1.Metadata other) {
      if (other == io.grafeas.v1.Metadata.getDefaultInstance()) return this;
      if (!other.getBuildInvocationId().isEmpty()) {
        buildInvocationId_ = other.buildInvocationId_;
        bitField0_ |= 0x00000001;
        onChanged();
      }
      if (other.hasBuildStartedOn()) {
        mergeBuildStartedOn(other.getBuildStartedOn());
      }
      if (other.hasBuildFinishedOn()) {
        mergeBuildFinishedOn(other.getBuildFinishedOn());
      }
      if (other.hasCompleteness()) {
        mergeCompleteness(other.getCompleteness());
      }
      if (other.getReproducible() != false) {
        setReproducible(other.getReproducible());
      }
      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:
              {
                buildInvocationId_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000001;
                break;
              } // case 10
            case 18:
              {
                input.readMessage(getBuildStartedOnFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000002;
                break;
              } // case 18
            case 26:
              {
                input.readMessage(getBuildFinishedOnFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000004;
                break;
              } // case 26
            case 34:
              {
                input.readMessage(getCompletenessFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000008;
                break;
              } // case 34
            case 40:
              {
                reproducible_ = input.readBool();
                bitField0_ |= 0x00000010;
                break;
              } // case 40
            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 java.lang.Object buildInvocationId_ = "";
    /**
     *
     *
     * <pre>
     * Identifies the particular build invocation, which can be useful for finding
     * associated logs or other ad-hoc analysis. The value SHOULD be globally
     * unique, per in-toto Provenance spec.
     * </pre>
     *
     * <code>string build_invocation_id = 1;</code>
     *
     * @return The buildInvocationId.
     */
    public java.lang.String getBuildInvocationId() {
      java.lang.Object ref = buildInvocationId_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        buildInvocationId_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Identifies the particular build invocation, which can be useful for finding
     * associated logs or other ad-hoc analysis. The value SHOULD be globally
     * unique, per in-toto Provenance spec.
     * </pre>
     *
     * <code>string build_invocation_id = 1;</code>
     *
     * @return The bytes for buildInvocationId.
     */
    public com.google.protobuf.ByteString getBuildInvocationIdBytes() {
      java.lang.Object ref = buildInvocationId_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        buildInvocationId_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Identifies the particular build invocation, which can be useful for finding
     * associated logs or other ad-hoc analysis. The value SHOULD be globally
     * unique, per in-toto Provenance spec.
     * </pre>
     *
     * <code>string build_invocation_id = 1;</code>
     *
     * @param value The buildInvocationId to set.
     * @return This builder for chaining.
     */
    public Builder setBuildInvocationId(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      buildInvocationId_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Identifies the particular build invocation, which can be useful for finding
     * associated logs or other ad-hoc analysis. The value SHOULD be globally
     * unique, per in-toto Provenance spec.
     * </pre>
     *
     * <code>string build_invocation_id = 1;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearBuildInvocationId() {
      buildInvocationId_ = getDefaultInstance().getBuildInvocationId();
      bitField0_ = (bitField0_ & ~0x00000001);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Identifies the particular build invocation, which can be useful for finding
     * associated logs or other ad-hoc analysis. The value SHOULD be globally
     * unique, per in-toto Provenance spec.
     * </pre>
     *
     * <code>string build_invocation_id = 1;</code>
     *
     * @param value The bytes for buildInvocationId to set.
     * @return This builder for chaining.
     */
    public Builder setBuildInvocationIdBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      buildInvocationId_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }

    private com.google.protobuf.Timestamp buildStartedOn_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        buildStartedOnBuilder_;
    /**
     *
     *
     * <pre>
     * The timestamp of when the build started.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp build_started_on = 2;</code>
     *
     * @return Whether the buildStartedOn field is set.
     */
    public boolean hasBuildStartedOn() {
      return ((bitField0_ & 0x00000002) != 0);
    }
    /**
     *
     *
     * <pre>
     * The timestamp of when the build started.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp build_started_on = 2;</code>
     *
     * @return The buildStartedOn.
     */
    public com.google.protobuf.Timestamp getBuildStartedOn() {
      if (buildStartedOnBuilder_ == null) {
        return buildStartedOn_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : buildStartedOn_;
      } else {
        return buildStartedOnBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * The timestamp of when the build started.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp build_started_on = 2;</code>
     */
    public Builder setBuildStartedOn(com.google.protobuf.Timestamp value) {
      if (buildStartedOnBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        buildStartedOn_ = value;
      } else {
        buildStartedOnBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The timestamp of when the build started.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp build_started_on = 2;</code>
     */
    public Builder setBuildStartedOn(com.google.protobuf.Timestamp.Builder builderForValue) {
      if (buildStartedOnBuilder_ == null) {
        buildStartedOn_ = builderForValue.build();
      } else {
        buildStartedOnBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The timestamp of when the build started.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp build_started_on = 2;</code>
     */
    public Builder mergeBuildStartedOn(com.google.protobuf.Timestamp value) {
      if (buildStartedOnBuilder_ == null) {
        if (((bitField0_ & 0x00000002) != 0)
            && buildStartedOn_ != null
            && buildStartedOn_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
          getBuildStartedOnBuilder().mergeFrom(value);
        } else {
          buildStartedOn_ = value;
        }
      } else {
        buildStartedOnBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The timestamp of when the build started.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp build_started_on = 2;</code>
     */
    public Builder clearBuildStartedOn() {
      bitField0_ = (bitField0_ & ~0x00000002);
      buildStartedOn_ = null;
      if (buildStartedOnBuilder_ != null) {
        buildStartedOnBuilder_.dispose();
        buildStartedOnBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The timestamp of when the build started.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp build_started_on = 2;</code>
     */
    public com.google.protobuf.Timestamp.Builder getBuildStartedOnBuilder() {
      bitField0_ |= 0x00000002;
      onChanged();
      return getBuildStartedOnFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The timestamp of when the build started.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp build_started_on = 2;</code>
     */
    public com.google.protobuf.TimestampOrBuilder getBuildStartedOnOrBuilder() {
      if (buildStartedOnBuilder_ != null) {
        return buildStartedOnBuilder_.getMessageOrBuilder();
      } else {
        return buildStartedOn_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : buildStartedOn_;
      }
    }
    /**
     *
     *
     * <pre>
     * The timestamp of when the build started.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp build_started_on = 2;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        getBuildStartedOnFieldBuilder() {
      if (buildStartedOnBuilder_ == null) {
        buildStartedOnBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.Timestamp,
                com.google.protobuf.Timestamp.Builder,
                com.google.protobuf.TimestampOrBuilder>(
                getBuildStartedOn(), getParentForChildren(), isClean());
        buildStartedOn_ = null;
      }
      return buildStartedOnBuilder_;
    }

    private com.google.protobuf.Timestamp buildFinishedOn_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        buildFinishedOnBuilder_;
    /**
     *
     *
     * <pre>
     * The timestamp of when the build completed.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp build_finished_on = 3;</code>
     *
     * @return Whether the buildFinishedOn field is set.
     */
    public boolean hasBuildFinishedOn() {
      return ((bitField0_ & 0x00000004) != 0);
    }
    /**
     *
     *
     * <pre>
     * The timestamp of when the build completed.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp build_finished_on = 3;</code>
     *
     * @return The buildFinishedOn.
     */
    public com.google.protobuf.Timestamp getBuildFinishedOn() {
      if (buildFinishedOnBuilder_ == null) {
        return buildFinishedOn_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : buildFinishedOn_;
      } else {
        return buildFinishedOnBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * The timestamp of when the build completed.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp build_finished_on = 3;</code>
     */
    public Builder setBuildFinishedOn(com.google.protobuf.Timestamp value) {
      if (buildFinishedOnBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        buildFinishedOn_ = value;
      } else {
        buildFinishedOnBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The timestamp of when the build completed.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp build_finished_on = 3;</code>
     */
    public Builder setBuildFinishedOn(com.google.protobuf.Timestamp.Builder builderForValue) {
      if (buildFinishedOnBuilder_ == null) {
        buildFinishedOn_ = builderForValue.build();
      } else {
        buildFinishedOnBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The timestamp of when the build completed.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp build_finished_on = 3;</code>
     */
    public Builder mergeBuildFinishedOn(com.google.protobuf.Timestamp value) {
      if (buildFinishedOnBuilder_ == null) {
        if (((bitField0_ & 0x00000004) != 0)
            && buildFinishedOn_ != null
            && buildFinishedOn_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
          getBuildFinishedOnBuilder().mergeFrom(value);
        } else {
          buildFinishedOn_ = value;
        }
      } else {
        buildFinishedOnBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The timestamp of when the build completed.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp build_finished_on = 3;</code>
     */
    public Builder clearBuildFinishedOn() {
      bitField0_ = (bitField0_ & ~0x00000004);
      buildFinishedOn_ = null;
      if (buildFinishedOnBuilder_ != null) {
        buildFinishedOnBuilder_.dispose();
        buildFinishedOnBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The timestamp of when the build completed.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp build_finished_on = 3;</code>
     */
    public com.google.protobuf.Timestamp.Builder getBuildFinishedOnBuilder() {
      bitField0_ |= 0x00000004;
      onChanged();
      return getBuildFinishedOnFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The timestamp of when the build completed.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp build_finished_on = 3;</code>
     */
    public com.google.protobuf.TimestampOrBuilder getBuildFinishedOnOrBuilder() {
      if (buildFinishedOnBuilder_ != null) {
        return buildFinishedOnBuilder_.getMessageOrBuilder();
      } else {
        return buildFinishedOn_ == null
            ? com.google.protobuf.Timestamp.getDefaultInstance()
            : buildFinishedOn_;
      }
    }
    /**
     *
     *
     * <pre>
     * The timestamp of when the build completed.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp build_finished_on = 3;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Timestamp,
            com.google.protobuf.Timestamp.Builder,
            com.google.protobuf.TimestampOrBuilder>
        getBuildFinishedOnFieldBuilder() {
      if (buildFinishedOnBuilder_ == null) {
        buildFinishedOnBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.Timestamp,
                com.google.protobuf.Timestamp.Builder,
                com.google.protobuf.TimestampOrBuilder>(
                getBuildFinishedOn(), getParentForChildren(), isClean());
        buildFinishedOn_ = null;
      }
      return buildFinishedOnBuilder_;
    }

    private io.grafeas.v1.Completeness completeness_;
    private com.google.protobuf.SingleFieldBuilderV3<
            io.grafeas.v1.Completeness,
            io.grafeas.v1.Completeness.Builder,
            io.grafeas.v1.CompletenessOrBuilder>
        completenessBuilder_;
    /**
     *
     *
     * <pre>
     * Indicates that the builder claims certain fields in this message to be
     * complete.
     * </pre>
     *
     * <code>.grafeas.v1.Completeness completeness = 4;</code>
     *
     * @return Whether the completeness field is set.
     */
    public boolean hasCompleteness() {
      return ((bitField0_ & 0x00000008) != 0);
    }
    /**
     *
     *
     * <pre>
     * Indicates that the builder claims certain fields in this message to be
     * complete.
     * </pre>
     *
     * <code>.grafeas.v1.Completeness completeness = 4;</code>
     *
     * @return The completeness.
     */
    public io.grafeas.v1.Completeness getCompleteness() {
      if (completenessBuilder_ == null) {
        return completeness_ == null
            ? io.grafeas.v1.Completeness.getDefaultInstance()
            : completeness_;
      } else {
        return completenessBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Indicates that the builder claims certain fields in this message to be
     * complete.
     * </pre>
     *
     * <code>.grafeas.v1.Completeness completeness = 4;</code>
     */
    public Builder setCompleteness(io.grafeas.v1.Completeness value) {
      if (completenessBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        completeness_ = value;
      } else {
        completenessBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Indicates that the builder claims certain fields in this message to be
     * complete.
     * </pre>
     *
     * <code>.grafeas.v1.Completeness completeness = 4;</code>
     */
    public Builder setCompleteness(io.grafeas.v1.Completeness.Builder builderForValue) {
      if (completenessBuilder_ == null) {
        completeness_ = builderForValue.build();
      } else {
        completenessBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Indicates that the builder claims certain fields in this message to be
     * complete.
     * </pre>
     *
     * <code>.grafeas.v1.Completeness completeness = 4;</code>
     */
    public Builder mergeCompleteness(io.grafeas.v1.Completeness value) {
      if (completenessBuilder_ == null) {
        if (((bitField0_ & 0x00000008) != 0)
            && completeness_ != null
            && completeness_ != io.grafeas.v1.Completeness.getDefaultInstance()) {
          getCompletenessBuilder().mergeFrom(value);
        } else {
          completeness_ = value;
        }
      } else {
        completenessBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Indicates that the builder claims certain fields in this message to be
     * complete.
     * </pre>
     *
     * <code>.grafeas.v1.Completeness completeness = 4;</code>
     */
    public Builder clearCompleteness() {
      bitField0_ = (bitField0_ & ~0x00000008);
      completeness_ = null;
      if (completenessBuilder_ != null) {
        completenessBuilder_.dispose();
        completenessBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Indicates that the builder claims certain fields in this message to be
     * complete.
     * </pre>
     *
     * <code>.grafeas.v1.Completeness completeness = 4;</code>
     */
    public io.grafeas.v1.Completeness.Builder getCompletenessBuilder() {
      bitField0_ |= 0x00000008;
      onChanged();
      return getCompletenessFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Indicates that the builder claims certain fields in this message to be
     * complete.
     * </pre>
     *
     * <code>.grafeas.v1.Completeness completeness = 4;</code>
     */
    public io.grafeas.v1.CompletenessOrBuilder getCompletenessOrBuilder() {
      if (completenessBuilder_ != null) {
        return completenessBuilder_.getMessageOrBuilder();
      } else {
        return completeness_ == null
            ? io.grafeas.v1.Completeness.getDefaultInstance()
            : completeness_;
      }
    }
    /**
     *
     *
     * <pre>
     * Indicates that the builder claims certain fields in this message to be
     * complete.
     * </pre>
     *
     * <code>.grafeas.v1.Completeness completeness = 4;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            io.grafeas.v1.Completeness,
            io.grafeas.v1.Completeness.Builder,
            io.grafeas.v1.CompletenessOrBuilder>
        getCompletenessFieldBuilder() {
      if (completenessBuilder_ == null) {
        completenessBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                io.grafeas.v1.Completeness,
                io.grafeas.v1.Completeness.Builder,
                io.grafeas.v1.CompletenessOrBuilder>(
                getCompleteness(), getParentForChildren(), isClean());
        completeness_ = null;
      }
      return completenessBuilder_;
    }

    private boolean reproducible_;
    /**
     *
     *
     * <pre>
     * If true, the builder claims that running the recipe on materials will
     * produce bit-for-bit identical output.
     * </pre>
     *
     * <code>bool reproducible = 5;</code>
     *
     * @return The reproducible.
     */
    @java.lang.Override
    public boolean getReproducible() {
      return reproducible_;
    }
    /**
     *
     *
     * <pre>
     * If true, the builder claims that running the recipe on materials will
     * produce bit-for-bit identical output.
     * </pre>
     *
     * <code>bool reproducible = 5;</code>
     *
     * @param value The reproducible to set.
     * @return This builder for chaining.
     */
    public Builder setReproducible(boolean value) {

      reproducible_ = value;
      bitField0_ |= 0x00000010;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * If true, the builder claims that running the recipe on materials will
     * produce bit-for-bit identical output.
     * </pre>
     *
     * <code>bool reproducible = 5;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearReproducible() {
      bitField0_ = (bitField0_ & ~0x00000010);
      reproducible_ = false;
      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.Metadata)
  }

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

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

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

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

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

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