UpgradeOccurrence.java

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

package io.grafeas.v1;

/**
 *
 *
 * <pre>
 * An Upgrade Occurrence represents that a specific resource_url could install a
 * specific upgrade. This presence is supplied via local sources (i.e. it is
 * present in the mirror and the running system has noticed its availability).
 * For Windows, both distribution and windows_update contain information for the
 * Windows update.
 * </pre>
 *
 * Protobuf type {@code grafeas.v1.UpgradeOccurrence}
 */
public final class UpgradeOccurrence extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:grafeas.v1.UpgradeOccurrence)
    UpgradeOccurrenceOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use UpgradeOccurrence.newBuilder() to construct.
  private UpgradeOccurrence(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private UpgradeOccurrence() {
    package_ = "";
  }

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

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

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

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

  public static final int PACKAGE_FIELD_NUMBER = 1;
  private volatile java.lang.Object package_;
  /**
   *
   *
   * <pre>
   * Required for non-Windows OS. The package this Upgrade is for.
   * </pre>
   *
   * <code>string package = 1;</code>
   *
   * @return The package.
   */
  @java.lang.Override
  public java.lang.String getPackage() {
    java.lang.Object ref = package_;
    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();
      package_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * Required for non-Windows OS. The package this Upgrade is for.
   * </pre>
   *
   * <code>string package = 1;</code>
   *
   * @return The bytes for package.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getPackageBytes() {
    java.lang.Object ref = package_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      package_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int PARSED_VERSION_FIELD_NUMBER = 3;
  private io.grafeas.v1.Version parsedVersion_;
  /**
   *
   *
   * <pre>
   * Required for non-Windows OS. The version of the package in a machine +
   * human readable form.
   * </pre>
   *
   * <code>.grafeas.v1.Version parsed_version = 3;</code>
   *
   * @return Whether the parsedVersion field is set.
   */
  @java.lang.Override
  public boolean hasParsedVersion() {
    return parsedVersion_ != null;
  }
  /**
   *
   *
   * <pre>
   * Required for non-Windows OS. The version of the package in a machine +
   * human readable form.
   * </pre>
   *
   * <code>.grafeas.v1.Version parsed_version = 3;</code>
   *
   * @return The parsedVersion.
   */
  @java.lang.Override
  public io.grafeas.v1.Version getParsedVersion() {
    return parsedVersion_ == null ? io.grafeas.v1.Version.getDefaultInstance() : parsedVersion_;
  }
  /**
   *
   *
   * <pre>
   * Required for non-Windows OS. The version of the package in a machine +
   * human readable form.
   * </pre>
   *
   * <code>.grafeas.v1.Version parsed_version = 3;</code>
   */
  @java.lang.Override
  public io.grafeas.v1.VersionOrBuilder getParsedVersionOrBuilder() {
    return getParsedVersion();
  }

  public static final int DISTRIBUTION_FIELD_NUMBER = 4;
  private io.grafeas.v1.UpgradeDistribution distribution_;
  /**
   *
   *
   * <pre>
   * Metadata about the upgrade for available for the specific operating system
   * for the resource_url. This allows efficient filtering, as well as
   * making it easier to use the occurrence.
   * </pre>
   *
   * <code>.grafeas.v1.UpgradeDistribution distribution = 4;</code>
   *
   * @return Whether the distribution field is set.
   */
  @java.lang.Override
  public boolean hasDistribution() {
    return distribution_ != null;
  }
  /**
   *
   *
   * <pre>
   * Metadata about the upgrade for available for the specific operating system
   * for the resource_url. This allows efficient filtering, as well as
   * making it easier to use the occurrence.
   * </pre>
   *
   * <code>.grafeas.v1.UpgradeDistribution distribution = 4;</code>
   *
   * @return The distribution.
   */
  @java.lang.Override
  public io.grafeas.v1.UpgradeDistribution getDistribution() {
    return distribution_ == null
        ? io.grafeas.v1.UpgradeDistribution.getDefaultInstance()
        : distribution_;
  }
  /**
   *
   *
   * <pre>
   * Metadata about the upgrade for available for the specific operating system
   * for the resource_url. This allows efficient filtering, as well as
   * making it easier to use the occurrence.
   * </pre>
   *
   * <code>.grafeas.v1.UpgradeDistribution distribution = 4;</code>
   */
  @java.lang.Override
  public io.grafeas.v1.UpgradeDistributionOrBuilder getDistributionOrBuilder() {
    return getDistribution();
  }

  public static final int WINDOWS_UPDATE_FIELD_NUMBER = 5;
  private io.grafeas.v1.WindowsUpdate windowsUpdate_;
  /**
   *
   *
   * <pre>
   * Required for Windows OS. Represents the metadata about the Windows update.
   * </pre>
   *
   * <code>.grafeas.v1.WindowsUpdate windows_update = 5;</code>
   *
   * @return Whether the windowsUpdate field is set.
   */
  @java.lang.Override
  public boolean hasWindowsUpdate() {
    return windowsUpdate_ != null;
  }
  /**
   *
   *
   * <pre>
   * Required for Windows OS. Represents the metadata about the Windows update.
   * </pre>
   *
   * <code>.grafeas.v1.WindowsUpdate windows_update = 5;</code>
   *
   * @return The windowsUpdate.
   */
  @java.lang.Override
  public io.grafeas.v1.WindowsUpdate getWindowsUpdate() {
    return windowsUpdate_ == null
        ? io.grafeas.v1.WindowsUpdate.getDefaultInstance()
        : windowsUpdate_;
  }
  /**
   *
   *
   * <pre>
   * Required for Windows OS. Represents the metadata about the Windows update.
   * </pre>
   *
   * <code>.grafeas.v1.WindowsUpdate windows_update = 5;</code>
   */
  @java.lang.Override
  public io.grafeas.v1.WindowsUpdateOrBuilder getWindowsUpdateOrBuilder() {
    return getWindowsUpdate();
  }

  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(package_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, package_);
    }
    if (parsedVersion_ != null) {
      output.writeMessage(3, getParsedVersion());
    }
    if (distribution_ != null) {
      output.writeMessage(4, getDistribution());
    }
    if (windowsUpdate_ != null) {
      output.writeMessage(5, getWindowsUpdate());
    }
    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(package_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, package_);
    }
    if (parsedVersion_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getParsedVersion());
    }
    if (distribution_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getDistribution());
    }
    if (windowsUpdate_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getWindowsUpdate());
    }
    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.UpgradeOccurrence)) {
      return super.equals(obj);
    }
    io.grafeas.v1.UpgradeOccurrence other = (io.grafeas.v1.UpgradeOccurrence) obj;

    if (!getPackage().equals(other.getPackage())) return false;
    if (hasParsedVersion() != other.hasParsedVersion()) return false;
    if (hasParsedVersion()) {
      if (!getParsedVersion().equals(other.getParsedVersion())) return false;
    }
    if (hasDistribution() != other.hasDistribution()) return false;
    if (hasDistribution()) {
      if (!getDistribution().equals(other.getDistribution())) return false;
    }
    if (hasWindowsUpdate() != other.hasWindowsUpdate()) return false;
    if (hasWindowsUpdate()) {
      if (!getWindowsUpdate().equals(other.getWindowsUpdate())) 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) + PACKAGE_FIELD_NUMBER;
    hash = (53 * hash) + getPackage().hashCode();
    if (hasParsedVersion()) {
      hash = (37 * hash) + PARSED_VERSION_FIELD_NUMBER;
      hash = (53 * hash) + getParsedVersion().hashCode();
    }
    if (hasDistribution()) {
      hash = (37 * hash) + DISTRIBUTION_FIELD_NUMBER;
      hash = (53 * hash) + getDistribution().hashCode();
    }
    if (hasWindowsUpdate()) {
      hash = (37 * hash) + WINDOWS_UPDATE_FIELD_NUMBER;
      hash = (53 * hash) + getWindowsUpdate().hashCode();
    }
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

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

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

  public static io.grafeas.v1.UpgradeOccurrence 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.UpgradeOccurrence 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>
   * An Upgrade Occurrence represents that a specific resource_url could install a
   * specific upgrade. This presence is supplied via local sources (i.e. it is
   * present in the mirror and the running system has noticed its availability).
   * For Windows, both distribution and windows_update contain information for the
   * Windows update.
   * </pre>
   *
   * Protobuf type {@code grafeas.v1.UpgradeOccurrence}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:grafeas.v1.UpgradeOccurrence)
      io.grafeas.v1.UpgradeOccurrenceOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return io.grafeas.v1.Upgrade.internal_static_grafeas_v1_UpgradeOccurrence_descriptor;
    }

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

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

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

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

      if (parsedVersionBuilder_ == null) {
        parsedVersion_ = null;
      } else {
        parsedVersion_ = null;
        parsedVersionBuilder_ = null;
      }
      if (distributionBuilder_ == null) {
        distribution_ = null;
      } else {
        distribution_ = null;
        distributionBuilder_ = null;
      }
      if (windowsUpdateBuilder_ == null) {
        windowsUpdate_ = null;
      } else {
        windowsUpdate_ = null;
        windowsUpdateBuilder_ = null;
      }
      return this;
    }

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

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

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

    @java.lang.Override
    public io.grafeas.v1.UpgradeOccurrence buildPartial() {
      io.grafeas.v1.UpgradeOccurrence result = new io.grafeas.v1.UpgradeOccurrence(this);
      result.package_ = package_;
      if (parsedVersionBuilder_ == null) {
        result.parsedVersion_ = parsedVersion_;
      } else {
        result.parsedVersion_ = parsedVersionBuilder_.build();
      }
      if (distributionBuilder_ == null) {
        result.distribution_ = distribution_;
      } else {
        result.distribution_ = distributionBuilder_.build();
      }
      if (windowsUpdateBuilder_ == null) {
        result.windowsUpdate_ = windowsUpdate_;
      } else {
        result.windowsUpdate_ = windowsUpdateBuilder_.build();
      }
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }

    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.setField(field, value);
    }

    @java.lang.Override
    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }

    @java.lang.Override
    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }

    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }

    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof io.grafeas.v1.UpgradeOccurrence) {
        return mergeFrom((io.grafeas.v1.UpgradeOccurrence) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(io.grafeas.v1.UpgradeOccurrence other) {
      if (other == io.grafeas.v1.UpgradeOccurrence.getDefaultInstance()) return this;
      if (!other.getPackage().isEmpty()) {
        package_ = other.package_;
        onChanged();
      }
      if (other.hasParsedVersion()) {
        mergeParsedVersion(other.getParsedVersion());
      }
      if (other.hasDistribution()) {
        mergeDistribution(other.getDistribution());
      }
      if (other.hasWindowsUpdate()) {
        mergeWindowsUpdate(other.getWindowsUpdate());
      }
      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:
              {
                package_ = input.readStringRequireUtf8();

                break;
              } // case 10
            case 26:
              {
                input.readMessage(getParsedVersionFieldBuilder().getBuilder(), extensionRegistry);

                break;
              } // case 26
            case 34:
              {
                input.readMessage(getDistributionFieldBuilder().getBuilder(), extensionRegistry);

                break;
              } // case 34
            case 42:
              {
                input.readMessage(getWindowsUpdateFieldBuilder().getBuilder(), extensionRegistry);

                break;
              } // case 42
            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 java.lang.Object package_ = "";
    /**
     *
     *
     * <pre>
     * Required for non-Windows OS. The package this Upgrade is for.
     * </pre>
     *
     * <code>string package = 1;</code>
     *
     * @return The package.
     */
    public java.lang.String getPackage() {
      java.lang.Object ref = package_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        package_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required for non-Windows OS. The package this Upgrade is for.
     * </pre>
     *
     * <code>string package = 1;</code>
     *
     * @return The bytes for package.
     */
    public com.google.protobuf.ByteString getPackageBytes() {
      java.lang.Object ref = package_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        package_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * Required for non-Windows OS. The package this Upgrade is for.
     * </pre>
     *
     * <code>string package = 1;</code>
     *
     * @param value The package to set.
     * @return This builder for chaining.
     */
    public Builder setPackage(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }

      package_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required for non-Windows OS. The package this Upgrade is for.
     * </pre>
     *
     * <code>string package = 1;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearPackage() {

      package_ = getDefaultInstance().getPackage();
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Required for non-Windows OS. The package this Upgrade is for.
     * </pre>
     *
     * <code>string package = 1;</code>
     *
     * @param value The bytes for package to set.
     * @return This builder for chaining.
     */
    public Builder setPackageBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);

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

    private io.grafeas.v1.Version parsedVersion_;
    private com.google.protobuf.SingleFieldBuilderV3<
            io.grafeas.v1.Version, io.grafeas.v1.Version.Builder, io.grafeas.v1.VersionOrBuilder>
        parsedVersionBuilder_;
    /**
     *
     *
     * <pre>
     * Required for non-Windows OS. The version of the package in a machine +
     * human readable form.
     * </pre>
     *
     * <code>.grafeas.v1.Version parsed_version = 3;</code>
     *
     * @return Whether the parsedVersion field is set.
     */
    public boolean hasParsedVersion() {
      return parsedVersionBuilder_ != null || parsedVersion_ != null;
    }
    /**
     *
     *
     * <pre>
     * Required for non-Windows OS. The version of the package in a machine +
     * human readable form.
     * </pre>
     *
     * <code>.grafeas.v1.Version parsed_version = 3;</code>
     *
     * @return The parsedVersion.
     */
    public io.grafeas.v1.Version getParsedVersion() {
      if (parsedVersionBuilder_ == null) {
        return parsedVersion_ == null ? io.grafeas.v1.Version.getDefaultInstance() : parsedVersion_;
      } else {
        return parsedVersionBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Required for non-Windows OS. The version of the package in a machine +
     * human readable form.
     * </pre>
     *
     * <code>.grafeas.v1.Version parsed_version = 3;</code>
     */
    public Builder setParsedVersion(io.grafeas.v1.Version value) {
      if (parsedVersionBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        parsedVersion_ = value;
        onChanged();
      } else {
        parsedVersionBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required for non-Windows OS. The version of the package in a machine +
     * human readable form.
     * </pre>
     *
     * <code>.grafeas.v1.Version parsed_version = 3;</code>
     */
    public Builder setParsedVersion(io.grafeas.v1.Version.Builder builderForValue) {
      if (parsedVersionBuilder_ == null) {
        parsedVersion_ = builderForValue.build();
        onChanged();
      } else {
        parsedVersionBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required for non-Windows OS. The version of the package in a machine +
     * human readable form.
     * </pre>
     *
     * <code>.grafeas.v1.Version parsed_version = 3;</code>
     */
    public Builder mergeParsedVersion(io.grafeas.v1.Version value) {
      if (parsedVersionBuilder_ == null) {
        if (parsedVersion_ != null) {
          parsedVersion_ =
              io.grafeas.v1.Version.newBuilder(parsedVersion_).mergeFrom(value).buildPartial();
        } else {
          parsedVersion_ = value;
        }
        onChanged();
      } else {
        parsedVersionBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required for non-Windows OS. The version of the package in a machine +
     * human readable form.
     * </pre>
     *
     * <code>.grafeas.v1.Version parsed_version = 3;</code>
     */
    public Builder clearParsedVersion() {
      if (parsedVersionBuilder_ == null) {
        parsedVersion_ = null;
        onChanged();
      } else {
        parsedVersion_ = null;
        parsedVersionBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required for non-Windows OS. The version of the package in a machine +
     * human readable form.
     * </pre>
     *
     * <code>.grafeas.v1.Version parsed_version = 3;</code>
     */
    public io.grafeas.v1.Version.Builder getParsedVersionBuilder() {

      onChanged();
      return getParsedVersionFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Required for non-Windows OS. The version of the package in a machine +
     * human readable form.
     * </pre>
     *
     * <code>.grafeas.v1.Version parsed_version = 3;</code>
     */
    public io.grafeas.v1.VersionOrBuilder getParsedVersionOrBuilder() {
      if (parsedVersionBuilder_ != null) {
        return parsedVersionBuilder_.getMessageOrBuilder();
      } else {
        return parsedVersion_ == null ? io.grafeas.v1.Version.getDefaultInstance() : parsedVersion_;
      }
    }
    /**
     *
     *
     * <pre>
     * Required for non-Windows OS. The version of the package in a machine +
     * human readable form.
     * </pre>
     *
     * <code>.grafeas.v1.Version parsed_version = 3;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            io.grafeas.v1.Version, io.grafeas.v1.Version.Builder, io.grafeas.v1.VersionOrBuilder>
        getParsedVersionFieldBuilder() {
      if (parsedVersionBuilder_ == null) {
        parsedVersionBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                io.grafeas.v1.Version,
                io.grafeas.v1.Version.Builder,
                io.grafeas.v1.VersionOrBuilder>(
                getParsedVersion(), getParentForChildren(), isClean());
        parsedVersion_ = null;
      }
      return parsedVersionBuilder_;
    }

    private io.grafeas.v1.UpgradeDistribution distribution_;
    private com.google.protobuf.SingleFieldBuilderV3<
            io.grafeas.v1.UpgradeDistribution,
            io.grafeas.v1.UpgradeDistribution.Builder,
            io.grafeas.v1.UpgradeDistributionOrBuilder>
        distributionBuilder_;
    /**
     *
     *
     * <pre>
     * Metadata about the upgrade for available for the specific operating system
     * for the resource_url. This allows efficient filtering, as well as
     * making it easier to use the occurrence.
     * </pre>
     *
     * <code>.grafeas.v1.UpgradeDistribution distribution = 4;</code>
     *
     * @return Whether the distribution field is set.
     */
    public boolean hasDistribution() {
      return distributionBuilder_ != null || distribution_ != null;
    }
    /**
     *
     *
     * <pre>
     * Metadata about the upgrade for available for the specific operating system
     * for the resource_url. This allows efficient filtering, as well as
     * making it easier to use the occurrence.
     * </pre>
     *
     * <code>.grafeas.v1.UpgradeDistribution distribution = 4;</code>
     *
     * @return The distribution.
     */
    public io.grafeas.v1.UpgradeDistribution getDistribution() {
      if (distributionBuilder_ == null) {
        return distribution_ == null
            ? io.grafeas.v1.UpgradeDistribution.getDefaultInstance()
            : distribution_;
      } else {
        return distributionBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Metadata about the upgrade for available for the specific operating system
     * for the resource_url. This allows efficient filtering, as well as
     * making it easier to use the occurrence.
     * </pre>
     *
     * <code>.grafeas.v1.UpgradeDistribution distribution = 4;</code>
     */
    public Builder setDistribution(io.grafeas.v1.UpgradeDistribution value) {
      if (distributionBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        distribution_ = value;
        onChanged();
      } else {
        distributionBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Metadata about the upgrade for available for the specific operating system
     * for the resource_url. This allows efficient filtering, as well as
     * making it easier to use the occurrence.
     * </pre>
     *
     * <code>.grafeas.v1.UpgradeDistribution distribution = 4;</code>
     */
    public Builder setDistribution(io.grafeas.v1.UpgradeDistribution.Builder builderForValue) {
      if (distributionBuilder_ == null) {
        distribution_ = builderForValue.build();
        onChanged();
      } else {
        distributionBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Metadata about the upgrade for available for the specific operating system
     * for the resource_url. This allows efficient filtering, as well as
     * making it easier to use the occurrence.
     * </pre>
     *
     * <code>.grafeas.v1.UpgradeDistribution distribution = 4;</code>
     */
    public Builder mergeDistribution(io.grafeas.v1.UpgradeDistribution value) {
      if (distributionBuilder_ == null) {
        if (distribution_ != null) {
          distribution_ =
              io.grafeas.v1.UpgradeDistribution.newBuilder(distribution_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          distribution_ = value;
        }
        onChanged();
      } else {
        distributionBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Metadata about the upgrade for available for the specific operating system
     * for the resource_url. This allows efficient filtering, as well as
     * making it easier to use the occurrence.
     * </pre>
     *
     * <code>.grafeas.v1.UpgradeDistribution distribution = 4;</code>
     */
    public Builder clearDistribution() {
      if (distributionBuilder_ == null) {
        distribution_ = null;
        onChanged();
      } else {
        distribution_ = null;
        distributionBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Metadata about the upgrade for available for the specific operating system
     * for the resource_url. This allows efficient filtering, as well as
     * making it easier to use the occurrence.
     * </pre>
     *
     * <code>.grafeas.v1.UpgradeDistribution distribution = 4;</code>
     */
    public io.grafeas.v1.UpgradeDistribution.Builder getDistributionBuilder() {

      onChanged();
      return getDistributionFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Metadata about the upgrade for available for the specific operating system
     * for the resource_url. This allows efficient filtering, as well as
     * making it easier to use the occurrence.
     * </pre>
     *
     * <code>.grafeas.v1.UpgradeDistribution distribution = 4;</code>
     */
    public io.grafeas.v1.UpgradeDistributionOrBuilder getDistributionOrBuilder() {
      if (distributionBuilder_ != null) {
        return distributionBuilder_.getMessageOrBuilder();
      } else {
        return distribution_ == null
            ? io.grafeas.v1.UpgradeDistribution.getDefaultInstance()
            : distribution_;
      }
    }
    /**
     *
     *
     * <pre>
     * Metadata about the upgrade for available for the specific operating system
     * for the resource_url. This allows efficient filtering, as well as
     * making it easier to use the occurrence.
     * </pre>
     *
     * <code>.grafeas.v1.UpgradeDistribution distribution = 4;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            io.grafeas.v1.UpgradeDistribution,
            io.grafeas.v1.UpgradeDistribution.Builder,
            io.grafeas.v1.UpgradeDistributionOrBuilder>
        getDistributionFieldBuilder() {
      if (distributionBuilder_ == null) {
        distributionBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                io.grafeas.v1.UpgradeDistribution,
                io.grafeas.v1.UpgradeDistribution.Builder,
                io.grafeas.v1.UpgradeDistributionOrBuilder>(
                getDistribution(), getParentForChildren(), isClean());
        distribution_ = null;
      }
      return distributionBuilder_;
    }

    private io.grafeas.v1.WindowsUpdate windowsUpdate_;
    private com.google.protobuf.SingleFieldBuilderV3<
            io.grafeas.v1.WindowsUpdate,
            io.grafeas.v1.WindowsUpdate.Builder,
            io.grafeas.v1.WindowsUpdateOrBuilder>
        windowsUpdateBuilder_;
    /**
     *
     *
     * <pre>
     * Required for Windows OS. Represents the metadata about the Windows update.
     * </pre>
     *
     * <code>.grafeas.v1.WindowsUpdate windows_update = 5;</code>
     *
     * @return Whether the windowsUpdate field is set.
     */
    public boolean hasWindowsUpdate() {
      return windowsUpdateBuilder_ != null || windowsUpdate_ != null;
    }
    /**
     *
     *
     * <pre>
     * Required for Windows OS. Represents the metadata about the Windows update.
     * </pre>
     *
     * <code>.grafeas.v1.WindowsUpdate windows_update = 5;</code>
     *
     * @return The windowsUpdate.
     */
    public io.grafeas.v1.WindowsUpdate getWindowsUpdate() {
      if (windowsUpdateBuilder_ == null) {
        return windowsUpdate_ == null
            ? io.grafeas.v1.WindowsUpdate.getDefaultInstance()
            : windowsUpdate_;
      } else {
        return windowsUpdateBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Required for Windows OS. Represents the metadata about the Windows update.
     * </pre>
     *
     * <code>.grafeas.v1.WindowsUpdate windows_update = 5;</code>
     */
    public Builder setWindowsUpdate(io.grafeas.v1.WindowsUpdate value) {
      if (windowsUpdateBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        windowsUpdate_ = value;
        onChanged();
      } else {
        windowsUpdateBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required for Windows OS. Represents the metadata about the Windows update.
     * </pre>
     *
     * <code>.grafeas.v1.WindowsUpdate windows_update = 5;</code>
     */
    public Builder setWindowsUpdate(io.grafeas.v1.WindowsUpdate.Builder builderForValue) {
      if (windowsUpdateBuilder_ == null) {
        windowsUpdate_ = builderForValue.build();
        onChanged();
      } else {
        windowsUpdateBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required for Windows OS. Represents the metadata about the Windows update.
     * </pre>
     *
     * <code>.grafeas.v1.WindowsUpdate windows_update = 5;</code>
     */
    public Builder mergeWindowsUpdate(io.grafeas.v1.WindowsUpdate value) {
      if (windowsUpdateBuilder_ == null) {
        if (windowsUpdate_ != null) {
          windowsUpdate_ =
              io.grafeas.v1.WindowsUpdate.newBuilder(windowsUpdate_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          windowsUpdate_ = value;
        }
        onChanged();
      } else {
        windowsUpdateBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required for Windows OS. Represents the metadata about the Windows update.
     * </pre>
     *
     * <code>.grafeas.v1.WindowsUpdate windows_update = 5;</code>
     */
    public Builder clearWindowsUpdate() {
      if (windowsUpdateBuilder_ == null) {
        windowsUpdate_ = null;
        onChanged();
      } else {
        windowsUpdate_ = null;
        windowsUpdateBuilder_ = null;
      }

      return this;
    }
    /**
     *
     *
     * <pre>
     * Required for Windows OS. Represents the metadata about the Windows update.
     * </pre>
     *
     * <code>.grafeas.v1.WindowsUpdate windows_update = 5;</code>
     */
    public io.grafeas.v1.WindowsUpdate.Builder getWindowsUpdateBuilder() {

      onChanged();
      return getWindowsUpdateFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Required for Windows OS. Represents the metadata about the Windows update.
     * </pre>
     *
     * <code>.grafeas.v1.WindowsUpdate windows_update = 5;</code>
     */
    public io.grafeas.v1.WindowsUpdateOrBuilder getWindowsUpdateOrBuilder() {
      if (windowsUpdateBuilder_ != null) {
        return windowsUpdateBuilder_.getMessageOrBuilder();
      } else {
        return windowsUpdate_ == null
            ? io.grafeas.v1.WindowsUpdate.getDefaultInstance()
            : windowsUpdate_;
      }
    }
    /**
     *
     *
     * <pre>
     * Required for Windows OS. Represents the metadata about the Windows update.
     * </pre>
     *
     * <code>.grafeas.v1.WindowsUpdate windows_update = 5;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            io.grafeas.v1.WindowsUpdate,
            io.grafeas.v1.WindowsUpdate.Builder,
            io.grafeas.v1.WindowsUpdateOrBuilder>
        getWindowsUpdateFieldBuilder() {
      if (windowsUpdateBuilder_ == null) {
        windowsUpdateBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                io.grafeas.v1.WindowsUpdate,
                io.grafeas.v1.WindowsUpdate.Builder,
                io.grafeas.v1.WindowsUpdateOrBuilder>(
                getWindowsUpdate(), getParentForChildren(), isClean());
        windowsUpdate_ = null;
      }
      return windowsUpdateBuilder_;
    }

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

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

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

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

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

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

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