/*
 * 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_statement.proto

package io.grafeas.v1;

/**
 *
 *
 * <pre>
 * Spec defined at
 * https://github.com/in-toto/attestation/tree/main/spec#statement The
 * serialized InTotoStatement will be stored as Envelope.payload.
 * Envelope.payloadType is always "application/vnd.in-toto+json".
 * </pre>
 *
 * Protobuf type {@code grafeas.v1.InTotoStatement}
 */
public final class InTotoStatement extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:grafeas.v1.InTotoStatement)
    InTotoStatementOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use InTotoStatement.newBuilder() to construct.
  private InTotoStatement(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private InTotoStatement() {
    type_ = "";
    subject_ = java.util.Collections.emptyList();
    predicateType_ = "";
  }

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

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

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

  private int predicateCase_ = 0;

  @SuppressWarnings("serial")
  private java.lang.Object predicate_;

  public enum PredicateCase
      implements
          com.google.protobuf.Internal.EnumLite,
          com.google.protobuf.AbstractMessage.InternalOneOfEnum {
    PROVENANCE(4),
    SLSA_PROVENANCE(5),
    SLSA_PROVENANCE_ZERO_TWO(6),
    PREDICATE_NOT_SET(0);
    private final int value;

    private PredicateCase(int value) {
      this.value = value;
    }
    /**
     * @param value The number of the enum to look for.
     * @return The enum associated with the given number.
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static PredicateCase valueOf(int value) {
      return forNumber(value);
    }

    public static PredicateCase forNumber(int value) {
      switch (value) {
        case 4:
          return PROVENANCE;
        case 5:
          return SLSA_PROVENANCE;
        case 6:
          return SLSA_PROVENANCE_ZERO_TWO;
        case 0:
          return PREDICATE_NOT_SET;
        default:
          return null;
      }
    }

    public int getNumber() {
      return this.value;
    }
  };

  public PredicateCase getPredicateCase() {
    return PredicateCase.forNumber(predicateCase_);
  }

  public static final int TYPE_FIELD_NUMBER = 1;

  @SuppressWarnings("serial")
  private volatile java.lang.Object type_ = "";
  /**
   *
   *
   * <pre>
   * Always `https://in-toto.io/Statement/v0.1`.
   * </pre>
   *
   * <code>string type = 1 [json_name = "_type"];</code>
   *
   * @return The type.
   */
  @java.lang.Override
  public java.lang.String getType() {
    java.lang.Object ref = type_;
    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();
      type_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Always `https://in-toto.io/Statement/v0.1`.
   * </pre>
   *
   * <code>string type = 1 [json_name = "_type"];</code>
   *
   * @return The bytes for type.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getTypeBytes() {
    java.lang.Object ref = type_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      type_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int SUBJECT_FIELD_NUMBER = 2;

  @SuppressWarnings("serial")
  private java.util.List<io.grafeas.v1.Subject> subject_;
  /** <code>repeated .grafeas.v1.Subject subject = 2;</code> */
  @java.lang.Override
  public java.util.List<io.grafeas.v1.Subject> getSubjectList() {
    return subject_;
  }
  /** <code>repeated .grafeas.v1.Subject subject = 2;</code> */
  @java.lang.Override
  public java.util.List<? extends io.grafeas.v1.SubjectOrBuilder> getSubjectOrBuilderList() {
    return subject_;
  }
  /** <code>repeated .grafeas.v1.Subject subject = 2;</code> */
  @java.lang.Override
  public int getSubjectCount() {
    return subject_.size();
  }
  /** <code>repeated .grafeas.v1.Subject subject = 2;</code> */
  @java.lang.Override
  public io.grafeas.v1.Subject getSubject(int index) {
    return subject_.get(index);
  }
  /** <code>repeated .grafeas.v1.Subject subject = 2;</code> */
  @java.lang.Override
  public io.grafeas.v1.SubjectOrBuilder getSubjectOrBuilder(int index) {
    return subject_.get(index);
  }

  public static final int PREDICATE_TYPE_FIELD_NUMBER = 3;

  @SuppressWarnings("serial")
  private volatile java.lang.Object predicateType_ = "";
  /**
   *
   *
   * <pre>
   * `https://slsa.dev/provenance/v0.1` for SlsaProvenance.
   * </pre>
   *
   * <code>string predicate_type = 3;</code>
   *
   * @return The predicateType.
   */
  @java.lang.Override
  public java.lang.String getPredicateType() {
    java.lang.Object ref = predicateType_;
    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();
      predicateType_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * `https://slsa.dev/provenance/v0.1` for SlsaProvenance.
   * </pre>
   *
   * <code>string predicate_type = 3;</code>
   *
   * @return The bytes for predicateType.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getPredicateTypeBytes() {
    java.lang.Object ref = predicateType_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      predicateType_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int PROVENANCE_FIELD_NUMBER = 4;
  /**
   * <code>.grafeas.v1.InTotoProvenance provenance = 4;</code>
   *
   * @return Whether the provenance field is set.
   */
  @java.lang.Override
  public boolean hasProvenance() {
    return predicateCase_ == 4;
  }
  /**
   * <code>.grafeas.v1.InTotoProvenance provenance = 4;</code>
   *
   * @return The provenance.
   */
  @java.lang.Override
  public io.grafeas.v1.InTotoProvenance getProvenance() {
    if (predicateCase_ == 4) {
      return (io.grafeas.v1.InTotoProvenance) predicate_;
    }
    return io.grafeas.v1.InTotoProvenance.getDefaultInstance();
  }
  /** <code>.grafeas.v1.InTotoProvenance provenance = 4;</code> */
  @java.lang.Override
  public io.grafeas.v1.InTotoProvenanceOrBuilder getProvenanceOrBuilder() {
    if (predicateCase_ == 4) {
      return (io.grafeas.v1.InTotoProvenance) predicate_;
    }
    return io.grafeas.v1.InTotoProvenance.getDefaultInstance();
  }

  public static final int SLSA_PROVENANCE_FIELD_NUMBER = 5;
  /**
   * <code>.grafeas.v1.SlsaProvenance slsa_provenance = 5;</code>
   *
   * @return Whether the slsaProvenance field is set.
   */
  @java.lang.Override
  public boolean hasSlsaProvenance() {
    return predicateCase_ == 5;
  }
  /**
   * <code>.grafeas.v1.SlsaProvenance slsa_provenance = 5;</code>
   *
   * @return The slsaProvenance.
   */
  @java.lang.Override
  public io.grafeas.v1.SlsaProvenance getSlsaProvenance() {
    if (predicateCase_ == 5) {
      return (io.grafeas.v1.SlsaProvenance) predicate_;
    }
    return io.grafeas.v1.SlsaProvenance.getDefaultInstance();
  }
  /** <code>.grafeas.v1.SlsaProvenance slsa_provenance = 5;</code> */
  @java.lang.Override
  public io.grafeas.v1.SlsaProvenanceOrBuilder getSlsaProvenanceOrBuilder() {
    if (predicateCase_ == 5) {
      return (io.grafeas.v1.SlsaProvenance) predicate_;
    }
    return io.grafeas.v1.SlsaProvenance.getDefaultInstance();
  }

  public static final int SLSA_PROVENANCE_ZERO_TWO_FIELD_NUMBER = 6;
  /**
   * <code>.grafeas.v1.SlsaProvenanceZeroTwo slsa_provenance_zero_two = 6;</code>
   *
   * @return Whether the slsaProvenanceZeroTwo field is set.
   */
  @java.lang.Override
  public boolean hasSlsaProvenanceZeroTwo() {
    return predicateCase_ == 6;
  }
  /**
   * <code>.grafeas.v1.SlsaProvenanceZeroTwo slsa_provenance_zero_two = 6;</code>
   *
   * @return The slsaProvenanceZeroTwo.
   */
  @java.lang.Override
  public io.grafeas.v1.SlsaProvenanceZeroTwo getSlsaProvenanceZeroTwo() {
    if (predicateCase_ == 6) {
      return (io.grafeas.v1.SlsaProvenanceZeroTwo) predicate_;
    }
    return io.grafeas.v1.SlsaProvenanceZeroTwo.getDefaultInstance();
  }
  /** <code>.grafeas.v1.SlsaProvenanceZeroTwo slsa_provenance_zero_two = 6;</code> */
  @java.lang.Override
  public io.grafeas.v1.SlsaProvenanceZeroTwoOrBuilder getSlsaProvenanceZeroTwoOrBuilder() {
    if (predicateCase_ == 6) {
      return (io.grafeas.v1.SlsaProvenanceZeroTwo) predicate_;
    }
    return io.grafeas.v1.SlsaProvenanceZeroTwo.getDefaultInstance();
  }

  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(type_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, type_);
    }
    for (int i = 0; i < subject_.size(); i++) {
      output.writeMessage(2, subject_.get(i));
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(predicateType_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, predicateType_);
    }
    if (predicateCase_ == 4) {
      output.writeMessage(4, (io.grafeas.v1.InTotoProvenance) predicate_);
    }
    if (predicateCase_ == 5) {
      output.writeMessage(5, (io.grafeas.v1.SlsaProvenance) predicate_);
    }
    if (predicateCase_ == 6) {
      output.writeMessage(6, (io.grafeas.v1.SlsaProvenanceZeroTwo) predicate_);
    }
    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(type_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, type_);
    }
    for (int i = 0; i < subject_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, subject_.get(i));
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(predicateType_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, predicateType_);
    }
    if (predicateCase_ == 4) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              4, (io.grafeas.v1.InTotoProvenance) predicate_);
    }
    if (predicateCase_ == 5) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              5, (io.grafeas.v1.SlsaProvenance) predicate_);
    }
    if (predicateCase_ == 6) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              6, (io.grafeas.v1.SlsaProvenanceZeroTwo) predicate_);
    }
    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.InTotoStatement)) {
      return super.equals(obj);
    }
    io.grafeas.v1.InTotoStatement other = (io.grafeas.v1.InTotoStatement) obj;

    if (!getType().equals(other.getType())) return false;
    if (!getSubjectList().equals(other.getSubjectList())) return false;
    if (!getPredicateType().equals(other.getPredicateType())) return false;
    if (!getPredicateCase().equals(other.getPredicateCase())) return false;
    switch (predicateCase_) {
      case 4:
        if (!getProvenance().equals(other.getProvenance())) return false;
        break;
      case 5:
        if (!getSlsaProvenance().equals(other.getSlsaProvenance())) return false;
        break;
      case 6:
        if (!getSlsaProvenanceZeroTwo().equals(other.getSlsaProvenanceZeroTwo())) return false;
        break;
      case 0:
      default:
    }
    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) + TYPE_FIELD_NUMBER;
    hash = (53 * hash) + getType().hashCode();
    if (getSubjectCount() > 0) {
      hash = (37 * hash) + SUBJECT_FIELD_NUMBER;
      hash = (53 * hash) + getSubjectList().hashCode();
    }
    hash = (37 * hash) + PREDICATE_TYPE_FIELD_NUMBER;
    hash = (53 * hash) + getPredicateType().hashCode();
    switch (predicateCase_) {
      case 4:
        hash = (37 * hash) + PROVENANCE_FIELD_NUMBER;
        hash = (53 * hash) + getProvenance().hashCode();
        break;
      case 5:
        hash = (37 * hash) + SLSA_PROVENANCE_FIELD_NUMBER;
        hash = (53 * hash) + getSlsaProvenance().hashCode();
        break;
      case 6:
        hash = (37 * hash) + SLSA_PROVENANCE_ZERO_TWO_FIELD_NUMBER;
        hash = (53 * hash) + getSlsaProvenanceZeroTwo().hashCode();
        break;
      case 0:
      default:
    }
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

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

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

  public static io.grafeas.v1.InTotoStatement 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.InTotoStatement 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>
   * Spec defined at
   * https://github.com/in-toto/attestation/tree/main/spec#statement The
   * serialized InTotoStatement will be stored as Envelope.payload.
   * Envelope.payloadType is always "application/vnd.in-toto+json".
   * </pre>
   *
   * Protobuf type {@code grafeas.v1.InTotoStatement}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:grafeas.v1.InTotoStatement)
      io.grafeas.v1.InTotoStatementOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return io.grafeas.v1.InTotoStatementProto
          .internal_static_grafeas_v1_InTotoStatement_descriptor;
    }

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

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

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

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      type_ = "";
      if (subjectBuilder_ == null) {
        subject_ = java.util.Collections.emptyList();
      } else {
        subject_ = null;
        subjectBuilder_.clear();
      }
      bitField0_ = (bitField0_ & ~0x00000002);
      predicateType_ = "";
      if (provenanceBuilder_ != null) {
        provenanceBuilder_.clear();
      }
      if (slsaProvenanceBuilder_ != null) {
        slsaProvenanceBuilder_.clear();
      }
      if (slsaProvenanceZeroTwoBuilder_ != null) {
        slsaProvenanceZeroTwoBuilder_.clear();
      }
      predicateCase_ = 0;
      predicate_ = null;
      return this;
    }

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

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

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

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

    private void buildPartialRepeatedFields(io.grafeas.v1.InTotoStatement result) {
      if (subjectBuilder_ == null) {
        if (((bitField0_ & 0x00000002) != 0)) {
          subject_ = java.util.Collections.unmodifiableList(subject_);
          bitField0_ = (bitField0_ & ~0x00000002);
        }
        result.subject_ = subject_;
      } else {
        result.subject_ = subjectBuilder_.build();
      }
    }

    private void buildPartial0(io.grafeas.v1.InTotoStatement result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.type_ = type_;
      }
      if (((from_bitField0_ & 0x00000004) != 0)) {
        result.predicateType_ = predicateType_;
      }
    }

    private void buildPartialOneofs(io.grafeas.v1.InTotoStatement result) {
      result.predicateCase_ = predicateCase_;
      result.predicate_ = this.predicate_;
      if (predicateCase_ == 4 && provenanceBuilder_ != null) {
        result.predicate_ = provenanceBuilder_.build();
      }
      if (predicateCase_ == 5 && slsaProvenanceBuilder_ != null) {
        result.predicate_ = slsaProvenanceBuilder_.build();
      }
      if (predicateCase_ == 6 && slsaProvenanceZeroTwoBuilder_ != null) {
        result.predicate_ = slsaProvenanceZeroTwoBuilder_.build();
      }
    }

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

    public Builder mergeFrom(io.grafeas.v1.InTotoStatement other) {
      if (other == io.grafeas.v1.InTotoStatement.getDefaultInstance()) return this;
      if (!other.getType().isEmpty()) {
        type_ = other.type_;
        bitField0_ |= 0x00000001;
        onChanged();
      }
      if (subjectBuilder_ == null) {
        if (!other.subject_.isEmpty()) {
          if (subject_.isEmpty()) {
            subject_ = other.subject_;
            bitField0_ = (bitField0_ & ~0x00000002);
          } else {
            ensureSubjectIsMutable();
            subject_.addAll(other.subject_);
          }
          onChanged();
        }
      } else {
        if (!other.subject_.isEmpty()) {
          if (subjectBuilder_.isEmpty()) {
            subjectBuilder_.dispose();
            subjectBuilder_ = null;
            subject_ = other.subject_;
            bitField0_ = (bitField0_ & ~0x00000002);
            subjectBuilder_ =
                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
                    ? getSubjectFieldBuilder()
                    : null;
          } else {
            subjectBuilder_.addAllMessages(other.subject_);
          }
        }
      }
      if (!other.getPredicateType().isEmpty()) {
        predicateType_ = other.predicateType_;
        bitField0_ |= 0x00000004;
        onChanged();
      }
      switch (other.getPredicateCase()) {
        case PROVENANCE:
          {
            mergeProvenance(other.getProvenance());
            break;
          }
        case SLSA_PROVENANCE:
          {
            mergeSlsaProvenance(other.getSlsaProvenance());
            break;
          }
        case SLSA_PROVENANCE_ZERO_TWO:
          {
            mergeSlsaProvenanceZeroTwo(other.getSlsaProvenanceZeroTwo());
            break;
          }
        case PREDICATE_NOT_SET:
          {
            break;
          }
      }
      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:
              {
                type_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000001;
                break;
              } // case 10
            case 18:
              {
                io.grafeas.v1.Subject m =
                    input.readMessage(io.grafeas.v1.Subject.parser(), extensionRegistry);
                if (subjectBuilder_ == null) {
                  ensureSubjectIsMutable();
                  subject_.add(m);
                } else {
                  subjectBuilder_.addMessage(m);
                }
                break;
              } // case 18
            case 26:
              {
                predicateType_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000004;
                break;
              } // case 26
            case 34:
              {
                input.readMessage(getProvenanceFieldBuilder().getBuilder(), extensionRegistry);
                predicateCase_ = 4;
                break;
              } // case 34
            case 42:
              {
                input.readMessage(getSlsaProvenanceFieldBuilder().getBuilder(), extensionRegistry);
                predicateCase_ = 5;
                break;
              } // case 42
            case 50:
              {
                input.readMessage(
                    getSlsaProvenanceZeroTwoFieldBuilder().getBuilder(), extensionRegistry);
                predicateCase_ = 6;
                break;
              } // case 50
            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 predicateCase_ = 0;
    private java.lang.Object predicate_;

    public PredicateCase getPredicateCase() {
      return PredicateCase.forNumber(predicateCase_);
    }

    public Builder clearPredicate() {
      predicateCase_ = 0;
      predicate_ = null;
      onChanged();
      return this;
    }

    private int bitField0_;

    private java.lang.Object type_ = "";
    /**
     *
     *
     * <pre>
     * Always `https://in-toto.io/Statement/v0.1`.
     * </pre>
     *
     * <code>string type = 1 [json_name = "_type"];</code>
     *
     * @return The type.
     */
    public java.lang.String getType() {
      java.lang.Object ref = type_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        type_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Always `https://in-toto.io/Statement/v0.1`.
     * </pre>
     *
     * <code>string type = 1 [json_name = "_type"];</code>
     *
     * @return The bytes for type.
     */
    public com.google.protobuf.ByteString getTypeBytes() {
      java.lang.Object ref = type_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        type_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Always `https://in-toto.io/Statement/v0.1`.
     * </pre>
     *
     * <code>string type = 1 [json_name = "_type"];</code>
     *
     * @param value The type to set.
     * @return This builder for chaining.
     */
    public Builder setType(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      type_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Always `https://in-toto.io/Statement/v0.1`.
     * </pre>
     *
     * <code>string type = 1 [json_name = "_type"];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearType() {
      type_ = getDefaultInstance().getType();
      bitField0_ = (bitField0_ & ~0x00000001);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Always `https://in-toto.io/Statement/v0.1`.
     * </pre>
     *
     * <code>string type = 1 [json_name = "_type"];</code>
     *
     * @param value The bytes for type to set.
     * @return This builder for chaining.
     */
    public Builder setTypeBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      type_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }

    private java.util.List<io.grafeas.v1.Subject> subject_ = java.util.Collections.emptyList();

    private void ensureSubjectIsMutable() {
      if (!((bitField0_ & 0x00000002) != 0)) {
        subject_ = new java.util.ArrayList<io.grafeas.v1.Subject>(subject_);
        bitField0_ |= 0x00000002;
      }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            io.grafeas.v1.Subject, io.grafeas.v1.Subject.Builder, io.grafeas.v1.SubjectOrBuilder>
        subjectBuilder_;

    /** <code>repeated .grafeas.v1.Subject subject = 2;</code> */
    public java.util.List<io.grafeas.v1.Subject> getSubjectList() {
      if (subjectBuilder_ == null) {
        return java.util.Collections.unmodifiableList(subject_);
      } else {
        return subjectBuilder_.getMessageList();
      }
    }
    /** <code>repeated .grafeas.v1.Subject subject = 2;</code> */
    public int getSubjectCount() {
      if (subjectBuilder_ == null) {
        return subject_.size();
      } else {
        return subjectBuilder_.getCount();
      }
    }
    /** <code>repeated .grafeas.v1.Subject subject = 2;</code> */
    public io.grafeas.v1.Subject getSubject(int index) {
      if (subjectBuilder_ == null) {
        return subject_.get(index);
      } else {
        return subjectBuilder_.getMessage(index);
      }
    }
    /** <code>repeated .grafeas.v1.Subject subject = 2;</code> */
    public Builder setSubject(int index, io.grafeas.v1.Subject value) {
      if (subjectBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureSubjectIsMutable();
        subject_.set(index, value);
        onChanged();
      } else {
        subjectBuilder_.setMessage(index, value);
      }
      return this;
    }
    /** <code>repeated .grafeas.v1.Subject subject = 2;</code> */
    public Builder setSubject(int index, io.grafeas.v1.Subject.Builder builderForValue) {
      if (subjectBuilder_ == null) {
        ensureSubjectIsMutable();
        subject_.set(index, builderForValue.build());
        onChanged();
      } else {
        subjectBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /** <code>repeated .grafeas.v1.Subject subject = 2;</code> */
    public Builder addSubject(io.grafeas.v1.Subject value) {
      if (subjectBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureSubjectIsMutable();
        subject_.add(value);
        onChanged();
      } else {
        subjectBuilder_.addMessage(value);
      }
      return this;
    }
    /** <code>repeated .grafeas.v1.Subject subject = 2;</code> */
    public Builder addSubject(int index, io.grafeas.v1.Subject value) {
      if (subjectBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureSubjectIsMutable();
        subject_.add(index, value);
        onChanged();
      } else {
        subjectBuilder_.addMessage(index, value);
      }
      return this;
    }
    /** <code>repeated .grafeas.v1.Subject subject = 2;</code> */
    public Builder addSubject(io.grafeas.v1.Subject.Builder builderForValue) {
      if (subjectBuilder_ == null) {
        ensureSubjectIsMutable();
        subject_.add(builderForValue.build());
        onChanged();
      } else {
        subjectBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /** <code>repeated .grafeas.v1.Subject subject = 2;</code> */
    public Builder addSubject(int index, io.grafeas.v1.Subject.Builder builderForValue) {
      if (subjectBuilder_ == null) {
        ensureSubjectIsMutable();
        subject_.add(index, builderForValue.build());
        onChanged();
      } else {
        subjectBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /** <code>repeated .grafeas.v1.Subject subject = 2;</code> */
    public Builder addAllSubject(java.lang.Iterable<? extends io.grafeas.v1.Subject> values) {
      if (subjectBuilder_ == null) {
        ensureSubjectIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(values, subject_);
        onChanged();
      } else {
        subjectBuilder_.addAllMessages(values);
      }
      return this;
    }
    /** <code>repeated .grafeas.v1.Subject subject = 2;</code> */
    public Builder clearSubject() {
      if (subjectBuilder_ == null) {
        subject_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000002);
        onChanged();
      } else {
        subjectBuilder_.clear();
      }
      return this;
    }
    /** <code>repeated .grafeas.v1.Subject subject = 2;</code> */
    public Builder removeSubject(int index) {
      if (subjectBuilder_ == null) {
        ensureSubjectIsMutable();
        subject_.remove(index);
        onChanged();
      } else {
        subjectBuilder_.remove(index);
      }
      return this;
    }
    /** <code>repeated .grafeas.v1.Subject subject = 2;</code> */
    public io.grafeas.v1.Subject.Builder getSubjectBuilder(int index) {
      return getSubjectFieldBuilder().getBuilder(index);
    }
    /** <code>repeated .grafeas.v1.Subject subject = 2;</code> */
    public io.grafeas.v1.SubjectOrBuilder getSubjectOrBuilder(int index) {
      if (subjectBuilder_ == null) {
        return subject_.get(index);
      } else {
        return subjectBuilder_.getMessageOrBuilder(index);
      }
    }
    /** <code>repeated .grafeas.v1.Subject subject = 2;</code> */
    public java.util.List<? extends io.grafeas.v1.SubjectOrBuilder> getSubjectOrBuilderList() {
      if (subjectBuilder_ != null) {
        return subjectBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(subject_);
      }
    }
    /** <code>repeated .grafeas.v1.Subject subject = 2;</code> */
    public io.grafeas.v1.Subject.Builder addSubjectBuilder() {
      return getSubjectFieldBuilder().addBuilder(io.grafeas.v1.Subject.getDefaultInstance());
    }
    /** <code>repeated .grafeas.v1.Subject subject = 2;</code> */
    public io.grafeas.v1.Subject.Builder addSubjectBuilder(int index) {
      return getSubjectFieldBuilder().addBuilder(index, io.grafeas.v1.Subject.getDefaultInstance());
    }
    /** <code>repeated .grafeas.v1.Subject subject = 2;</code> */
    public java.util.List<io.grafeas.v1.Subject.Builder> getSubjectBuilderList() {
      return getSubjectFieldBuilder().getBuilderList();
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
            io.grafeas.v1.Subject, io.grafeas.v1.Subject.Builder, io.grafeas.v1.SubjectOrBuilder>
        getSubjectFieldBuilder() {
      if (subjectBuilder_ == null) {
        subjectBuilder_ =
            new com.google.protobuf.RepeatedFieldBuilderV3<
                io.grafeas.v1.Subject,
                io.grafeas.v1.Subject.Builder,
                io.grafeas.v1.SubjectOrBuilder>(
                subject_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean());
        subject_ = null;
      }
      return subjectBuilder_;
    }

    private java.lang.Object predicateType_ = "";
    /**
     *
     *
     * <pre>
     * `https://slsa.dev/provenance/v0.1` for SlsaProvenance.
     * </pre>
     *
     * <code>string predicate_type = 3;</code>
     *
     * @return The predicateType.
     */
    public java.lang.String getPredicateType() {
      java.lang.Object ref = predicateType_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        predicateType_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * `https://slsa.dev/provenance/v0.1` for SlsaProvenance.
     * </pre>
     *
     * <code>string predicate_type = 3;</code>
     *
     * @return The bytes for predicateType.
     */
    public com.google.protobuf.ByteString getPredicateTypeBytes() {
      java.lang.Object ref = predicateType_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        predicateType_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * `https://slsa.dev/provenance/v0.1` for SlsaProvenance.
     * </pre>
     *
     * <code>string predicate_type = 3;</code>
     *
     * @param value The predicateType to set.
     * @return This builder for chaining.
     */
    public Builder setPredicateType(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      predicateType_ = value;
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * `https://slsa.dev/provenance/v0.1` for SlsaProvenance.
     * </pre>
     *
     * <code>string predicate_type = 3;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearPredicateType() {
      predicateType_ = getDefaultInstance().getPredicateType();
      bitField0_ = (bitField0_ & ~0x00000004);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * `https://slsa.dev/provenance/v0.1` for SlsaProvenance.
     * </pre>
     *
     * <code>string predicate_type = 3;</code>
     *
     * @param value The bytes for predicateType to set.
     * @return This builder for chaining.
     */
    public Builder setPredicateTypeBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      predicateType_ = value;
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
            io.grafeas.v1.InTotoProvenance,
            io.grafeas.v1.InTotoProvenance.Builder,
            io.grafeas.v1.InTotoProvenanceOrBuilder>
        provenanceBuilder_;
    /**
     * <code>.grafeas.v1.InTotoProvenance provenance = 4;</code>
     *
     * @return Whether the provenance field is set.
     */
    @java.lang.Override
    public boolean hasProvenance() {
      return predicateCase_ == 4;
    }
    /**
     * <code>.grafeas.v1.InTotoProvenance provenance = 4;</code>
     *
     * @return The provenance.
     */
    @java.lang.Override
    public io.grafeas.v1.InTotoProvenance getProvenance() {
      if (provenanceBuilder_ == null) {
        if (predicateCase_ == 4) {
          return (io.grafeas.v1.InTotoProvenance) predicate_;
        }
        return io.grafeas.v1.InTotoProvenance.getDefaultInstance();
      } else {
        if (predicateCase_ == 4) {
          return provenanceBuilder_.getMessage();
        }
        return io.grafeas.v1.InTotoProvenance.getDefaultInstance();
      }
    }
    /** <code>.grafeas.v1.InTotoProvenance provenance = 4;</code> */
    public Builder setProvenance(io.grafeas.v1.InTotoProvenance value) {
      if (provenanceBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        predicate_ = value;
        onChanged();
      } else {
        provenanceBuilder_.setMessage(value);
      }
      predicateCase_ = 4;
      return this;
    }
    /** <code>.grafeas.v1.InTotoProvenance provenance = 4;</code> */
    public Builder setProvenance(io.grafeas.v1.InTotoProvenance.Builder builderForValue) {
      if (provenanceBuilder_ == null) {
        predicate_ = builderForValue.build();
        onChanged();
      } else {
        provenanceBuilder_.setMessage(builderForValue.build());
      }
      predicateCase_ = 4;
      return this;
    }
    /** <code>.grafeas.v1.InTotoProvenance provenance = 4;</code> */
    public Builder mergeProvenance(io.grafeas.v1.InTotoProvenance value) {
      if (provenanceBuilder_ == null) {
        if (predicateCase_ == 4
            && predicate_ != io.grafeas.v1.InTotoProvenance.getDefaultInstance()) {
          predicate_ =
              io.grafeas.v1.InTotoProvenance.newBuilder((io.grafeas.v1.InTotoProvenance) predicate_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          predicate_ = value;
        }
        onChanged();
      } else {
        if (predicateCase_ == 4) {
          provenanceBuilder_.mergeFrom(value);
        } else {
          provenanceBuilder_.setMessage(value);
        }
      }
      predicateCase_ = 4;
      return this;
    }
    /** <code>.grafeas.v1.InTotoProvenance provenance = 4;</code> */
    public Builder clearProvenance() {
      if (provenanceBuilder_ == null) {
        if (predicateCase_ == 4) {
          predicateCase_ = 0;
          predicate_ = null;
          onChanged();
        }
      } else {
        if (predicateCase_ == 4) {
          predicateCase_ = 0;
          predicate_ = null;
        }
        provenanceBuilder_.clear();
      }
      return this;
    }
    /** <code>.grafeas.v1.InTotoProvenance provenance = 4;</code> */
    public io.grafeas.v1.InTotoProvenance.Builder getProvenanceBuilder() {
      return getProvenanceFieldBuilder().getBuilder();
    }
    /** <code>.grafeas.v1.InTotoProvenance provenance = 4;</code> */
    @java.lang.Override
    public io.grafeas.v1.InTotoProvenanceOrBuilder getProvenanceOrBuilder() {
      if ((predicateCase_ == 4) && (provenanceBuilder_ != null)) {
        return provenanceBuilder_.getMessageOrBuilder();
      } else {
        if (predicateCase_ == 4) {
          return (io.grafeas.v1.InTotoProvenance) predicate_;
        }
        return io.grafeas.v1.InTotoProvenance.getDefaultInstance();
      }
    }
    /** <code>.grafeas.v1.InTotoProvenance provenance = 4;</code> */
    private com.google.protobuf.SingleFieldBuilderV3<
            io.grafeas.v1.InTotoProvenance,
            io.grafeas.v1.InTotoProvenance.Builder,
            io.grafeas.v1.InTotoProvenanceOrBuilder>
        getProvenanceFieldBuilder() {
      if (provenanceBuilder_ == null) {
        if (!(predicateCase_ == 4)) {
          predicate_ = io.grafeas.v1.InTotoProvenance.getDefaultInstance();
        }
        provenanceBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                io.grafeas.v1.InTotoProvenance,
                io.grafeas.v1.InTotoProvenance.Builder,
                io.grafeas.v1.InTotoProvenanceOrBuilder>(
                (io.grafeas.v1.InTotoProvenance) predicate_, getParentForChildren(), isClean());
        predicate_ = null;
      }
      predicateCase_ = 4;
      onChanged();
      return provenanceBuilder_;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
            io.grafeas.v1.SlsaProvenance,
            io.grafeas.v1.SlsaProvenance.Builder,
            io.grafeas.v1.SlsaProvenanceOrBuilder>
        slsaProvenanceBuilder_;
    /**
     * <code>.grafeas.v1.SlsaProvenance slsa_provenance = 5;</code>
     *
     * @return Whether the slsaProvenance field is set.
     */
    @java.lang.Override
    public boolean hasSlsaProvenance() {
      return predicateCase_ == 5;
    }
    /**
     * <code>.grafeas.v1.SlsaProvenance slsa_provenance = 5;</code>
     *
     * @return The slsaProvenance.
     */
    @java.lang.Override
    public io.grafeas.v1.SlsaProvenance getSlsaProvenance() {
      if (slsaProvenanceBuilder_ == null) {
        if (predicateCase_ == 5) {
          return (io.grafeas.v1.SlsaProvenance) predicate_;
        }
        return io.grafeas.v1.SlsaProvenance.getDefaultInstance();
      } else {
        if (predicateCase_ == 5) {
          return slsaProvenanceBuilder_.getMessage();
        }
        return io.grafeas.v1.SlsaProvenance.getDefaultInstance();
      }
    }
    /** <code>.grafeas.v1.SlsaProvenance slsa_provenance = 5;</code> */
    public Builder setSlsaProvenance(io.grafeas.v1.SlsaProvenance value) {
      if (slsaProvenanceBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        predicate_ = value;
        onChanged();
      } else {
        slsaProvenanceBuilder_.setMessage(value);
      }
      predicateCase_ = 5;
      return this;
    }
    /** <code>.grafeas.v1.SlsaProvenance slsa_provenance = 5;</code> */
    public Builder setSlsaProvenance(io.grafeas.v1.SlsaProvenance.Builder builderForValue) {
      if (slsaProvenanceBuilder_ == null) {
        predicate_ = builderForValue.build();
        onChanged();
      } else {
        slsaProvenanceBuilder_.setMessage(builderForValue.build());
      }
      predicateCase_ = 5;
      return this;
    }
    /** <code>.grafeas.v1.SlsaProvenance slsa_provenance = 5;</code> */
    public Builder mergeSlsaProvenance(io.grafeas.v1.SlsaProvenance value) {
      if (slsaProvenanceBuilder_ == null) {
        if (predicateCase_ == 5
            && predicate_ != io.grafeas.v1.SlsaProvenance.getDefaultInstance()) {
          predicate_ =
              io.grafeas.v1.SlsaProvenance.newBuilder((io.grafeas.v1.SlsaProvenance) predicate_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          predicate_ = value;
        }
        onChanged();
      } else {
        if (predicateCase_ == 5) {
          slsaProvenanceBuilder_.mergeFrom(value);
        } else {
          slsaProvenanceBuilder_.setMessage(value);
        }
      }
      predicateCase_ = 5;
      return this;
    }
    /** <code>.grafeas.v1.SlsaProvenance slsa_provenance = 5;</code> */
    public Builder clearSlsaProvenance() {
      if (slsaProvenanceBuilder_ == null) {
        if (predicateCase_ == 5) {
          predicateCase_ = 0;
          predicate_ = null;
          onChanged();
        }
      } else {
        if (predicateCase_ == 5) {
          predicateCase_ = 0;
          predicate_ = null;
        }
        slsaProvenanceBuilder_.clear();
      }
      return this;
    }
    /** <code>.grafeas.v1.SlsaProvenance slsa_provenance = 5;</code> */
    public io.grafeas.v1.SlsaProvenance.Builder getSlsaProvenanceBuilder() {
      return getSlsaProvenanceFieldBuilder().getBuilder();
    }
    /** <code>.grafeas.v1.SlsaProvenance slsa_provenance = 5;</code> */
    @java.lang.Override
    public io.grafeas.v1.SlsaProvenanceOrBuilder getSlsaProvenanceOrBuilder() {
      if ((predicateCase_ == 5) && (slsaProvenanceBuilder_ != null)) {
        return slsaProvenanceBuilder_.getMessageOrBuilder();
      } else {
        if (predicateCase_ == 5) {
          return (io.grafeas.v1.SlsaProvenance) predicate_;
        }
        return io.grafeas.v1.SlsaProvenance.getDefaultInstance();
      }
    }
    /** <code>.grafeas.v1.SlsaProvenance slsa_provenance = 5;</code> */
    private com.google.protobuf.SingleFieldBuilderV3<
            io.grafeas.v1.SlsaProvenance,
            io.grafeas.v1.SlsaProvenance.Builder,
            io.grafeas.v1.SlsaProvenanceOrBuilder>
        getSlsaProvenanceFieldBuilder() {
      if (slsaProvenanceBuilder_ == null) {
        if (!(predicateCase_ == 5)) {
          predicate_ = io.grafeas.v1.SlsaProvenance.getDefaultInstance();
        }
        slsaProvenanceBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                io.grafeas.v1.SlsaProvenance,
                io.grafeas.v1.SlsaProvenance.Builder,
                io.grafeas.v1.SlsaProvenanceOrBuilder>(
                (io.grafeas.v1.SlsaProvenance) predicate_, getParentForChildren(), isClean());
        predicate_ = null;
      }
      predicateCase_ = 5;
      onChanged();
      return slsaProvenanceBuilder_;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
            io.grafeas.v1.SlsaProvenanceZeroTwo,
            io.grafeas.v1.SlsaProvenanceZeroTwo.Builder,
            io.grafeas.v1.SlsaProvenanceZeroTwoOrBuilder>
        slsaProvenanceZeroTwoBuilder_;
    /**
     * <code>.grafeas.v1.SlsaProvenanceZeroTwo slsa_provenance_zero_two = 6;</code>
     *
     * @return Whether the slsaProvenanceZeroTwo field is set.
     */
    @java.lang.Override
    public boolean hasSlsaProvenanceZeroTwo() {
      return predicateCase_ == 6;
    }
    /**
     * <code>.grafeas.v1.SlsaProvenanceZeroTwo slsa_provenance_zero_two = 6;</code>
     *
     * @return The slsaProvenanceZeroTwo.
     */
    @java.lang.Override
    public io.grafeas.v1.SlsaProvenanceZeroTwo getSlsaProvenanceZeroTwo() {
      if (slsaProvenanceZeroTwoBuilder_ == null) {
        if (predicateCase_ == 6) {
          return (io.grafeas.v1.SlsaProvenanceZeroTwo) predicate_;
        }
        return io.grafeas.v1.SlsaProvenanceZeroTwo.getDefaultInstance();
      } else {
        if (predicateCase_ == 6) {
          return slsaProvenanceZeroTwoBuilder_.getMessage();
        }
        return io.grafeas.v1.SlsaProvenanceZeroTwo.getDefaultInstance();
      }
    }
    /** <code>.grafeas.v1.SlsaProvenanceZeroTwo slsa_provenance_zero_two = 6;</code> */
    public Builder setSlsaProvenanceZeroTwo(io.grafeas.v1.SlsaProvenanceZeroTwo value) {
      if (slsaProvenanceZeroTwoBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        predicate_ = value;
        onChanged();
      } else {
        slsaProvenanceZeroTwoBuilder_.setMessage(value);
      }
      predicateCase_ = 6;
      return this;
    }
    /** <code>.grafeas.v1.SlsaProvenanceZeroTwo slsa_provenance_zero_two = 6;</code> */
    public Builder setSlsaProvenanceZeroTwo(
        io.grafeas.v1.SlsaProvenanceZeroTwo.Builder builderForValue) {
      if (slsaProvenanceZeroTwoBuilder_ == null) {
        predicate_ = builderForValue.build();
        onChanged();
      } else {
        slsaProvenanceZeroTwoBuilder_.setMessage(builderForValue.build());
      }
      predicateCase_ = 6;
      return this;
    }
    /** <code>.grafeas.v1.SlsaProvenanceZeroTwo slsa_provenance_zero_two = 6;</code> */
    public Builder mergeSlsaProvenanceZeroTwo(io.grafeas.v1.SlsaProvenanceZeroTwo value) {
      if (slsaProvenanceZeroTwoBuilder_ == null) {
        if (predicateCase_ == 6
            && predicate_ != io.grafeas.v1.SlsaProvenanceZeroTwo.getDefaultInstance()) {
          predicate_ =
              io.grafeas.v1.SlsaProvenanceZeroTwo.newBuilder(
                      (io.grafeas.v1.SlsaProvenanceZeroTwo) predicate_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          predicate_ = value;
        }
        onChanged();
      } else {
        if (predicateCase_ == 6) {
          slsaProvenanceZeroTwoBuilder_.mergeFrom(value);
        } else {
          slsaProvenanceZeroTwoBuilder_.setMessage(value);
        }
      }
      predicateCase_ = 6;
      return this;
    }
    /** <code>.grafeas.v1.SlsaProvenanceZeroTwo slsa_provenance_zero_two = 6;</code> */
    public Builder clearSlsaProvenanceZeroTwo() {
      if (slsaProvenanceZeroTwoBuilder_ == null) {
        if (predicateCase_ == 6) {
          predicateCase_ = 0;
          predicate_ = null;
          onChanged();
        }
      } else {
        if (predicateCase_ == 6) {
          predicateCase_ = 0;
          predicate_ = null;
        }
        slsaProvenanceZeroTwoBuilder_.clear();
      }
      return this;
    }
    /** <code>.grafeas.v1.SlsaProvenanceZeroTwo slsa_provenance_zero_two = 6;</code> */
    public io.grafeas.v1.SlsaProvenanceZeroTwo.Builder getSlsaProvenanceZeroTwoBuilder() {
      return getSlsaProvenanceZeroTwoFieldBuilder().getBuilder();
    }
    /** <code>.grafeas.v1.SlsaProvenanceZeroTwo slsa_provenance_zero_two = 6;</code> */
    @java.lang.Override
    public io.grafeas.v1.SlsaProvenanceZeroTwoOrBuilder getSlsaProvenanceZeroTwoOrBuilder() {
      if ((predicateCase_ == 6) && (slsaProvenanceZeroTwoBuilder_ != null)) {
        return slsaProvenanceZeroTwoBuilder_.getMessageOrBuilder();
      } else {
        if (predicateCase_ == 6) {
          return (io.grafeas.v1.SlsaProvenanceZeroTwo) predicate_;
        }
        return io.grafeas.v1.SlsaProvenanceZeroTwo.getDefaultInstance();
      }
    }
    /** <code>.grafeas.v1.SlsaProvenanceZeroTwo slsa_provenance_zero_two = 6;</code> */
    private com.google.protobuf.SingleFieldBuilderV3<
            io.grafeas.v1.SlsaProvenanceZeroTwo,
            io.grafeas.v1.SlsaProvenanceZeroTwo.Builder,
            io.grafeas.v1.SlsaProvenanceZeroTwoOrBuilder>
        getSlsaProvenanceZeroTwoFieldBuilder() {
      if (slsaProvenanceZeroTwoBuilder_ == null) {
        if (!(predicateCase_ == 6)) {
          predicate_ = io.grafeas.v1.SlsaProvenanceZeroTwo.getDefaultInstance();
        }
        slsaProvenanceZeroTwoBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                io.grafeas.v1.SlsaProvenanceZeroTwo,
                io.grafeas.v1.SlsaProvenanceZeroTwo.Builder,
                io.grafeas.v1.SlsaProvenanceZeroTwoOrBuilder>(
                (io.grafeas.v1.SlsaProvenanceZeroTwo) predicate_,
                getParentForChildren(),
                isClean());
        predicate_ = null;
      }
      predicateCase_ = 6;
      onChanged();
      return slsaProvenanceZeroTwoBuilder_;
    }

    @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.InTotoStatement)
  }

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

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

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

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

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

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