/* * 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/provenance.proto package io.grafeas.v1; /** * * *
* A unique identifier for a Cloud Repo. ** * Protobuf type {@code grafeas.v1.RepoId} */ public final class RepoId extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:grafeas.v1.RepoId) RepoIdOrBuilder { private static final long serialVersionUID = 0L; // Use RepoId.newBuilder() to construct. private RepoId(com.google.protobuf.GeneratedMessageV3.Builder> builder) { super(builder); } private RepoId() {} @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new RepoId(); } @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.Provenance.internal_static_grafeas_v1_RepoId_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return io.grafeas.v1.Provenance.internal_static_grafeas_v1_RepoId_fieldAccessorTable .ensureFieldAccessorsInitialized( io.grafeas.v1.RepoId.class, io.grafeas.v1.RepoId.Builder.class); } private int idCase_ = 0; private java.lang.Object id_; public enum IdCase implements com.google.protobuf.Internal.EnumLite, com.google.protobuf.AbstractMessage.InternalOneOfEnum { PROJECT_REPO_ID(1), UID(2), ID_NOT_SET(0); private final int value; private IdCase(int value) { this.value = value; } /** * @param value The number of the enum to look for. * @return The enum associated with the given number. * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated public static IdCase valueOf(int value) { return forNumber(value); } public static IdCase forNumber(int value) { switch (value) { case 1: return PROJECT_REPO_ID; case 2: return UID; case 0: return ID_NOT_SET; default: return null; } } public int getNumber() { return this.value; } }; public IdCase getIdCase() { return IdCase.forNumber(idCase_); } public static final int PROJECT_REPO_ID_FIELD_NUMBER = 1; /** * * *
* A combination of a project ID and a repo name. ** *
.grafeas.v1.ProjectRepoId project_repo_id = 1;
*
* @return Whether the projectRepoId field is set.
*/
@java.lang.Override
public boolean hasProjectRepoId() {
return idCase_ == 1;
}
/**
*
*
* * A combination of a project ID and a repo name. ** *
.grafeas.v1.ProjectRepoId project_repo_id = 1;
*
* @return The projectRepoId.
*/
@java.lang.Override
public io.grafeas.v1.ProjectRepoId getProjectRepoId() {
if (idCase_ == 1) {
return (io.grafeas.v1.ProjectRepoId) id_;
}
return io.grafeas.v1.ProjectRepoId.getDefaultInstance();
}
/**
*
*
* * A combination of a project ID and a repo name. ** *
.grafeas.v1.ProjectRepoId project_repo_id = 1;
*/
@java.lang.Override
public io.grafeas.v1.ProjectRepoIdOrBuilder getProjectRepoIdOrBuilder() {
if (idCase_ == 1) {
return (io.grafeas.v1.ProjectRepoId) id_;
}
return io.grafeas.v1.ProjectRepoId.getDefaultInstance();
}
public static final int UID_FIELD_NUMBER = 2;
/**
*
*
* * A server-assigned, globally unique identifier. ** *
string uid = 2;
*
* @return Whether the uid field is set.
*/
public boolean hasUid() {
return idCase_ == 2;
}
/**
*
*
* * A server-assigned, globally unique identifier. ** *
string uid = 2;
*
* @return The uid.
*/
public java.lang.String getUid() {
java.lang.Object ref = "";
if (idCase_ == 2) {
ref = id_;
}
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();
if (idCase_ == 2) {
id_ = s;
}
return s;
}
}
/**
*
*
* * A server-assigned, globally unique identifier. ** *
string uid = 2;
*
* @return The bytes for uid.
*/
public com.google.protobuf.ByteString getUidBytes() {
java.lang.Object ref = "";
if (idCase_ == 2) {
ref = id_;
}
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
if (idCase_ == 2) {
id_ = 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 (idCase_ == 1) {
output.writeMessage(1, (io.grafeas.v1.ProjectRepoId) id_);
}
if (idCase_ == 2) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, id_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (idCase_ == 1) {
size +=
com.google.protobuf.CodedOutputStream.computeMessageSize(
1, (io.grafeas.v1.ProjectRepoId) id_);
}
if (idCase_ == 2) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, id_);
}
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.RepoId)) {
return super.equals(obj);
}
io.grafeas.v1.RepoId other = (io.grafeas.v1.RepoId) obj;
if (!getIdCase().equals(other.getIdCase())) return false;
switch (idCase_) {
case 1:
if (!getProjectRepoId().equals(other.getProjectRepoId())) return false;
break;
case 2:
if (!getUid().equals(other.getUid())) return false;
break;
case 0:
default:
}
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
switch (idCase_) {
case 1:
hash = (37 * hash) + PROJECT_REPO_ID_FIELD_NUMBER;
hash = (53 * hash) + getProjectRepoId().hashCode();
break;
case 2:
hash = (37 * hash) + UID_FIELD_NUMBER;
hash = (53 * hash) + getUid().hashCode();
break;
case 0:
default:
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static io.grafeas.v1.RepoId parseFrom(java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grafeas.v1.RepoId 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.RepoId parseFrom(com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grafeas.v1.RepoId 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.RepoId parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grafeas.v1.RepoId parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grafeas.v1.RepoId parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static io.grafeas.v1.RepoId 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.RepoId parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static io.grafeas.v1.RepoId 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.RepoId parseFrom(com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static io.grafeas.v1.RepoId 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.RepoId 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;
}
/**
*
*
* * A unique identifier for a Cloud Repo. ** * Protobuf type {@code grafeas.v1.RepoId} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
* A combination of a project ID and a repo name.
*
*
* .grafeas.v1.ProjectRepoId project_repo_id = 1;
*
* @return Whether the projectRepoId field is set.
*/
@java.lang.Override
public boolean hasProjectRepoId() {
return idCase_ == 1;
}
/**
*
*
*
* A combination of a project ID and a repo name.
*
*
* .grafeas.v1.ProjectRepoId project_repo_id = 1;
*
* @return The projectRepoId.
*/
@java.lang.Override
public io.grafeas.v1.ProjectRepoId getProjectRepoId() {
if (projectRepoIdBuilder_ == null) {
if (idCase_ == 1) {
return (io.grafeas.v1.ProjectRepoId) id_;
}
return io.grafeas.v1.ProjectRepoId.getDefaultInstance();
} else {
if (idCase_ == 1) {
return projectRepoIdBuilder_.getMessage();
}
return io.grafeas.v1.ProjectRepoId.getDefaultInstance();
}
}
/**
*
*
*
* A combination of a project ID and a repo name.
*
*
* .grafeas.v1.ProjectRepoId project_repo_id = 1;
*/
public Builder setProjectRepoId(io.grafeas.v1.ProjectRepoId value) {
if (projectRepoIdBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
id_ = value;
onChanged();
} else {
projectRepoIdBuilder_.setMessage(value);
}
idCase_ = 1;
return this;
}
/**
*
*
*
* A combination of a project ID and a repo name.
*
*
* .grafeas.v1.ProjectRepoId project_repo_id = 1;
*/
public Builder setProjectRepoId(io.grafeas.v1.ProjectRepoId.Builder builderForValue) {
if (projectRepoIdBuilder_ == null) {
id_ = builderForValue.build();
onChanged();
} else {
projectRepoIdBuilder_.setMessage(builderForValue.build());
}
idCase_ = 1;
return this;
}
/**
*
*
*
* A combination of a project ID and a repo name.
*
*
* .grafeas.v1.ProjectRepoId project_repo_id = 1;
*/
public Builder mergeProjectRepoId(io.grafeas.v1.ProjectRepoId value) {
if (projectRepoIdBuilder_ == null) {
if (idCase_ == 1 && id_ != io.grafeas.v1.ProjectRepoId.getDefaultInstance()) {
id_ =
io.grafeas.v1.ProjectRepoId.newBuilder((io.grafeas.v1.ProjectRepoId) id_)
.mergeFrom(value)
.buildPartial();
} else {
id_ = value;
}
onChanged();
} else {
if (idCase_ == 1) {
projectRepoIdBuilder_.mergeFrom(value);
} else {
projectRepoIdBuilder_.setMessage(value);
}
}
idCase_ = 1;
return this;
}
/**
*
*
*
* A combination of a project ID and a repo name.
*
*
* .grafeas.v1.ProjectRepoId project_repo_id = 1;
*/
public Builder clearProjectRepoId() {
if (projectRepoIdBuilder_ == null) {
if (idCase_ == 1) {
idCase_ = 0;
id_ = null;
onChanged();
}
} else {
if (idCase_ == 1) {
idCase_ = 0;
id_ = null;
}
projectRepoIdBuilder_.clear();
}
return this;
}
/**
*
*
*
* A combination of a project ID and a repo name.
*
*
* .grafeas.v1.ProjectRepoId project_repo_id = 1;
*/
public io.grafeas.v1.ProjectRepoId.Builder getProjectRepoIdBuilder() {
return getProjectRepoIdFieldBuilder().getBuilder();
}
/**
*
*
*
* A combination of a project ID and a repo name.
*
*
* .grafeas.v1.ProjectRepoId project_repo_id = 1;
*/
@java.lang.Override
public io.grafeas.v1.ProjectRepoIdOrBuilder getProjectRepoIdOrBuilder() {
if ((idCase_ == 1) && (projectRepoIdBuilder_ != null)) {
return projectRepoIdBuilder_.getMessageOrBuilder();
} else {
if (idCase_ == 1) {
return (io.grafeas.v1.ProjectRepoId) id_;
}
return io.grafeas.v1.ProjectRepoId.getDefaultInstance();
}
}
/**
*
*
*
* A combination of a project ID and a repo name.
*
*
* .grafeas.v1.ProjectRepoId project_repo_id = 1;
*/
private com.google.protobuf.SingleFieldBuilderV3<
io.grafeas.v1.ProjectRepoId,
io.grafeas.v1.ProjectRepoId.Builder,
io.grafeas.v1.ProjectRepoIdOrBuilder>
getProjectRepoIdFieldBuilder() {
if (projectRepoIdBuilder_ == null) {
if (!(idCase_ == 1)) {
id_ = io.grafeas.v1.ProjectRepoId.getDefaultInstance();
}
projectRepoIdBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
io.grafeas.v1.ProjectRepoId,
io.grafeas.v1.ProjectRepoId.Builder,
io.grafeas.v1.ProjectRepoIdOrBuilder>(
(io.grafeas.v1.ProjectRepoId) id_, getParentForChildren(), isClean());
id_ = null;
}
idCase_ = 1;
onChanged();
return projectRepoIdBuilder_;
}
/**
*
*
*
* A server-assigned, globally unique identifier.
*
*
* string uid = 2;
*
* @return Whether the uid field is set.
*/
@java.lang.Override
public boolean hasUid() {
return idCase_ == 2;
}
/**
*
*
*
* A server-assigned, globally unique identifier.
*
*
* string uid = 2;
*
* @return The uid.
*/
@java.lang.Override
public java.lang.String getUid() {
java.lang.Object ref = "";
if (idCase_ == 2) {
ref = id_;
}
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (idCase_ == 2) {
id_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* A server-assigned, globally unique identifier.
*
*
* string uid = 2;
*
* @return The bytes for uid.
*/
@java.lang.Override
public com.google.protobuf.ByteString getUidBytes() {
java.lang.Object ref = "";
if (idCase_ == 2) {
ref = id_;
}
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
if (idCase_ == 2) {
id_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* A server-assigned, globally unique identifier.
*
*
* string uid = 2;
*
* @param value The uid to set.
* @return This builder for chaining.
*/
public Builder setUid(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
idCase_ = 2;
id_ = value;
onChanged();
return this;
}
/**
*
*
*
* A server-assigned, globally unique identifier.
*
*
* string uid = 2;
*
* @return This builder for chaining.
*/
public Builder clearUid() {
if (idCase_ == 2) {
idCase_ = 0;
id_ = null;
onChanged();
}
return this;
}
/**
*
*
*
* A server-assigned, globally unique identifier.
*
*
* string uid = 2;
*
* @param value The bytes for uid to set.
* @return This builder for chaining.
*/
public Builder setUidBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
idCase_ = 2;
id_ = 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.RepoId)
}
// @@protoc_insertion_point(class_scope:grafeas.v1.RepoId)
private static final io.grafeas.v1.RepoId DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.grafeas.v1.RepoId();
}
public static io.grafeas.v1.RepoId getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser