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: opencensus/proto/resource/v1/resource.proto
package io.opencensus.proto.resource.v1;
/**
*
* Resource information.
*
*
* Protobuf type {@code opencensus.proto.resource.v1.Resource}
*/
public final class Resource extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:opencensus.proto.resource.v1.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() {
type_ = "";
}
@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();
}
int mutable_bitField0_ = 0;
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: {
java.lang.String s = input.readStringRequireUtf8();
type_ = s;
break;
}
case 18: {
if (!((mutable_bitField0_ & 0x00000001) != 0)) {
labels_ = com.google.protobuf.MapField.newMapField(
LabelsDefaultEntryHolder.defaultEntry);
mutable_bitField0_ |= 0x00000001;
}
com.google.protobuf.MapEntry
labels__ = input.readMessage(
LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
labels_.getMutableMap().put(
labels__.getKey(), labels__.getValue());
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 io.opencensus.proto.resource.v1.ResourceProto.internal_static_opencensus_proto_resource_v1_Resource_descriptor;
}
@SuppressWarnings({"rawtypes"})
@java.lang.Override
protected com.google.protobuf.MapField internalGetMapField(
int number) {
switch (number) {
case 2:
return internalGetLabels();
default:
throw new RuntimeException(
"Invalid map field number: " + number);
}
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.opencensus.proto.resource.v1.ResourceProto.internal_static_opencensus_proto_resource_v1_Resource_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.opencensus.proto.resource.v1.Resource.class, io.opencensus.proto.resource.v1.Resource.Builder.class);
}
public static final int TYPE_FIELD_NUMBER = 1;
private volatile java.lang.Object type_;
/**
*
* Type identifier for the resource.
*
*
* string type = 1;
* @return The type.
*/
@java.lang.Override
public java.lang.String getType() {
java.lang.Object ref = type_;
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();
type_ = s;
return s;
}
}
/**
*
* Type identifier for the resource.
*
*
* string type = 1;
* @return The bytes for type.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getTypeBytes() {
java.lang.Object ref = type_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
type_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int LABELS_FIELD_NUMBER = 2;
private static final class LabelsDefaultEntryHolder {
static final com.google.protobuf.MapEntry<
java.lang.String, java.lang.String> defaultEntry =
com.google.protobuf.MapEntry
.newDefaultInstance(
io.opencensus.proto.resource.v1.ResourceProto.internal_static_opencensus_proto_resource_v1_Resource_LabelsEntry_descriptor,
com.google.protobuf.WireFormat.FieldType.STRING,
"",
com.google.protobuf.WireFormat.FieldType.STRING,
"");
}
private com.google.protobuf.MapField<
java.lang.String, java.lang.String> labels_;
private com.google.protobuf.MapField
internalGetLabels() {
if (labels_ == null) {
return com.google.protobuf.MapField.emptyMapField(
LabelsDefaultEntryHolder.defaultEntry);
}
return labels_;
}
public int getLabelsCount() {
return internalGetLabels().getMap().size();
}
/**
*
* Set of labels that describe the resource.
*
*
* map<string, string> labels = 2;
*/
@java.lang.Override
public boolean containsLabels(
java.lang.String key) {
if (key == null) { throw new NullPointerException("map key"); }
return internalGetLabels().getMap().containsKey(key);
}
/**
* Use {@link #getLabelsMap()} instead.
*/
@java.lang.Override
@java.lang.Deprecated
public java.util.Map getLabels() {
return getLabelsMap();
}
/**
*
*
* Protobuf type {@code opencensus.proto.resource.v1.Resource}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:opencensus.proto.resource.v1.Resource)
io.opencensus.proto.resource.v1.ResourceOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.opencensus.proto.resource.v1.ResourceProto.internal_static_opencensus_proto_resource_v1_Resource_descriptor;
}
@SuppressWarnings({"rawtypes"})
protected com.google.protobuf.MapField internalGetMapField(
int number) {
switch (number) {
case 2:
return internalGetLabels();
default:
throw new RuntimeException(
"Invalid map field number: " + number);
}
}
@SuppressWarnings({"rawtypes"})
protected com.google.protobuf.MapField internalGetMutableMapField(
int number) {
switch (number) {
case 2:
return internalGetMutableLabels();
default:
throw new RuntimeException(
"Invalid map field number: " + number);
}
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.opencensus.proto.resource.v1.ResourceProto.internal_static_opencensus_proto_resource_v1_Resource_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.opencensus.proto.resource.v1.Resource.class, io.opencensus.proto.resource.v1.Resource.Builder.class);
}
// Construct using io.opencensus.proto.resource.v1.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();
type_ = "";
internalGetMutableLabels().clear();
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.opencensus.proto.resource.v1.ResourceProto.internal_static_opencensus_proto_resource_v1_Resource_descriptor;
}
@java.lang.Override
public io.opencensus.proto.resource.v1.Resource getDefaultInstanceForType() {
return io.opencensus.proto.resource.v1.Resource.getDefaultInstance();
}
@java.lang.Override
public io.opencensus.proto.resource.v1.Resource build() {
io.opencensus.proto.resource.v1.Resource result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public io.opencensus.proto.resource.v1.Resource buildPartial() {
io.opencensus.proto.resource.v1.Resource result = new io.opencensus.proto.resource.v1.Resource(this);
int from_bitField0_ = bitField0_;
result.type_ = type_;
result.labels_ = internalGetLabels();
result.labels_.makeImmutable();
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.opencensus.proto.resource.v1.Resource) {
return mergeFrom((io.opencensus.proto.resource.v1.Resource)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.opencensus.proto.resource.v1.Resource other) {
if (other == io.opencensus.proto.resource.v1.Resource.getDefaultInstance()) return this;
if (!other.getType().isEmpty()) {
type_ = other.type_;
onChanged();
}
internalGetMutableLabels().mergeFrom(
other.internalGetLabels());
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 {
io.opencensus.proto.resource.v1.Resource parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (io.opencensus.proto.resource.v1.Resource) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private java.lang.Object type_ = "";
/**
*
* Type identifier for the resource.
*
*
* string type = 1;
* @return The type.
*/
public java.lang.String getType() {
java.lang.Object ref = type_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
type_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* Type identifier for the resource.
*
*
* string type = 1;
* @return The bytes for type.
*/
public com.google.protobuf.ByteString
getTypeBytes() {
java.lang.Object ref = type_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
type_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* Type identifier for the resource.
*
*
* string type = 1;
* @param value The type to set.
* @return This builder for chaining.
*/
public Builder setType(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
type_ = value;
onChanged();
return this;
}
/**
*
* Type identifier for the resource.
*
*
* string type = 1;
* @return This builder for chaining.
*/
public Builder clearType() {
type_ = getDefaultInstance().getType();
onChanged();
return this;
}
/**
*
* Type identifier for the resource.
*
*
* string type = 1;
* @param value The bytes for type to set.
* @return This builder for chaining.
*/
public Builder setTypeBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
type_ = value;
onChanged();
return this;
}
private com.google.protobuf.MapField<
java.lang.String, java.lang.String> labels_;
private com.google.protobuf.MapField
internalGetLabels() {
if (labels_ == null) {
return com.google.protobuf.MapField.emptyMapField(
LabelsDefaultEntryHolder.defaultEntry);
}
return labels_;
}
private com.google.protobuf.MapField
internalGetMutableLabels() {
onChanged();;
if (labels_ == null) {
labels_ = com.google.protobuf.MapField.newMapField(
LabelsDefaultEntryHolder.defaultEntry);
}
if (!labels_.isMutable()) {
labels_ = labels_.copy();
}
return labels_;
}
public int getLabelsCount() {
return internalGetLabels().getMap().size();
}
/**
*
* Set of labels that describe the resource.
*
*
* map<string, string> labels = 2;
*/
@java.lang.Override
public boolean containsLabels(
java.lang.String key) {
if (key == null) { throw new NullPointerException("map key"); }
return internalGetLabels().getMap().containsKey(key);
}
/**
* Use {@link #getLabelsMap()} instead.
*/
@java.lang.Override
@java.lang.Deprecated
public java.util.Map getLabels() {
return getLabelsMap();
}
/**
*