Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: xds/core/v3/resource.proto
package com.github.xds.core.v3;
/**
*
* xDS resource wrapper. This encapsulates a xDS resource when appearing in an
* xDS transport discovery response or when accessed as a filesystem object.
*
*
* Protobuf type {@code xds.core.v3.Resource}
*/
public final class Resource extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:xds.core.v3.Resource)
ResourceOrBuilder {
private static final long serialVersionUID = 0L;
// Use Resource.newBuilder() to construct.
private Resource(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private Resource() {
version_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new Resource();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private Resource(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
com.github.xds.core.v3.ResourceName.Builder subBuilder = null;
if (name_ != null) {
subBuilder = name_.toBuilder();
}
name_ = input.readMessage(com.github.xds.core.v3.ResourceName.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(name_);
name_ = subBuilder.buildPartial();
}
break;
}
case 18: {
java.lang.String s = input.readStringRequireUtf8();
version_ = s;
break;
}
case 26: {
com.google.protobuf.Any.Builder subBuilder = null;
if (resource_ != null) {
subBuilder = resource_.toBuilder();
}
resource_ = input.readMessage(com.google.protobuf.Any.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(resource_);
resource_ = subBuilder.buildPartial();
}
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.github.xds.core.v3.ResourceProto.internal_static_xds_core_v3_Resource_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.github.xds.core.v3.ResourceProto.internal_static_xds_core_v3_Resource_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.github.xds.core.v3.Resource.class, com.github.xds.core.v3.Resource.Builder.class);
}
public static final int NAME_FIELD_NUMBER = 1;
private com.github.xds.core.v3.ResourceName name_;
/**
*
* Resource name. This may be omitted for filesystem resources.
*
*
* .xds.core.v3.ResourceName name = 1;
* @return Whether the name field is set.
*/
@java.lang.Override
public boolean hasName() {
return name_ != null;
}
/**
*
* Resource name. This may be omitted for filesystem resources.
*
*
* .xds.core.v3.ResourceName name = 1;
* @return The name.
*/
@java.lang.Override
public com.github.xds.core.v3.ResourceName getName() {
return name_ == null ? com.github.xds.core.v3.ResourceName.getDefaultInstance() : name_;
}
/**
*
* Resource name. This may be omitted for filesystem resources.
*
*
* .xds.core.v3.ResourceName name = 1;
*/
@java.lang.Override
public com.github.xds.core.v3.ResourceNameOrBuilder getNameOrBuilder() {
return getName();
}
public static final int VERSION_FIELD_NUMBER = 2;
private volatile java.lang.Object version_;
/**
*
* The resource's logical version. It is illegal to have the same named xDS
* resource name at a given version with different resource payloads.
*
*
* string version = 2;
* @return The version.
*/
@java.lang.Override
public java.lang.String getVersion() {
java.lang.Object ref = version_;
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();
version_ = s;
return s;
}
}
/**
*
* The resource's logical version. It is illegal to have the same named xDS
* resource name at a given version with different resource payloads.
*
*
* string version = 2;
* @return The bytes for version.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getVersionBytes() {
java.lang.Object ref = version_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
version_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int RESOURCE_FIELD_NUMBER = 3;
private com.google.protobuf.Any resource_;
/**
*
* The resource payload, including type URL.
*
*
* .google.protobuf.Any resource = 3;
* @return Whether the resource field is set.
*/
@java.lang.Override
public boolean hasResource() {
return resource_ != null;
}
/**
*
*
* .google.protobuf.Any resource = 3;
*/
@java.lang.Override
public com.google.protobuf.AnyOrBuilder getResourceOrBuilder() {
return getResource();
}
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 (name_ != null) {
output.writeMessage(1, getName());
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(version_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, version_);
}
if (resource_ != null) {
output.writeMessage(3, getResource());
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (name_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, getName());
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(version_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, version_);
}
if (resource_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(3, getResource());
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.github.xds.core.v3.Resource)) {
return super.equals(obj);
}
com.github.xds.core.v3.Resource other = (com.github.xds.core.v3.Resource) obj;
if (hasName() != other.hasName()) return false;
if (hasName()) {
if (!getName()
.equals(other.getName())) return false;
}
if (!getVersion()
.equals(other.getVersion())) return false;
if (hasResource() != other.hasResource()) return false;
if (hasResource()) {
if (!getResource()
.equals(other.getResource())) return false;
}
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasName()) {
hash = (37 * hash) + NAME_FIELD_NUMBER;
hash = (53 * hash) + getName().hashCode();
}
hash = (37 * hash) + VERSION_FIELD_NUMBER;
hash = (53 * hash) + getVersion().hashCode();
if (hasResource()) {
hash = (37 * hash) + RESOURCE_FIELD_NUMBER;
hash = (53 * hash) + getResource().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.github.xds.core.v3.Resource parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.github.xds.core.v3.Resource parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.github.xds.core.v3.Resource parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.github.xds.core.v3.Resource parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.github.xds.core.v3.Resource parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.github.xds.core.v3.Resource parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.github.xds.core.v3.Resource parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.github.xds.core.v3.Resource 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 com.github.xds.core.v3.Resource parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.github.xds.core.v3.Resource 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 com.github.xds.core.v3.Resource parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.github.xds.core.v3.Resource 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(com.github.xds.core.v3.Resource 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;
}
/**
*
* xDS resource wrapper. This encapsulates a xDS resource when appearing in an
* xDS transport discovery response or when accessed as a filesystem object.
*
*
* Protobuf type {@code xds.core.v3.Resource}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:xds.core.v3.Resource)
com.github.xds.core.v3.ResourceOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.github.xds.core.v3.ResourceProto.internal_static_xds_core_v3_Resource_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.github.xds.core.v3.ResourceProto.internal_static_xds_core_v3_Resource_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.github.xds.core.v3.Resource.class, com.github.xds.core.v3.Resource.Builder.class);
}
// Construct using com.github.xds.core.v3.Resource.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
if (nameBuilder_ == null) {
name_ = null;
} else {
name_ = null;
nameBuilder_ = null;
}
version_ = "";
if (resourceBuilder_ == null) {
resource_ = null;
} else {
resource_ = null;
resourceBuilder_ = null;
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.github.xds.core.v3.ResourceProto.internal_static_xds_core_v3_Resource_descriptor;
}
@java.lang.Override
public com.github.xds.core.v3.Resource getDefaultInstanceForType() {
return com.github.xds.core.v3.Resource.getDefaultInstance();
}
@java.lang.Override
public com.github.xds.core.v3.Resource build() {
com.github.xds.core.v3.Resource result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.github.xds.core.v3.Resource buildPartial() {
com.github.xds.core.v3.Resource result = new com.github.xds.core.v3.Resource(this);
if (nameBuilder_ == null) {
result.name_ = name_;
} else {
result.name_ = nameBuilder_.build();
}
result.version_ = version_;
if (resourceBuilder_ == null) {
result.resource_ = resource_;
} else {
result.resource_ = resourceBuilder_.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 com.github.xds.core.v3.Resource) {
return mergeFrom((com.github.xds.core.v3.Resource)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.github.xds.core.v3.Resource other) {
if (other == com.github.xds.core.v3.Resource.getDefaultInstance()) return this;
if (other.hasName()) {
mergeName(other.getName());
}
if (!other.getVersion().isEmpty()) {
version_ = other.version_;
onChanged();
}
if (other.hasResource()) {
mergeResource(other.getResource());
}
this.mergeUnknownFields(other.unknownFields);
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 {
com.github.xds.core.v3.Resource parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.github.xds.core.v3.Resource) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private com.github.xds.core.v3.ResourceName name_;
private com.google.protobuf.SingleFieldBuilderV3<
com.github.xds.core.v3.ResourceName, com.github.xds.core.v3.ResourceName.Builder, com.github.xds.core.v3.ResourceNameOrBuilder> nameBuilder_;
/**
*
* Resource name. This may be omitted for filesystem resources.
*
*
* .xds.core.v3.ResourceName name = 1;
* @return Whether the name field is set.
*/
public boolean hasName() {
return nameBuilder_ != null || name_ != null;
}
/**
*
* Resource name. This may be omitted for filesystem resources.
*
*
* .xds.core.v3.ResourceName name = 1;
* @return The name.
*/
public com.github.xds.core.v3.ResourceName getName() {
if (nameBuilder_ == null) {
return name_ == null ? com.github.xds.core.v3.ResourceName.getDefaultInstance() : name_;
} else {
return nameBuilder_.getMessage();
}
}
/**
*
* Resource name. This may be omitted for filesystem resources.
*
*
* .xds.core.v3.ResourceName name = 1;
*/
public Builder setName(com.github.xds.core.v3.ResourceName value) {
if (nameBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
name_ = value;
onChanged();
} else {
nameBuilder_.setMessage(value);
}
return this;
}
/**
*
* Resource name. This may be omitted for filesystem resources.
*
* The resource's logical version. It is illegal to have the same named xDS
* resource name at a given version with different resource payloads.
*
*
* string version = 2;
* @return The version.
*/
public java.lang.String getVersion() {
java.lang.Object ref = version_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
version_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* The resource's logical version. It is illegal to have the same named xDS
* resource name at a given version with different resource payloads.
*
*
* string version = 2;
* @return The bytes for version.
*/
public com.google.protobuf.ByteString
getVersionBytes() {
java.lang.Object ref = version_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
version_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* The resource's logical version. It is illegal to have the same named xDS
* resource name at a given version with different resource payloads.
*
*
* string version = 2;
* @param value The version to set.
* @return This builder for chaining.
*/
public Builder setVersion(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
version_ = value;
onChanged();
return this;
}
/**
*
* The resource's logical version. It is illegal to have the same named xDS
* resource name at a given version with different resource payloads.
*
*
* string version = 2;
* @return This builder for chaining.
*/
public Builder clearVersion() {
version_ = getDefaultInstance().getVersion();
onChanged();
return this;
}
/**
*
* The resource's logical version. It is illegal to have the same named xDS
* resource name at a given version with different resource payloads.
*
*
* string version = 2;
* @param value The bytes for version to set.
* @return This builder for chaining.
*/
public Builder setVersionBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
version_ = value;
onChanged();
return this;
}
private com.google.protobuf.Any resource_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> resourceBuilder_;
/**
*
* The resource payload, including type URL.
*
*
* .google.protobuf.Any resource = 3;
* @return Whether the resource field is set.
*/
public boolean hasResource() {
return resourceBuilder_ != null || resource_ != null;
}
/**
*