Service.java

// Generated by the protocol buffer compiler.  DO NOT EDIT!
// NO CHECKED-IN PROTOBUF GENCODE
// source: sigstore_trustroot.proto
// Protobuf Java Version: 4.30.2

package dev.sigstore.proto.trustroot.v1;

/**
 * <pre>
 * Service represents an instance of a service that is a part of Sigstore infrastructure.
 * When selecting one or multiple services from a list of services, clients MUST:
 * * Use the API version hint to determine the service with the highest API version
 * that the client is compatible with.
 * * Only select services within the specified validity period and that have the
 * newest validity start date.
 * When selecting multiple services, clients MUST:
 * * Use the ServiceConfiguration to determine how many services MUST be selected.
 * Clients MUST return an error if there are not enough services that meet the
 * selection criteria.
 * * Group services by `operator` and select at most one service from an operator.
 * During verification, clients MUST treat valid verification metadata from the
 * operator as valid only once towards a threshold.
 * * Select services from only the highest supported API version. 
 * </pre>
 *
 * Protobuf type {@code dev.sigstore.trustroot.v1.Service}
 */
@javax.annotation.Generated(value="protoc", comments="annotations:Service.java.pb.meta")
public final class Service extends
    com.google.protobuf.GeneratedMessage implements
    // @@protoc_insertion_point(message_implements:dev.sigstore.trustroot.v1.Service)
    ServiceOrBuilder {
private static final long serialVersionUID = 0L;
  static {
    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
      /* major= */ 4,
      /* minor= */ 30,
      /* patch= */ 2,
      /* suffix= */ "",
      Service.class.getName());
  }
  // Use Service.newBuilder() to construct.
  private Service(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
    super(builder);
  }
  private Service() {
    url_ = "";
    operator_ = "";
  }

  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return dev.sigstore.proto.trustroot.v1.TrustRootProto.internal_static_dev_sigstore_trustroot_v1_Service_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return dev.sigstore.proto.trustroot.v1.TrustRootProto.internal_static_dev_sigstore_trustroot_v1_Service_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            dev.sigstore.proto.trustroot.v1.Service.class, dev.sigstore.proto.trustroot.v1.Service.Builder.class);
  }

  private int bitField0_;
  public static final int URL_FIELD_NUMBER = 1;
  @SuppressWarnings("serial")
  private volatile java.lang.Object url_ = "";
  /**
   * <pre>
   * URL of the service. MUST include scheme and authority. MAY include path.
   * </pre>
   *
   * <code>string url = 1;</code>
   * @return The url.
   */
  @java.lang.Override
  public java.lang.String getUrl() {
    java.lang.Object ref = url_;
    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();
      url_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * URL of the service. MUST include scheme and authority. MAY include path.
   * </pre>
   *
   * <code>string url = 1;</code>
   * @return The bytes for url.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString
      getUrlBytes() {
    java.lang.Object ref = url_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      url_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int MAJOR_API_VERSION_FIELD_NUMBER = 2;
  private int majorApiVersion_ = 0;
  /**
   * <pre>
   * Specifies the major API version. A value of 0 represents a service that
   * has not yet been released.
   * </pre>
   *
   * <code>uint32 major_api_version = 2;</code>
   * @return The majorApiVersion.
   */
  @java.lang.Override
  public int getMajorApiVersion() {
    return majorApiVersion_;
  }

  public static final int VALID_FOR_FIELD_NUMBER = 3;
  private dev.sigstore.proto.common.v1.TimeRange validFor_;
  /**
   * <pre>
   * Validity period of a service. A service that has only a start date
   * SHOULD be considered the most recent instance of that service, but
   * the client MUST NOT assume there is only one valid instance.
   * The TimeRange MUST be considered valid *inclusive* of the
   * endpoints.
   * </pre>
   *
   * <code>.dev.sigstore.common.v1.TimeRange valid_for = 3;</code>
   * @return Whether the validFor field is set.
   */
  @java.lang.Override
  public boolean hasValidFor() {
    return ((bitField0_ & 0x00000001) != 0);
  }
  /**
   * <pre>
   * Validity period of a service. A service that has only a start date
   * SHOULD be considered the most recent instance of that service, but
   * the client MUST NOT assume there is only one valid instance.
   * The TimeRange MUST be considered valid *inclusive* of the
   * endpoints.
   * </pre>
   *
   * <code>.dev.sigstore.common.v1.TimeRange valid_for = 3;</code>
   * @return The validFor.
   */
  @java.lang.Override
  public dev.sigstore.proto.common.v1.TimeRange getValidFor() {
    return validFor_ == null ? dev.sigstore.proto.common.v1.TimeRange.getDefaultInstance() : validFor_;
  }
  /**
   * <pre>
   * Validity period of a service. A service that has only a start date
   * SHOULD be considered the most recent instance of that service, but
   * the client MUST NOT assume there is only one valid instance.
   * The TimeRange MUST be considered valid *inclusive* of the
   * endpoints.
   * </pre>
   *
   * <code>.dev.sigstore.common.v1.TimeRange valid_for = 3;</code>
   */
  @java.lang.Override
  public dev.sigstore.proto.common.v1.TimeRangeOrBuilder getValidForOrBuilder() {
    return validFor_ == null ? dev.sigstore.proto.common.v1.TimeRange.getDefaultInstance() : validFor_;
  }

  public static final int OPERATOR_FIELD_NUMBER = 4;
  @SuppressWarnings("serial")
  private volatile java.lang.Object operator_ = "";
  /**
   * <pre>
   * Specifies the name of the service operator. When selecting multiple
   * services, clients MUST use the operator to select services from
   * distinct operators. Operator MUST be formatted as a scheme-less
   * URI, e.g. sigstore.dev
   * </pre>
   *
   * <code>string operator = 4;</code>
   * @return The operator.
   */
  @java.lang.Override
  public java.lang.String getOperator() {
    java.lang.Object ref = operator_;
    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();
      operator_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * Specifies the name of the service operator. When selecting multiple
   * services, clients MUST use the operator to select services from
   * distinct operators. Operator MUST be formatted as a scheme-less
   * URI, e.g. sigstore.dev
   * </pre>
   *
   * <code>string operator = 4;</code>
   * @return The bytes for operator.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString
      getOperatorBytes() {
    java.lang.Object ref = operator_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      operator_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  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.GeneratedMessage.isStringEmpty(url_)) {
      com.google.protobuf.GeneratedMessage.writeString(output, 1, url_);
    }
    if (majorApiVersion_ != 0) {
      output.writeUInt32(2, majorApiVersion_);
    }
    if (((bitField0_ & 0x00000001) != 0)) {
      output.writeMessage(3, getValidFor());
    }
    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(operator_)) {
      com.google.protobuf.GeneratedMessage.writeString(output, 4, operator_);
    }
    getUnknownFields().writeTo(output);
  }

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

    size = 0;
    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(url_)) {
      size += com.google.protobuf.GeneratedMessage.computeStringSize(1, url_);
    }
    if (majorApiVersion_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeUInt32Size(2, majorApiVersion_);
    }
    if (((bitField0_ & 0x00000001) != 0)) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(3, getValidFor());
    }
    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(operator_)) {
      size += com.google.protobuf.GeneratedMessage.computeStringSize(4, operator_);
    }
    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 dev.sigstore.proto.trustroot.v1.Service)) {
      return super.equals(obj);
    }
    dev.sigstore.proto.trustroot.v1.Service other = (dev.sigstore.proto.trustroot.v1.Service) obj;

    if (!getUrl()
        .equals(other.getUrl())) return false;
    if (getMajorApiVersion()
        != other.getMajorApiVersion()) return false;
    if (hasValidFor() != other.hasValidFor()) return false;
    if (hasValidFor()) {
      if (!getValidFor()
          .equals(other.getValidFor())) return false;
    }
    if (!getOperator()
        .equals(other.getOperator())) 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) + URL_FIELD_NUMBER;
    hash = (53 * hash) + getUrl().hashCode();
    hash = (37 * hash) + MAJOR_API_VERSION_FIELD_NUMBER;
    hash = (53 * hash) + getMajorApiVersion();
    if (hasValidFor()) {
      hash = (37 * hash) + VALID_FOR_FIELD_NUMBER;
      hash = (53 * hash) + getValidFor().hashCode();
    }
    hash = (37 * hash) + OPERATOR_FIELD_NUMBER;
    hash = (53 * hash) + getOperator().hashCode();
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static dev.sigstore.proto.trustroot.v1.Service parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static dev.sigstore.proto.trustroot.v1.Service parseFrom(
      java.nio.ByteBuffer data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static dev.sigstore.proto.trustroot.v1.Service parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static dev.sigstore.proto.trustroot.v1.Service parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static dev.sigstore.proto.trustroot.v1.Service parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static dev.sigstore.proto.trustroot.v1.Service parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static dev.sigstore.proto.trustroot.v1.Service parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessage
        .parseWithIOException(PARSER, input);
  }
  public static dev.sigstore.proto.trustroot.v1.Service parseFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessage
        .parseWithIOException(PARSER, input, extensionRegistry);
  }

  public static dev.sigstore.proto.trustroot.v1.Service parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessage
        .parseDelimitedWithIOException(PARSER, input);
  }

  public static dev.sigstore.proto.trustroot.v1.Service parseDelimitedFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessage
        .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
  }
  public static dev.sigstore.proto.trustroot.v1.Service parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessage
        .parseWithIOException(PARSER, input);
  }
  public static dev.sigstore.proto.trustroot.v1.Service parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessage
        .parseWithIOException(PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }
  public static Builder newBuilder(dev.sigstore.proto.trustroot.v1.Service 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.GeneratedMessage.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   * <pre>
   * Service represents an instance of a service that is a part of Sigstore infrastructure.
   * When selecting one or multiple services from a list of services, clients MUST:
   * * Use the API version hint to determine the service with the highest API version
   * that the client is compatible with.
   * * Only select services within the specified validity period and that have the
   * newest validity start date.
   * When selecting multiple services, clients MUST:
   * * Use the ServiceConfiguration to determine how many services MUST be selected.
   * Clients MUST return an error if there are not enough services that meet the
   * selection criteria.
   * * Group services by `operator` and select at most one service from an operator.
   * During verification, clients MUST treat valid verification metadata from the
   * operator as valid only once towards a threshold.
   * * Select services from only the highest supported API version. 
   * </pre>
   *
   * Protobuf type {@code dev.sigstore.trustroot.v1.Service}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessage.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:dev.sigstore.trustroot.v1.Service)
      dev.sigstore.proto.trustroot.v1.ServiceOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return dev.sigstore.proto.trustroot.v1.TrustRootProto.internal_static_dev_sigstore_trustroot_v1_Service_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return dev.sigstore.proto.trustroot.v1.TrustRootProto.internal_static_dev_sigstore_trustroot_v1_Service_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              dev.sigstore.proto.trustroot.v1.Service.class, dev.sigstore.proto.trustroot.v1.Service.Builder.class);
    }

    // Construct using dev.sigstore.proto.trustroot.v1.Service.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(
        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessage
              .alwaysUseFieldBuilders) {
        internalGetValidForFieldBuilder();
      }
    }
    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      url_ = "";
      majorApiVersion_ = 0;
      validFor_ = null;
      if (validForBuilder_ != null) {
        validForBuilder_.dispose();
        validForBuilder_ = null;
      }
      operator_ = "";
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return dev.sigstore.proto.trustroot.v1.TrustRootProto.internal_static_dev_sigstore_trustroot_v1_Service_descriptor;
    }

    @java.lang.Override
    public dev.sigstore.proto.trustroot.v1.Service getDefaultInstanceForType() {
      return dev.sigstore.proto.trustroot.v1.Service.getDefaultInstance();
    }

    @java.lang.Override
    public dev.sigstore.proto.trustroot.v1.Service build() {
      dev.sigstore.proto.trustroot.v1.Service result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public dev.sigstore.proto.trustroot.v1.Service buildPartial() {
      dev.sigstore.proto.trustroot.v1.Service result = new dev.sigstore.proto.trustroot.v1.Service(this);
      if (bitField0_ != 0) { buildPartial0(result); }
      onBuilt();
      return result;
    }

    private void buildPartial0(dev.sigstore.proto.trustroot.v1.Service result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.url_ = url_;
      }
      if (((from_bitField0_ & 0x00000002) != 0)) {
        result.majorApiVersion_ = majorApiVersion_;
      }
      int to_bitField0_ = 0;
      if (((from_bitField0_ & 0x00000004) != 0)) {
        result.validFor_ = validForBuilder_ == null
            ? validFor_
            : validForBuilder_.build();
        to_bitField0_ |= 0x00000001;
      }
      if (((from_bitField0_ & 0x00000008) != 0)) {
        result.operator_ = operator_;
      }
      result.bitField0_ |= to_bitField0_;
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof dev.sigstore.proto.trustroot.v1.Service) {
        return mergeFrom((dev.sigstore.proto.trustroot.v1.Service)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(dev.sigstore.proto.trustroot.v1.Service other) {
      if (other == dev.sigstore.proto.trustroot.v1.Service.getDefaultInstance()) return this;
      if (!other.getUrl().isEmpty()) {
        url_ = other.url_;
        bitField0_ |= 0x00000001;
        onChanged();
      }
      if (other.getMajorApiVersion() != 0) {
        setMajorApiVersion(other.getMajorApiVersion());
      }
      if (other.hasValidFor()) {
        mergeValidFor(other.getValidFor());
      }
      if (!other.getOperator().isEmpty()) {
        operator_ = other.operator_;
        bitField0_ |= 0x00000008;
        onChanged();
      }
      this.mergeUnknownFields(other.getUnknownFields());
      onChanged();
      return this;
    }

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

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 10: {
              url_ = input.readStringRequireUtf8();
              bitField0_ |= 0x00000001;
              break;
            } // case 10
            case 16: {
              majorApiVersion_ = input.readUInt32();
              bitField0_ |= 0x00000002;
              break;
            } // case 16
            case 26: {
              input.readMessage(
                  internalGetValidForFieldBuilder().getBuilder(),
                  extensionRegistry);
              bitField0_ |= 0x00000004;
              break;
            } // case 26
            case 34: {
              operator_ = input.readStringRequireUtf8();
              bitField0_ |= 0x00000008;
              break;
            } // case 34
            default: {
              if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                done = true; // was an endgroup tag
              }
              break;
            } // default:
          } // switch (tag)
        } // while (!done)
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.unwrapIOException();
      } finally {
        onChanged();
      } // finally
      return this;
    }
    private int bitField0_;

    private java.lang.Object url_ = "";
    /**
     * <pre>
     * URL of the service. MUST include scheme and authority. MAY include path.
     * </pre>
     *
     * <code>string url = 1;</code>
     * @return The url.
     */
    public java.lang.String getUrl() {
      java.lang.Object ref = url_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        url_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * URL of the service. MUST include scheme and authority. MAY include path.
     * </pre>
     *
     * <code>string url = 1;</code>
     * @return The bytes for url.
     */
    public com.google.protobuf.ByteString
        getUrlBytes() {
      java.lang.Object ref = url_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        url_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * URL of the service. MUST include scheme and authority. MAY include path.
     * </pre>
     *
     * <code>string url = 1;</code>
     * @param value The url to set.
     * @return This builder for chaining.
     */
    public Builder setUrl(
        java.lang.String value) {
      if (value == null) { throw new NullPointerException(); }
      url_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * URL of the service. MUST include scheme and authority. MAY include path.
     * </pre>
     *
     * <code>string url = 1;</code>
     * @return This builder for chaining.
     */
    public Builder clearUrl() {
      url_ = getDefaultInstance().getUrl();
      bitField0_ = (bitField0_ & ~0x00000001);
      onChanged();
      return this;
    }
    /**
     * <pre>
     * URL of the service. MUST include scheme and authority. MAY include path.
     * </pre>
     *
     * <code>string url = 1;</code>
     * @param value The bytes for url to set.
     * @return This builder for chaining.
     */
    public Builder setUrlBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) { throw new NullPointerException(); }
      checkByteStringIsUtf8(value);
      url_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }

    private int majorApiVersion_ ;
    /**
     * <pre>
     * Specifies the major API version. A value of 0 represents a service that
     * has not yet been released.
     * </pre>
     *
     * <code>uint32 major_api_version = 2;</code>
     * @return The majorApiVersion.
     */
    @java.lang.Override
    public int getMajorApiVersion() {
      return majorApiVersion_;
    }
    /**
     * <pre>
     * Specifies the major API version. A value of 0 represents a service that
     * has not yet been released.
     * </pre>
     *
     * <code>uint32 major_api_version = 2;</code>
     * @param value The majorApiVersion to set.
     * @return This builder for chaining.
     */
    public Builder setMajorApiVersion(int value) {

      majorApiVersion_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Specifies the major API version. A value of 0 represents a service that
     * has not yet been released.
     * </pre>
     *
     * <code>uint32 major_api_version = 2;</code>
     * @return This builder for chaining.
     */
    public Builder clearMajorApiVersion() {
      bitField0_ = (bitField0_ & ~0x00000002);
      majorApiVersion_ = 0;
      onChanged();
      return this;
    }

    private dev.sigstore.proto.common.v1.TimeRange validFor_;
    private com.google.protobuf.SingleFieldBuilder<
        dev.sigstore.proto.common.v1.TimeRange, dev.sigstore.proto.common.v1.TimeRange.Builder, dev.sigstore.proto.common.v1.TimeRangeOrBuilder> validForBuilder_;
    /**
     * <pre>
     * Validity period of a service. A service that has only a start date
     * SHOULD be considered the most recent instance of that service, but
     * the client MUST NOT assume there is only one valid instance.
     * The TimeRange MUST be considered valid *inclusive* of the
     * endpoints.
     * </pre>
     *
     * <code>.dev.sigstore.common.v1.TimeRange valid_for = 3;</code>
     * @return Whether the validFor field is set.
     */
    public boolean hasValidFor() {
      return ((bitField0_ & 0x00000004) != 0);
    }
    /**
     * <pre>
     * Validity period of a service. A service that has only a start date
     * SHOULD be considered the most recent instance of that service, but
     * the client MUST NOT assume there is only one valid instance.
     * The TimeRange MUST be considered valid *inclusive* of the
     * endpoints.
     * </pre>
     *
     * <code>.dev.sigstore.common.v1.TimeRange valid_for = 3;</code>
     * @return The validFor.
     */
    public dev.sigstore.proto.common.v1.TimeRange getValidFor() {
      if (validForBuilder_ == null) {
        return validFor_ == null ? dev.sigstore.proto.common.v1.TimeRange.getDefaultInstance() : validFor_;
      } else {
        return validForBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * Validity period of a service. A service that has only a start date
     * SHOULD be considered the most recent instance of that service, but
     * the client MUST NOT assume there is only one valid instance.
     * The TimeRange MUST be considered valid *inclusive* of the
     * endpoints.
     * </pre>
     *
     * <code>.dev.sigstore.common.v1.TimeRange valid_for = 3;</code>
     */
    public Builder setValidFor(dev.sigstore.proto.common.v1.TimeRange value) {
      if (validForBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        validFor_ = value;
      } else {
        validForBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Validity period of a service. A service that has only a start date
     * SHOULD be considered the most recent instance of that service, but
     * the client MUST NOT assume there is only one valid instance.
     * The TimeRange MUST be considered valid *inclusive* of the
     * endpoints.
     * </pre>
     *
     * <code>.dev.sigstore.common.v1.TimeRange valid_for = 3;</code>
     */
    public Builder setValidFor(
        dev.sigstore.proto.common.v1.TimeRange.Builder builderForValue) {
      if (validForBuilder_ == null) {
        validFor_ = builderForValue.build();
      } else {
        validForBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Validity period of a service. A service that has only a start date
     * SHOULD be considered the most recent instance of that service, but
     * the client MUST NOT assume there is only one valid instance.
     * The TimeRange MUST be considered valid *inclusive* of the
     * endpoints.
     * </pre>
     *
     * <code>.dev.sigstore.common.v1.TimeRange valid_for = 3;</code>
     */
    public Builder mergeValidFor(dev.sigstore.proto.common.v1.TimeRange value) {
      if (validForBuilder_ == null) {
        if (((bitField0_ & 0x00000004) != 0) &&
          validFor_ != null &&
          validFor_ != dev.sigstore.proto.common.v1.TimeRange.getDefaultInstance()) {
          getValidForBuilder().mergeFrom(value);
        } else {
          validFor_ = value;
        }
      } else {
        validForBuilder_.mergeFrom(value);
      }
      if (validFor_ != null) {
        bitField0_ |= 0x00000004;
        onChanged();
      }
      return this;
    }
    /**
     * <pre>
     * Validity period of a service. A service that has only a start date
     * SHOULD be considered the most recent instance of that service, but
     * the client MUST NOT assume there is only one valid instance.
     * The TimeRange MUST be considered valid *inclusive* of the
     * endpoints.
     * </pre>
     *
     * <code>.dev.sigstore.common.v1.TimeRange valid_for = 3;</code>
     */
    public Builder clearValidFor() {
      bitField0_ = (bitField0_ & ~0x00000004);
      validFor_ = null;
      if (validForBuilder_ != null) {
        validForBuilder_.dispose();
        validForBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Validity period of a service. A service that has only a start date
     * SHOULD be considered the most recent instance of that service, but
     * the client MUST NOT assume there is only one valid instance.
     * The TimeRange MUST be considered valid *inclusive* of the
     * endpoints.
     * </pre>
     *
     * <code>.dev.sigstore.common.v1.TimeRange valid_for = 3;</code>
     */
    public dev.sigstore.proto.common.v1.TimeRange.Builder getValidForBuilder() {
      bitField0_ |= 0x00000004;
      onChanged();
      return internalGetValidForFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Validity period of a service. A service that has only a start date
     * SHOULD be considered the most recent instance of that service, but
     * the client MUST NOT assume there is only one valid instance.
     * The TimeRange MUST be considered valid *inclusive* of the
     * endpoints.
     * </pre>
     *
     * <code>.dev.sigstore.common.v1.TimeRange valid_for = 3;</code>
     */
    public dev.sigstore.proto.common.v1.TimeRangeOrBuilder getValidForOrBuilder() {
      if (validForBuilder_ != null) {
        return validForBuilder_.getMessageOrBuilder();
      } else {
        return validFor_ == null ?
            dev.sigstore.proto.common.v1.TimeRange.getDefaultInstance() : validFor_;
      }
    }
    /**
     * <pre>
     * Validity period of a service. A service that has only a start date
     * SHOULD be considered the most recent instance of that service, but
     * the client MUST NOT assume there is only one valid instance.
     * The TimeRange MUST be considered valid *inclusive* of the
     * endpoints.
     * </pre>
     *
     * <code>.dev.sigstore.common.v1.TimeRange valid_for = 3;</code>
     */
    private com.google.protobuf.SingleFieldBuilder<
        dev.sigstore.proto.common.v1.TimeRange, dev.sigstore.proto.common.v1.TimeRange.Builder, dev.sigstore.proto.common.v1.TimeRangeOrBuilder> 
        internalGetValidForFieldBuilder() {
      if (validForBuilder_ == null) {
        validForBuilder_ = new com.google.protobuf.SingleFieldBuilder<
            dev.sigstore.proto.common.v1.TimeRange, dev.sigstore.proto.common.v1.TimeRange.Builder, dev.sigstore.proto.common.v1.TimeRangeOrBuilder>(
                getValidFor(),
                getParentForChildren(),
                isClean());
        validFor_ = null;
      }
      return validForBuilder_;
    }

    private java.lang.Object operator_ = "";
    /**
     * <pre>
     * Specifies the name of the service operator. When selecting multiple
     * services, clients MUST use the operator to select services from
     * distinct operators. Operator MUST be formatted as a scheme-less
     * URI, e.g. sigstore.dev
     * </pre>
     *
     * <code>string operator = 4;</code>
     * @return The operator.
     */
    public java.lang.String getOperator() {
      java.lang.Object ref = operator_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        operator_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * Specifies the name of the service operator. When selecting multiple
     * services, clients MUST use the operator to select services from
     * distinct operators. Operator MUST be formatted as a scheme-less
     * URI, e.g. sigstore.dev
     * </pre>
     *
     * <code>string operator = 4;</code>
     * @return The bytes for operator.
     */
    public com.google.protobuf.ByteString
        getOperatorBytes() {
      java.lang.Object ref = operator_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        operator_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * Specifies the name of the service operator. When selecting multiple
     * services, clients MUST use the operator to select services from
     * distinct operators. Operator MUST be formatted as a scheme-less
     * URI, e.g. sigstore.dev
     * </pre>
     *
     * <code>string operator = 4;</code>
     * @param value The operator to set.
     * @return This builder for chaining.
     */
    public Builder setOperator(
        java.lang.String value) {
      if (value == null) { throw new NullPointerException(); }
      operator_ = value;
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Specifies the name of the service operator. When selecting multiple
     * services, clients MUST use the operator to select services from
     * distinct operators. Operator MUST be formatted as a scheme-less
     * URI, e.g. sigstore.dev
     * </pre>
     *
     * <code>string operator = 4;</code>
     * @return This builder for chaining.
     */
    public Builder clearOperator() {
      operator_ = getDefaultInstance().getOperator();
      bitField0_ = (bitField0_ & ~0x00000008);
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Specifies the name of the service operator. When selecting multiple
     * services, clients MUST use the operator to select services from
     * distinct operators. Operator MUST be formatted as a scheme-less
     * URI, e.g. sigstore.dev
     * </pre>
     *
     * <code>string operator = 4;</code>
     * @param value The bytes for operator to set.
     * @return This builder for chaining.
     */
    public Builder setOperatorBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) { throw new NullPointerException(); }
      checkByteStringIsUtf8(value);
      operator_ = value;
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }

    // @@protoc_insertion_point(builder_scope:dev.sigstore.trustroot.v1.Service)
  }

  // @@protoc_insertion_point(class_scope:dev.sigstore.trustroot.v1.Service)
  private static final dev.sigstore.proto.trustroot.v1.Service DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new dev.sigstore.proto.trustroot.v1.Service();
  }

  public static dev.sigstore.proto.trustroot.v1.Service getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

  @java.lang.Override
  public dev.sigstore.proto.trustroot.v1.Service getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}