Distribution.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/package.proto
package io.grafeas.v1;
/**
*
*
* <pre>
* This represents a particular channel of distribution for a given package.
* E.g., Debian's jessie-backports dpkg mirror.
* </pre>
*
* Protobuf type {@code grafeas.v1.Distribution}
*/
public final class Distribution extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:grafeas.v1.Distribution)
DistributionOrBuilder {
private static final long serialVersionUID = 0L;
// Use Distribution.newBuilder() to construct.
private Distribution(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private Distribution() {
cpeUri_ = "";
architecture_ = 0;
maintainer_ = "";
url_ = "";
description_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new Distribution();
}
@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.Package.internal_static_grafeas_v1_Distribution_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grafeas.v1.Package.internal_static_grafeas_v1_Distribution_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grafeas.v1.Distribution.class, io.grafeas.v1.Distribution.Builder.class);
}
public static final int CPE_URI_FIELD_NUMBER = 1;
private volatile java.lang.Object cpeUri_;
/**
*
*
* <pre>
* The cpe_uri in [CPE format](https://cpe.mitre.org/specification/)
* denoting the package manager version distributing a package.
* </pre>
*
* <code>string cpe_uri = 1 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @return The cpeUri.
*/
@java.lang.Override
public java.lang.String getCpeUri() {
java.lang.Object ref = cpeUri_;
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();
cpeUri_ = s;
return s;
}
}
/**
*
*
* <pre>
* The cpe_uri in [CPE format](https://cpe.mitre.org/specification/)
* denoting the package manager version distributing a package.
* </pre>
*
* <code>string cpe_uri = 1 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @return The bytes for cpeUri.
*/
@java.lang.Override
public com.google.protobuf.ByteString getCpeUriBytes() {
java.lang.Object ref = cpeUri_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
cpeUri_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int ARCHITECTURE_FIELD_NUMBER = 2;
private int architecture_;
/**
*
*
* <pre>
* The CPU architecture for which packages in this distribution channel were
* built.
* </pre>
*
* <code>.grafeas.v1.Architecture architecture = 2;</code>
*
* @return The enum numeric value on the wire for architecture.
*/
@java.lang.Override
public int getArchitectureValue() {
return architecture_;
}
/**
*
*
* <pre>
* The CPU architecture for which packages in this distribution channel were
* built.
* </pre>
*
* <code>.grafeas.v1.Architecture architecture = 2;</code>
*
* @return The architecture.
*/
@java.lang.Override
public io.grafeas.v1.Architecture getArchitecture() {
@SuppressWarnings("deprecation")
io.grafeas.v1.Architecture result = io.grafeas.v1.Architecture.valueOf(architecture_);
return result == null ? io.grafeas.v1.Architecture.UNRECOGNIZED : result;
}
public static final int LATEST_VERSION_FIELD_NUMBER = 3;
private io.grafeas.v1.Version latestVersion_;
/**
*
*
* <pre>
* The latest available version of this package in this distribution channel.
* </pre>
*
* <code>.grafeas.v1.Version latest_version = 3;</code>
*
* @return Whether the latestVersion field is set.
*/
@java.lang.Override
public boolean hasLatestVersion() {
return latestVersion_ != null;
}
/**
*
*
* <pre>
* The latest available version of this package in this distribution channel.
* </pre>
*
* <code>.grafeas.v1.Version latest_version = 3;</code>
*
* @return The latestVersion.
*/
@java.lang.Override
public io.grafeas.v1.Version getLatestVersion() {
return latestVersion_ == null ? io.grafeas.v1.Version.getDefaultInstance() : latestVersion_;
}
/**
*
*
* <pre>
* The latest available version of this package in this distribution channel.
* </pre>
*
* <code>.grafeas.v1.Version latest_version = 3;</code>
*/
@java.lang.Override
public io.grafeas.v1.VersionOrBuilder getLatestVersionOrBuilder() {
return getLatestVersion();
}
public static final int MAINTAINER_FIELD_NUMBER = 4;
private volatile java.lang.Object maintainer_;
/**
*
*
* <pre>
* A freeform string denoting the maintainer of this package.
* </pre>
*
* <code>string maintainer = 4;</code>
*
* @return The maintainer.
*/
@java.lang.Override
public java.lang.String getMaintainer() {
java.lang.Object ref = maintainer_;
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();
maintainer_ = s;
return s;
}
}
/**
*
*
* <pre>
* A freeform string denoting the maintainer of this package.
* </pre>
*
* <code>string maintainer = 4;</code>
*
* @return The bytes for maintainer.
*/
@java.lang.Override
public com.google.protobuf.ByteString getMaintainerBytes() {
java.lang.Object ref = maintainer_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
maintainer_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int URL_FIELD_NUMBER = 5;
private volatile java.lang.Object url_;
/**
*
*
* <pre>
* The distribution channel-specific homepage for this package.
* </pre>
*
* <code>string url = 5;</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>
* The distribution channel-specific homepage for this package.
* </pre>
*
* <code>string url = 5;</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 DESCRIPTION_FIELD_NUMBER = 6;
private volatile java.lang.Object description_;
/**
*
*
* <pre>
* The distribution channel-specific description of this package.
* </pre>
*
* <code>string description = 6;</code>
*
* @return The description.
*/
@java.lang.Override
public java.lang.String getDescription() {
java.lang.Object ref = description_;
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();
description_ = s;
return s;
}
}
/**
*
*
* <pre>
* The distribution channel-specific description of this package.
* </pre>
*
* <code>string description = 6;</code>
*
* @return The bytes for description.
*/
@java.lang.Override
public com.google.protobuf.ByteString getDescriptionBytes() {
java.lang.Object ref = description_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
description_ = 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.GeneratedMessageV3.isStringEmpty(cpeUri_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, cpeUri_);
}
if (architecture_ != io.grafeas.v1.Architecture.ARCHITECTURE_UNSPECIFIED.getNumber()) {
output.writeEnum(2, architecture_);
}
if (latestVersion_ != null) {
output.writeMessage(3, getLatestVersion());
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(maintainer_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 4, maintainer_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(url_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 5, url_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 6, description_);
}
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(cpeUri_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, cpeUri_);
}
if (architecture_ != io.grafeas.v1.Architecture.ARCHITECTURE_UNSPECIFIED.getNumber()) {
size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, architecture_);
}
if (latestVersion_ != null) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getLatestVersion());
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(maintainer_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, maintainer_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(url_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, url_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, description_);
}
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.Distribution)) {
return super.equals(obj);
}
io.grafeas.v1.Distribution other = (io.grafeas.v1.Distribution) obj;
if (!getCpeUri().equals(other.getCpeUri())) return false;
if (architecture_ != other.architecture_) return false;
if (hasLatestVersion() != other.hasLatestVersion()) return false;
if (hasLatestVersion()) {
if (!getLatestVersion().equals(other.getLatestVersion())) return false;
}
if (!getMaintainer().equals(other.getMaintainer())) return false;
if (!getUrl().equals(other.getUrl())) return false;
if (!getDescription().equals(other.getDescription())) 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) + CPE_URI_FIELD_NUMBER;
hash = (53 * hash) + getCpeUri().hashCode();
hash = (37 * hash) + ARCHITECTURE_FIELD_NUMBER;
hash = (53 * hash) + architecture_;
if (hasLatestVersion()) {
hash = (37 * hash) + LATEST_VERSION_FIELD_NUMBER;
hash = (53 * hash) + getLatestVersion().hashCode();
}
hash = (37 * hash) + MAINTAINER_FIELD_NUMBER;
hash = (53 * hash) + getMaintainer().hashCode();
hash = (37 * hash) + URL_FIELD_NUMBER;
hash = (53 * hash) + getUrl().hashCode();
hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER;
hash = (53 * hash) + getDescription().hashCode();
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static io.grafeas.v1.Distribution parseFrom(java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grafeas.v1.Distribution 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.Distribution parseFrom(com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grafeas.v1.Distribution 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.Distribution parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grafeas.v1.Distribution parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grafeas.v1.Distribution parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static io.grafeas.v1.Distribution 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.Distribution parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static io.grafeas.v1.Distribution 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.Distribution parseFrom(com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static io.grafeas.v1.Distribution 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.Distribution 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>
* This represents a particular channel of distribution for a given package.
* E.g., Debian's jessie-backports dpkg mirror.
* </pre>
*
* Protobuf type {@code grafeas.v1.Distribution}
*/
public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
implements
// @@protoc_insertion_point(builder_implements:grafeas.v1.Distribution)
io.grafeas.v1.DistributionOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return io.grafeas.v1.Package.internal_static_grafeas_v1_Distribution_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grafeas.v1.Package.internal_static_grafeas_v1_Distribution_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grafeas.v1.Distribution.class, io.grafeas.v1.Distribution.Builder.class);
}
// Construct using io.grafeas.v1.Distribution.newBuilder()
private Builder() {}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
cpeUri_ = "";
architecture_ = 0;
if (latestVersionBuilder_ == null) {
latestVersion_ = null;
} else {
latestVersion_ = null;
latestVersionBuilder_ = null;
}
maintainer_ = "";
url_ = "";
description_ = "";
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return io.grafeas.v1.Package.internal_static_grafeas_v1_Distribution_descriptor;
}
@java.lang.Override
public io.grafeas.v1.Distribution getDefaultInstanceForType() {
return io.grafeas.v1.Distribution.getDefaultInstance();
}
@java.lang.Override
public io.grafeas.v1.Distribution build() {
io.grafeas.v1.Distribution result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public io.grafeas.v1.Distribution buildPartial() {
io.grafeas.v1.Distribution result = new io.grafeas.v1.Distribution(this);
result.cpeUri_ = cpeUri_;
result.architecture_ = architecture_;
if (latestVersionBuilder_ == null) {
result.latestVersion_ = latestVersion_;
} else {
result.latestVersion_ = latestVersionBuilder_.build();
}
result.maintainer_ = maintainer_;
result.url_ = url_;
result.description_ = description_;
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.Distribution) {
return mergeFrom((io.grafeas.v1.Distribution) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.grafeas.v1.Distribution other) {
if (other == io.grafeas.v1.Distribution.getDefaultInstance()) return this;
if (!other.getCpeUri().isEmpty()) {
cpeUri_ = other.cpeUri_;
onChanged();
}
if (other.architecture_ != 0) {
setArchitectureValue(other.getArchitectureValue());
}
if (other.hasLatestVersion()) {
mergeLatestVersion(other.getLatestVersion());
}
if (!other.getMaintainer().isEmpty()) {
maintainer_ = other.maintainer_;
onChanged();
}
if (!other.getUrl().isEmpty()) {
url_ = other.url_;
onChanged();
}
if (!other.getDescription().isEmpty()) {
description_ = other.description_;
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:
{
cpeUri_ = input.readStringRequireUtf8();
break;
} // case 10
case 16:
{
architecture_ = input.readEnum();
break;
} // case 16
case 26:
{
input.readMessage(getLatestVersionFieldBuilder().getBuilder(), extensionRegistry);
break;
} // case 26
case 34:
{
maintainer_ = input.readStringRequireUtf8();
break;
} // case 34
case 42:
{
url_ = input.readStringRequireUtf8();
break;
} // case 42
case 50:
{
description_ = input.readStringRequireUtf8();
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 java.lang.Object cpeUri_ = "";
/**
*
*
* <pre>
* The cpe_uri in [CPE format](https://cpe.mitre.org/specification/)
* denoting the package manager version distributing a package.
* </pre>
*
* <code>string cpe_uri = 1 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @return The cpeUri.
*/
public java.lang.String getCpeUri() {
java.lang.Object ref = cpeUri_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
cpeUri_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
* <pre>
* The cpe_uri in [CPE format](https://cpe.mitre.org/specification/)
* denoting the package manager version distributing a package.
* </pre>
*
* <code>string cpe_uri = 1 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @return The bytes for cpeUri.
*/
public com.google.protobuf.ByteString getCpeUriBytes() {
java.lang.Object ref = cpeUri_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
cpeUri_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
* <pre>
* The cpe_uri in [CPE format](https://cpe.mitre.org/specification/)
* denoting the package manager version distributing a package.
* </pre>
*
* <code>string cpe_uri = 1 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @param value The cpeUri to set.
* @return This builder for chaining.
*/
public Builder setCpeUri(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
cpeUri_ = value;
onChanged();
return this;
}
/**
*
*
* <pre>
* The cpe_uri in [CPE format](https://cpe.mitre.org/specification/)
* denoting the package manager version distributing a package.
* </pre>
*
* <code>string cpe_uri = 1 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @return This builder for chaining.
*/
public Builder clearCpeUri() {
cpeUri_ = getDefaultInstance().getCpeUri();
onChanged();
return this;
}
/**
*
*
* <pre>
* The cpe_uri in [CPE format](https://cpe.mitre.org/specification/)
* denoting the package manager version distributing a package.
* </pre>
*
* <code>string cpe_uri = 1 [(.google.api.field_behavior) = REQUIRED];</code>
*
* @param value The bytes for cpeUri to set.
* @return This builder for chaining.
*/
public Builder setCpeUriBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
cpeUri_ = value;
onChanged();
return this;
}
private int architecture_ = 0;
/**
*
*
* <pre>
* The CPU architecture for which packages in this distribution channel were
* built.
* </pre>
*
* <code>.grafeas.v1.Architecture architecture = 2;</code>
*
* @return The enum numeric value on the wire for architecture.
*/
@java.lang.Override
public int getArchitectureValue() {
return architecture_;
}
/**
*
*
* <pre>
* The CPU architecture for which packages in this distribution channel were
* built.
* </pre>
*
* <code>.grafeas.v1.Architecture architecture = 2;</code>
*
* @param value The enum numeric value on the wire for architecture to set.
* @return This builder for chaining.
*/
public Builder setArchitectureValue(int value) {
architecture_ = value;
onChanged();
return this;
}
/**
*
*
* <pre>
* The CPU architecture for which packages in this distribution channel were
* built.
* </pre>
*
* <code>.grafeas.v1.Architecture architecture = 2;</code>
*
* @return The architecture.
*/
@java.lang.Override
public io.grafeas.v1.Architecture getArchitecture() {
@SuppressWarnings("deprecation")
io.grafeas.v1.Architecture result = io.grafeas.v1.Architecture.valueOf(architecture_);
return result == null ? io.grafeas.v1.Architecture.UNRECOGNIZED : result;
}
/**
*
*
* <pre>
* The CPU architecture for which packages in this distribution channel were
* built.
* </pre>
*
* <code>.grafeas.v1.Architecture architecture = 2;</code>
*
* @param value The architecture to set.
* @return This builder for chaining.
*/
public Builder setArchitecture(io.grafeas.v1.Architecture value) {
if (value == null) {
throw new NullPointerException();
}
architecture_ = value.getNumber();
onChanged();
return this;
}
/**
*
*
* <pre>
* The CPU architecture for which packages in this distribution channel were
* built.
* </pre>
*
* <code>.grafeas.v1.Architecture architecture = 2;</code>
*
* @return This builder for chaining.
*/
public Builder clearArchitecture() {
architecture_ = 0;
onChanged();
return this;
}
private io.grafeas.v1.Version latestVersion_;
private com.google.protobuf.SingleFieldBuilderV3<
io.grafeas.v1.Version, io.grafeas.v1.Version.Builder, io.grafeas.v1.VersionOrBuilder>
latestVersionBuilder_;
/**
*
*
* <pre>
* The latest available version of this package in this distribution channel.
* </pre>
*
* <code>.grafeas.v1.Version latest_version = 3;</code>
*
* @return Whether the latestVersion field is set.
*/
public boolean hasLatestVersion() {
return latestVersionBuilder_ != null || latestVersion_ != null;
}
/**
*
*
* <pre>
* The latest available version of this package in this distribution channel.
* </pre>
*
* <code>.grafeas.v1.Version latest_version = 3;</code>
*
* @return The latestVersion.
*/
public io.grafeas.v1.Version getLatestVersion() {
if (latestVersionBuilder_ == null) {
return latestVersion_ == null ? io.grafeas.v1.Version.getDefaultInstance() : latestVersion_;
} else {
return latestVersionBuilder_.getMessage();
}
}
/**
*
*
* <pre>
* The latest available version of this package in this distribution channel.
* </pre>
*
* <code>.grafeas.v1.Version latest_version = 3;</code>
*/
public Builder setLatestVersion(io.grafeas.v1.Version value) {
if (latestVersionBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
latestVersion_ = value;
onChanged();
} else {
latestVersionBuilder_.setMessage(value);
}
return this;
}
/**
*
*
* <pre>
* The latest available version of this package in this distribution channel.
* </pre>
*
* <code>.grafeas.v1.Version latest_version = 3;</code>
*/
public Builder setLatestVersion(io.grafeas.v1.Version.Builder builderForValue) {
if (latestVersionBuilder_ == null) {
latestVersion_ = builderForValue.build();
onChanged();
} else {
latestVersionBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
*
* <pre>
* The latest available version of this package in this distribution channel.
* </pre>
*
* <code>.grafeas.v1.Version latest_version = 3;</code>
*/
public Builder mergeLatestVersion(io.grafeas.v1.Version value) {
if (latestVersionBuilder_ == null) {
if (latestVersion_ != null) {
latestVersion_ =
io.grafeas.v1.Version.newBuilder(latestVersion_).mergeFrom(value).buildPartial();
} else {
latestVersion_ = value;
}
onChanged();
} else {
latestVersionBuilder_.mergeFrom(value);
}
return this;
}
/**
*
*
* <pre>
* The latest available version of this package in this distribution channel.
* </pre>
*
* <code>.grafeas.v1.Version latest_version = 3;</code>
*/
public Builder clearLatestVersion() {
if (latestVersionBuilder_ == null) {
latestVersion_ = null;
onChanged();
} else {
latestVersion_ = null;
latestVersionBuilder_ = null;
}
return this;
}
/**
*
*
* <pre>
* The latest available version of this package in this distribution channel.
* </pre>
*
* <code>.grafeas.v1.Version latest_version = 3;</code>
*/
public io.grafeas.v1.Version.Builder getLatestVersionBuilder() {
onChanged();
return getLatestVersionFieldBuilder().getBuilder();
}
/**
*
*
* <pre>
* The latest available version of this package in this distribution channel.
* </pre>
*
* <code>.grafeas.v1.Version latest_version = 3;</code>
*/
public io.grafeas.v1.VersionOrBuilder getLatestVersionOrBuilder() {
if (latestVersionBuilder_ != null) {
return latestVersionBuilder_.getMessageOrBuilder();
} else {
return latestVersion_ == null ? io.grafeas.v1.Version.getDefaultInstance() : latestVersion_;
}
}
/**
*
*
* <pre>
* The latest available version of this package in this distribution channel.
* </pre>
*
* <code>.grafeas.v1.Version latest_version = 3;</code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
io.grafeas.v1.Version, io.grafeas.v1.Version.Builder, io.grafeas.v1.VersionOrBuilder>
getLatestVersionFieldBuilder() {
if (latestVersionBuilder_ == null) {
latestVersionBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
io.grafeas.v1.Version,
io.grafeas.v1.Version.Builder,
io.grafeas.v1.VersionOrBuilder>(
getLatestVersion(), getParentForChildren(), isClean());
latestVersion_ = null;
}
return latestVersionBuilder_;
}
private java.lang.Object maintainer_ = "";
/**
*
*
* <pre>
* A freeform string denoting the maintainer of this package.
* </pre>
*
* <code>string maintainer = 4;</code>
*
* @return The maintainer.
*/
public java.lang.String getMaintainer() {
java.lang.Object ref = maintainer_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
maintainer_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
* <pre>
* A freeform string denoting the maintainer of this package.
* </pre>
*
* <code>string maintainer = 4;</code>
*
* @return The bytes for maintainer.
*/
public com.google.protobuf.ByteString getMaintainerBytes() {
java.lang.Object ref = maintainer_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
maintainer_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
* <pre>
* A freeform string denoting the maintainer of this package.
* </pre>
*
* <code>string maintainer = 4;</code>
*
* @param value The maintainer to set.
* @return This builder for chaining.
*/
public Builder setMaintainer(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
maintainer_ = value;
onChanged();
return this;
}
/**
*
*
* <pre>
* A freeform string denoting the maintainer of this package.
* </pre>
*
* <code>string maintainer = 4;</code>
*
* @return This builder for chaining.
*/
public Builder clearMaintainer() {
maintainer_ = getDefaultInstance().getMaintainer();
onChanged();
return this;
}
/**
*
*
* <pre>
* A freeform string denoting the maintainer of this package.
* </pre>
*
* <code>string maintainer = 4;</code>
*
* @param value The bytes for maintainer to set.
* @return This builder for chaining.
*/
public Builder setMaintainerBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
maintainer_ = value;
onChanged();
return this;
}
private java.lang.Object url_ = "";
/**
*
*
* <pre>
* The distribution channel-specific homepage for this package.
* </pre>
*
* <code>string url = 5;</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>
* The distribution channel-specific homepage for this package.
* </pre>
*
* <code>string url = 5;</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>
* The distribution channel-specific homepage for this package.
* </pre>
*
* <code>string url = 5;</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;
onChanged();
return this;
}
/**
*
*
* <pre>
* The distribution channel-specific homepage for this package.
* </pre>
*
* <code>string url = 5;</code>
*
* @return This builder for chaining.
*/
public Builder clearUrl() {
url_ = getDefaultInstance().getUrl();
onChanged();
return this;
}
/**
*
*
* <pre>
* The distribution channel-specific homepage for this package.
* </pre>
*
* <code>string url = 5;</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;
onChanged();
return this;
}
private java.lang.Object description_ = "";
/**
*
*
* <pre>
* The distribution channel-specific description of this package.
* </pre>
*
* <code>string description = 6;</code>
*
* @return The description.
*/
public java.lang.String getDescription() {
java.lang.Object ref = description_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
description_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
* <pre>
* The distribution channel-specific description of this package.
* </pre>
*
* <code>string description = 6;</code>
*
* @return The bytes for description.
*/
public com.google.protobuf.ByteString getDescriptionBytes() {
java.lang.Object ref = description_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
description_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
* <pre>
* The distribution channel-specific description of this package.
* </pre>
*
* <code>string description = 6;</code>
*
* @param value The description to set.
* @return This builder for chaining.
*/
public Builder setDescription(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
description_ = value;
onChanged();
return this;
}
/**
*
*
* <pre>
* The distribution channel-specific description of this package.
* </pre>
*
* <code>string description = 6;</code>
*
* @return This builder for chaining.
*/
public Builder clearDescription() {
description_ = getDefaultInstance().getDescription();
onChanged();
return this;
}
/**
*
*
* <pre>
* The distribution channel-specific description of this package.
* </pre>
*
* <code>string description = 6;</code>
*
* @param value The bytes for description to set.
* @return This builder for chaining.
*/
public Builder setDescriptionBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
description_ = value;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:grafeas.v1.Distribution)
}
// @@protoc_insertion_point(class_scope:grafeas.v1.Distribution)
private static final io.grafeas.v1.Distribution DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.grafeas.v1.Distribution();
}
public static io.grafeas.v1.Distribution getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<Distribution> PARSER =
new com.google.protobuf.AbstractParser<Distribution>() {
@java.lang.Override
public Distribution 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<Distribution> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<Distribution> getParserForType() {
return PARSER;
}
@java.lang.Override
public io.grafeas.v1.Distribution getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}