Please wait. This can take some minutes ...
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.
io.opencensus.proto.metrics.v1.Metric Maven / Gradle / Ivy
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: opencensus/proto/metrics/v1/metrics.proto
package io.opencensus.proto.metrics.v1;
/**
*
* Defines a Metric which has one or more timeseries.
*
*
* Protobuf type {@code opencensus.proto.metrics.v1.Metric}
*/
public final class Metric extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:opencensus.proto.metrics.v1.Metric)
MetricOrBuilder {
private static final long serialVersionUID = 0L;
// Use Metric.newBuilder() to construct.
private Metric(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private Metric() {
timeseries_ = java.util.Collections.emptyList();
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new Metric();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private Metric(
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: {
io.opencensus.proto.metrics.v1.MetricDescriptor.Builder subBuilder = null;
if (metricDescriptor_ != null) {
subBuilder = metricDescriptor_.toBuilder();
}
metricDescriptor_ = input.readMessage(io.opencensus.proto.metrics.v1.MetricDescriptor.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(metricDescriptor_);
metricDescriptor_ = subBuilder.buildPartial();
}
break;
}
case 18: {
if (!((mutable_bitField0_ & 0x00000001) != 0)) {
timeseries_ = new java.util.ArrayList();
mutable_bitField0_ |= 0x00000001;
}
timeseries_.add(
input.readMessage(io.opencensus.proto.metrics.v1.TimeSeries.parser(), extensionRegistry));
break;
}
case 26: {
io.opencensus.proto.resource.v1.Resource.Builder subBuilder = null;
if (resource_ != null) {
subBuilder = resource_.toBuilder();
}
resource_ = input.readMessage(io.opencensus.proto.resource.v1.Resource.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 {
if (((mutable_bitField0_ & 0x00000001) != 0)) {
timeseries_ = java.util.Collections.unmodifiableList(timeseries_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.opencensus.proto.metrics.v1.MetricsProto.internal_static_opencensus_proto_metrics_v1_Metric_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.opencensus.proto.metrics.v1.MetricsProto.internal_static_opencensus_proto_metrics_v1_Metric_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.opencensus.proto.metrics.v1.Metric.class, io.opencensus.proto.metrics.v1.Metric.Builder.class);
}
public static final int METRIC_DESCRIPTOR_FIELD_NUMBER = 1;
private io.opencensus.proto.metrics.v1.MetricDescriptor metricDescriptor_;
/**
*
* The descriptor of the Metric.
* TODO(issue #152): consider only sending the name of descriptor for
* optimization.
*
*
* .opencensus.proto.metrics.v1.MetricDescriptor metric_descriptor = 1;
* @return Whether the metricDescriptor field is set.
*/
@java.lang.Override
public boolean hasMetricDescriptor() {
return metricDescriptor_ != null;
}
/**
*
* The descriptor of the Metric.
* TODO(issue #152): consider only sending the name of descriptor for
* optimization.
*
*
* .opencensus.proto.metrics.v1.MetricDescriptor metric_descriptor = 1;
* @return The metricDescriptor.
*/
@java.lang.Override
public io.opencensus.proto.metrics.v1.MetricDescriptor getMetricDescriptor() {
return metricDescriptor_ == null ? io.opencensus.proto.metrics.v1.MetricDescriptor.getDefaultInstance() : metricDescriptor_;
}
/**
*
* The descriptor of the Metric.
* TODO(issue #152): consider only sending the name of descriptor for
* optimization.
*
*
* .opencensus.proto.metrics.v1.MetricDescriptor metric_descriptor = 1;
*/
@java.lang.Override
public io.opencensus.proto.metrics.v1.MetricDescriptorOrBuilder getMetricDescriptorOrBuilder() {
return getMetricDescriptor();
}
public static final int TIMESERIES_FIELD_NUMBER = 2;
private java.util.List timeseries_;
/**
*
* One or more timeseries for a single metric, where each timeseries has
* one or more points.
*
*
* repeated .opencensus.proto.metrics.v1.TimeSeries timeseries = 2;
*/
@java.lang.Override
public java.util.List getTimeseriesList() {
return timeseries_;
}
/**
*
* One or more timeseries for a single metric, where each timeseries has
* one or more points.
*
*
* repeated .opencensus.proto.metrics.v1.TimeSeries timeseries = 2;
*/
@java.lang.Override
public java.util.List extends io.opencensus.proto.metrics.v1.TimeSeriesOrBuilder>
getTimeseriesOrBuilderList() {
return timeseries_;
}
/**
*
* One or more timeseries for a single metric, where each timeseries has
* one or more points.
*
*
* repeated .opencensus.proto.metrics.v1.TimeSeries timeseries = 2;
*/
@java.lang.Override
public int getTimeseriesCount() {
return timeseries_.size();
}
/**
*
* One or more timeseries for a single metric, where each timeseries has
* one or more points.
*
*
* repeated .opencensus.proto.metrics.v1.TimeSeries timeseries = 2;
*/
@java.lang.Override
public io.opencensus.proto.metrics.v1.TimeSeries getTimeseries(int index) {
return timeseries_.get(index);
}
/**
*
* One or more timeseries for a single metric, where each timeseries has
* one or more points.
*
*
* repeated .opencensus.proto.metrics.v1.TimeSeries timeseries = 2;
*/
@java.lang.Override
public io.opencensus.proto.metrics.v1.TimeSeriesOrBuilder getTimeseriesOrBuilder(
int index) {
return timeseries_.get(index);
}
public static final int RESOURCE_FIELD_NUMBER = 3;
private io.opencensus.proto.resource.v1.Resource resource_;
/**
*
* The resource for the metric. If unset, it may be set to a default value
* provided for a sequence of messages in an RPC stream.
*
*
* .opencensus.proto.resource.v1.Resource resource = 3;
* @return Whether the resource field is set.
*/
@java.lang.Override
public boolean hasResource() {
return resource_ != null;
}
/**
*
* The resource for the metric. If unset, it may be set to a default value
* provided for a sequence of messages in an RPC stream.
*
*
* .opencensus.proto.resource.v1.Resource resource = 3;
* @return The resource.
*/
@java.lang.Override
public io.opencensus.proto.resource.v1.Resource getResource() {
return resource_ == null ? io.opencensus.proto.resource.v1.Resource.getDefaultInstance() : resource_;
}
/**
*
* The resource for the metric. If unset, it may be set to a default value
* provided for a sequence of messages in an RPC stream.
*
*
* .opencensus.proto.resource.v1.Resource resource = 3;
*/
@java.lang.Override
public io.opencensus.proto.resource.v1.ResourceOrBuilder 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 (metricDescriptor_ != null) {
output.writeMessage(1, getMetricDescriptor());
}
for (int i = 0; i < timeseries_.size(); i++) {
output.writeMessage(2, timeseries_.get(i));
}
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 (metricDescriptor_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, getMetricDescriptor());
}
for (int i = 0; i < timeseries_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, timeseries_.get(i));
}
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 io.opencensus.proto.metrics.v1.Metric)) {
return super.equals(obj);
}
io.opencensus.proto.metrics.v1.Metric other = (io.opencensus.proto.metrics.v1.Metric) obj;
if (hasMetricDescriptor() != other.hasMetricDescriptor()) return false;
if (hasMetricDescriptor()) {
if (!getMetricDescriptor()
.equals(other.getMetricDescriptor())) return false;
}
if (!getTimeseriesList()
.equals(other.getTimeseriesList())) 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 (hasMetricDescriptor()) {
hash = (37 * hash) + METRIC_DESCRIPTOR_FIELD_NUMBER;
hash = (53 * hash) + getMetricDescriptor().hashCode();
}
if (getTimeseriesCount() > 0) {
hash = (37 * hash) + TIMESERIES_FIELD_NUMBER;
hash = (53 * hash) + getTimeseriesList().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 io.opencensus.proto.metrics.v1.Metric parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.opencensus.proto.metrics.v1.Metric parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.opencensus.proto.metrics.v1.Metric parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.opencensus.proto.metrics.v1.Metric parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.opencensus.proto.metrics.v1.Metric parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.opencensus.proto.metrics.v1.Metric parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.opencensus.proto.metrics.v1.Metric parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.opencensus.proto.metrics.v1.Metric 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.opencensus.proto.metrics.v1.Metric parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static io.opencensus.proto.metrics.v1.Metric 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.opencensus.proto.metrics.v1.Metric parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.opencensus.proto.metrics.v1.Metric 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.opencensus.proto.metrics.v1.Metric 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;
}
/**
*
* Defines a Metric which has one or more timeseries.
*
*
* Protobuf type {@code opencensus.proto.metrics.v1.Metric}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:opencensus.proto.metrics.v1.Metric)
io.opencensus.proto.metrics.v1.MetricOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.opencensus.proto.metrics.v1.MetricsProto.internal_static_opencensus_proto_metrics_v1_Metric_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.opencensus.proto.metrics.v1.MetricsProto.internal_static_opencensus_proto_metrics_v1_Metric_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.opencensus.proto.metrics.v1.Metric.class, io.opencensus.proto.metrics.v1.Metric.Builder.class);
}
// Construct using io.opencensus.proto.metrics.v1.Metric.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getTimeseriesFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
if (metricDescriptorBuilder_ == null) {
metricDescriptor_ = null;
} else {
metricDescriptor_ = null;
metricDescriptorBuilder_ = null;
}
if (timeseriesBuilder_ == null) {
timeseries_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
} else {
timeseriesBuilder_.clear();
}
if (resourceBuilder_ == null) {
resource_ = null;
} else {
resource_ = null;
resourceBuilder_ = null;
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.opencensus.proto.metrics.v1.MetricsProto.internal_static_opencensus_proto_metrics_v1_Metric_descriptor;
}
@java.lang.Override
public io.opencensus.proto.metrics.v1.Metric getDefaultInstanceForType() {
return io.opencensus.proto.metrics.v1.Metric.getDefaultInstance();
}
@java.lang.Override
public io.opencensus.proto.metrics.v1.Metric build() {
io.opencensus.proto.metrics.v1.Metric result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public io.opencensus.proto.metrics.v1.Metric buildPartial() {
io.opencensus.proto.metrics.v1.Metric result = new io.opencensus.proto.metrics.v1.Metric(this);
int from_bitField0_ = bitField0_;
if (metricDescriptorBuilder_ == null) {
result.metricDescriptor_ = metricDescriptor_;
} else {
result.metricDescriptor_ = metricDescriptorBuilder_.build();
}
if (timeseriesBuilder_ == null) {
if (((bitField0_ & 0x00000001) != 0)) {
timeseries_ = java.util.Collections.unmodifiableList(timeseries_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.timeseries_ = timeseries_;
} else {
result.timeseries_ = timeseriesBuilder_.build();
}
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 io.opencensus.proto.metrics.v1.Metric) {
return mergeFrom((io.opencensus.proto.metrics.v1.Metric)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.opencensus.proto.metrics.v1.Metric other) {
if (other == io.opencensus.proto.metrics.v1.Metric.getDefaultInstance()) return this;
if (other.hasMetricDescriptor()) {
mergeMetricDescriptor(other.getMetricDescriptor());
}
if (timeseriesBuilder_ == null) {
if (!other.timeseries_.isEmpty()) {
if (timeseries_.isEmpty()) {
timeseries_ = other.timeseries_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureTimeseriesIsMutable();
timeseries_.addAll(other.timeseries_);
}
onChanged();
}
} else {
if (!other.timeseries_.isEmpty()) {
if (timeseriesBuilder_.isEmpty()) {
timeseriesBuilder_.dispose();
timeseriesBuilder_ = null;
timeseries_ = other.timeseries_;
bitField0_ = (bitField0_ & ~0x00000001);
timeseriesBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getTimeseriesFieldBuilder() : null;
} else {
timeseriesBuilder_.addAllMessages(other.timeseries_);
}
}
}
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 {
io.opencensus.proto.metrics.v1.Metric parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (io.opencensus.proto.metrics.v1.Metric) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private io.opencensus.proto.metrics.v1.MetricDescriptor metricDescriptor_;
private com.google.protobuf.SingleFieldBuilderV3<
io.opencensus.proto.metrics.v1.MetricDescriptor, io.opencensus.proto.metrics.v1.MetricDescriptor.Builder, io.opencensus.proto.metrics.v1.MetricDescriptorOrBuilder> metricDescriptorBuilder_;
/**
*
* The descriptor of the Metric.
* TODO(issue #152): consider only sending the name of descriptor for
* optimization.
*
*
* .opencensus.proto.metrics.v1.MetricDescriptor metric_descriptor = 1;
* @return Whether the metricDescriptor field is set.
*/
public boolean hasMetricDescriptor() {
return metricDescriptorBuilder_ != null || metricDescriptor_ != null;
}
/**
*
* The descriptor of the Metric.
* TODO(issue #152): consider only sending the name of descriptor for
* optimization.
*
*
* .opencensus.proto.metrics.v1.MetricDescriptor metric_descriptor = 1;
* @return The metricDescriptor.
*/
public io.opencensus.proto.metrics.v1.MetricDescriptor getMetricDescriptor() {
if (metricDescriptorBuilder_ == null) {
return metricDescriptor_ == null ? io.opencensus.proto.metrics.v1.MetricDescriptor.getDefaultInstance() : metricDescriptor_;
} else {
return metricDescriptorBuilder_.getMessage();
}
}
/**
*
* The descriptor of the Metric.
* TODO(issue #152): consider only sending the name of descriptor for
* optimization.
*
*
* .opencensus.proto.metrics.v1.MetricDescriptor metric_descriptor = 1;
*/
public Builder setMetricDescriptor(io.opencensus.proto.metrics.v1.MetricDescriptor value) {
if (metricDescriptorBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
metricDescriptor_ = value;
onChanged();
} else {
metricDescriptorBuilder_.setMessage(value);
}
return this;
}
/**
*
* The descriptor of the Metric.
* TODO(issue #152): consider only sending the name of descriptor for
* optimization.
*
*
* .opencensus.proto.metrics.v1.MetricDescriptor metric_descriptor = 1;
*/
public Builder setMetricDescriptor(
io.opencensus.proto.metrics.v1.MetricDescriptor.Builder builderForValue) {
if (metricDescriptorBuilder_ == null) {
metricDescriptor_ = builderForValue.build();
onChanged();
} else {
metricDescriptorBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
* The descriptor of the Metric.
* TODO(issue #152): consider only sending the name of descriptor for
* optimization.
*
*
* .opencensus.proto.metrics.v1.MetricDescriptor metric_descriptor = 1;
*/
public Builder mergeMetricDescriptor(io.opencensus.proto.metrics.v1.MetricDescriptor value) {
if (metricDescriptorBuilder_ == null) {
if (metricDescriptor_ != null) {
metricDescriptor_ =
io.opencensus.proto.metrics.v1.MetricDescriptor.newBuilder(metricDescriptor_).mergeFrom(value).buildPartial();
} else {
metricDescriptor_ = value;
}
onChanged();
} else {
metricDescriptorBuilder_.mergeFrom(value);
}
return this;
}
/**
*
* The descriptor of the Metric.
* TODO(issue #152): consider only sending the name of descriptor for
* optimization.
*
*
* .opencensus.proto.metrics.v1.MetricDescriptor metric_descriptor = 1;
*/
public Builder clearMetricDescriptor() {
if (metricDescriptorBuilder_ == null) {
metricDescriptor_ = null;
onChanged();
} else {
metricDescriptor_ = null;
metricDescriptorBuilder_ = null;
}
return this;
}
/**
*
* The descriptor of the Metric.
* TODO(issue #152): consider only sending the name of descriptor for
* optimization.
*
*
* .opencensus.proto.metrics.v1.MetricDescriptor metric_descriptor = 1;
*/
public io.opencensus.proto.metrics.v1.MetricDescriptor.Builder getMetricDescriptorBuilder() {
onChanged();
return getMetricDescriptorFieldBuilder().getBuilder();
}
/**
*
* The descriptor of the Metric.
* TODO(issue #152): consider only sending the name of descriptor for
* optimization.
*
*
* .opencensus.proto.metrics.v1.MetricDescriptor metric_descriptor = 1;
*/
public io.opencensus.proto.metrics.v1.MetricDescriptorOrBuilder getMetricDescriptorOrBuilder() {
if (metricDescriptorBuilder_ != null) {
return metricDescriptorBuilder_.getMessageOrBuilder();
} else {
return metricDescriptor_ == null ?
io.opencensus.proto.metrics.v1.MetricDescriptor.getDefaultInstance() : metricDescriptor_;
}
}
/**
*
* The descriptor of the Metric.
* TODO(issue #152): consider only sending the name of descriptor for
* optimization.
*
*
* .opencensus.proto.metrics.v1.MetricDescriptor metric_descriptor = 1;
*/
private com.google.protobuf.SingleFieldBuilderV3<
io.opencensus.proto.metrics.v1.MetricDescriptor, io.opencensus.proto.metrics.v1.MetricDescriptor.Builder, io.opencensus.proto.metrics.v1.MetricDescriptorOrBuilder>
getMetricDescriptorFieldBuilder() {
if (metricDescriptorBuilder_ == null) {
metricDescriptorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
io.opencensus.proto.metrics.v1.MetricDescriptor, io.opencensus.proto.metrics.v1.MetricDescriptor.Builder, io.opencensus.proto.metrics.v1.MetricDescriptorOrBuilder>(
getMetricDescriptor(),
getParentForChildren(),
isClean());
metricDescriptor_ = null;
}
return metricDescriptorBuilder_;
}
private java.util.List timeseries_ =
java.util.Collections.emptyList();
private void ensureTimeseriesIsMutable() {
if (!((bitField0_ & 0x00000001) != 0)) {
timeseries_ = new java.util.ArrayList(timeseries_);
bitField0_ |= 0x00000001;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
io.opencensus.proto.metrics.v1.TimeSeries, io.opencensus.proto.metrics.v1.TimeSeries.Builder, io.opencensus.proto.metrics.v1.TimeSeriesOrBuilder> timeseriesBuilder_;
/**
*
* One or more timeseries for a single metric, where each timeseries has
* one or more points.
*
*
* repeated .opencensus.proto.metrics.v1.TimeSeries timeseries = 2;
*/
public java.util.List getTimeseriesList() {
if (timeseriesBuilder_ == null) {
return java.util.Collections.unmodifiableList(timeseries_);
} else {
return timeseriesBuilder_.getMessageList();
}
}
/**
*
* One or more timeseries for a single metric, where each timeseries has
* one or more points.
*
*
* repeated .opencensus.proto.metrics.v1.TimeSeries timeseries = 2;
*/
public int getTimeseriesCount() {
if (timeseriesBuilder_ == null) {
return timeseries_.size();
} else {
return timeseriesBuilder_.getCount();
}
}
/**
*
* One or more timeseries for a single metric, where each timeseries has
* one or more points.
*
*
* repeated .opencensus.proto.metrics.v1.TimeSeries timeseries = 2;
*/
public io.opencensus.proto.metrics.v1.TimeSeries getTimeseries(int index) {
if (timeseriesBuilder_ == null) {
return timeseries_.get(index);
} else {
return timeseriesBuilder_.getMessage(index);
}
}
/**
*
* One or more timeseries for a single metric, where each timeseries has
* one or more points.
*
*
* repeated .opencensus.proto.metrics.v1.TimeSeries timeseries = 2;
*/
public Builder setTimeseries(
int index, io.opencensus.proto.metrics.v1.TimeSeries value) {
if (timeseriesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureTimeseriesIsMutable();
timeseries_.set(index, value);
onChanged();
} else {
timeseriesBuilder_.setMessage(index, value);
}
return this;
}
/**
*
* One or more timeseries for a single metric, where each timeseries has
* one or more points.
*
*
* repeated .opencensus.proto.metrics.v1.TimeSeries timeseries = 2;
*/
public Builder setTimeseries(
int index, io.opencensus.proto.metrics.v1.TimeSeries.Builder builderForValue) {
if (timeseriesBuilder_ == null) {
ensureTimeseriesIsMutable();
timeseries_.set(index, builderForValue.build());
onChanged();
} else {
timeseriesBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
* One or more timeseries for a single metric, where each timeseries has
* one or more points.
*
*
* repeated .opencensus.proto.metrics.v1.TimeSeries timeseries = 2;
*/
public Builder addTimeseries(io.opencensus.proto.metrics.v1.TimeSeries value) {
if (timeseriesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureTimeseriesIsMutable();
timeseries_.add(value);
onChanged();
} else {
timeseriesBuilder_.addMessage(value);
}
return this;
}
/**
*
* One or more timeseries for a single metric, where each timeseries has
* one or more points.
*
*
* repeated .opencensus.proto.metrics.v1.TimeSeries timeseries = 2;
*/
public Builder addTimeseries(
int index, io.opencensus.proto.metrics.v1.TimeSeries value) {
if (timeseriesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureTimeseriesIsMutable();
timeseries_.add(index, value);
onChanged();
} else {
timeseriesBuilder_.addMessage(index, value);
}
return this;
}
/**
*
* One or more timeseries for a single metric, where each timeseries has
* one or more points.
*
*
* repeated .opencensus.proto.metrics.v1.TimeSeries timeseries = 2;
*/
public Builder addTimeseries(
io.opencensus.proto.metrics.v1.TimeSeries.Builder builderForValue) {
if (timeseriesBuilder_ == null) {
ensureTimeseriesIsMutable();
timeseries_.add(builderForValue.build());
onChanged();
} else {
timeseriesBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
* One or more timeseries for a single metric, where each timeseries has
* one or more points.
*
*
* repeated .opencensus.proto.metrics.v1.TimeSeries timeseries = 2;
*/
public Builder addTimeseries(
int index, io.opencensus.proto.metrics.v1.TimeSeries.Builder builderForValue) {
if (timeseriesBuilder_ == null) {
ensureTimeseriesIsMutable();
timeseries_.add(index, builderForValue.build());
onChanged();
} else {
timeseriesBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
* One or more timeseries for a single metric, where each timeseries has
* one or more points.
*
*
* repeated .opencensus.proto.metrics.v1.TimeSeries timeseries = 2;
*/
public Builder addAllTimeseries(
java.lang.Iterable extends io.opencensus.proto.metrics.v1.TimeSeries> values) {
if (timeseriesBuilder_ == null) {
ensureTimeseriesIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, timeseries_);
onChanged();
} else {
timeseriesBuilder_.addAllMessages(values);
}
return this;
}
/**
*
* One or more timeseries for a single metric, where each timeseries has
* one or more points.
*
*
* repeated .opencensus.proto.metrics.v1.TimeSeries timeseries = 2;
*/
public Builder clearTimeseries() {
if (timeseriesBuilder_ == null) {
timeseries_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
} else {
timeseriesBuilder_.clear();
}
return this;
}
/**
*
* One or more timeseries for a single metric, where each timeseries has
* one or more points.
*
*
* repeated .opencensus.proto.metrics.v1.TimeSeries timeseries = 2;
*/
public Builder removeTimeseries(int index) {
if (timeseriesBuilder_ == null) {
ensureTimeseriesIsMutable();
timeseries_.remove(index);
onChanged();
} else {
timeseriesBuilder_.remove(index);
}
return this;
}
/**
*
* One or more timeseries for a single metric, where each timeseries has
* one or more points.
*
*
* repeated .opencensus.proto.metrics.v1.TimeSeries timeseries = 2;
*/
public io.opencensus.proto.metrics.v1.TimeSeries.Builder getTimeseriesBuilder(
int index) {
return getTimeseriesFieldBuilder().getBuilder(index);
}
/**
*
* One or more timeseries for a single metric, where each timeseries has
* one or more points.
*
*
* repeated .opencensus.proto.metrics.v1.TimeSeries timeseries = 2;
*/
public io.opencensus.proto.metrics.v1.TimeSeriesOrBuilder getTimeseriesOrBuilder(
int index) {
if (timeseriesBuilder_ == null) {
return timeseries_.get(index); } else {
return timeseriesBuilder_.getMessageOrBuilder(index);
}
}
/**
*
* One or more timeseries for a single metric, where each timeseries has
* one or more points.
*
*
* repeated .opencensus.proto.metrics.v1.TimeSeries timeseries = 2;
*/
public java.util.List extends io.opencensus.proto.metrics.v1.TimeSeriesOrBuilder>
getTimeseriesOrBuilderList() {
if (timeseriesBuilder_ != null) {
return timeseriesBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(timeseries_);
}
}
/**
*
* One or more timeseries for a single metric, where each timeseries has
* one or more points.
*
*
* repeated .opencensus.proto.metrics.v1.TimeSeries timeseries = 2;
*/
public io.opencensus.proto.metrics.v1.TimeSeries.Builder addTimeseriesBuilder() {
return getTimeseriesFieldBuilder().addBuilder(
io.opencensus.proto.metrics.v1.TimeSeries.getDefaultInstance());
}
/**
*
* One or more timeseries for a single metric, where each timeseries has
* one or more points.
*
*
* repeated .opencensus.proto.metrics.v1.TimeSeries timeseries = 2;
*/
public io.opencensus.proto.metrics.v1.TimeSeries.Builder addTimeseriesBuilder(
int index) {
return getTimeseriesFieldBuilder().addBuilder(
index, io.opencensus.proto.metrics.v1.TimeSeries.getDefaultInstance());
}
/**
*
* One or more timeseries for a single metric, where each timeseries has
* one or more points.
*
*
* repeated .opencensus.proto.metrics.v1.TimeSeries timeseries = 2;
*/
public java.util.List
getTimeseriesBuilderList() {
return getTimeseriesFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
io.opencensus.proto.metrics.v1.TimeSeries, io.opencensus.proto.metrics.v1.TimeSeries.Builder, io.opencensus.proto.metrics.v1.TimeSeriesOrBuilder>
getTimeseriesFieldBuilder() {
if (timeseriesBuilder_ == null) {
timeseriesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
io.opencensus.proto.metrics.v1.TimeSeries, io.opencensus.proto.metrics.v1.TimeSeries.Builder, io.opencensus.proto.metrics.v1.TimeSeriesOrBuilder>(
timeseries_,
((bitField0_ & 0x00000001) != 0),
getParentForChildren(),
isClean());
timeseries_ = null;
}
return timeseriesBuilder_;
}
private io.opencensus.proto.resource.v1.Resource resource_;
private com.google.protobuf.SingleFieldBuilderV3<
io.opencensus.proto.resource.v1.Resource, io.opencensus.proto.resource.v1.Resource.Builder, io.opencensus.proto.resource.v1.ResourceOrBuilder> resourceBuilder_;
/**
*
* The resource for the metric. If unset, it may be set to a default value
* provided for a sequence of messages in an RPC stream.
*
*
* .opencensus.proto.resource.v1.Resource resource = 3;
* @return Whether the resource field is set.
*/
public boolean hasResource() {
return resourceBuilder_ != null || resource_ != null;
}
/**
*
* The resource for the metric. If unset, it may be set to a default value
* provided for a sequence of messages in an RPC stream.
*
*
* .opencensus.proto.resource.v1.Resource resource = 3;
* @return The resource.
*/
public io.opencensus.proto.resource.v1.Resource getResource() {
if (resourceBuilder_ == null) {
return resource_ == null ? io.opencensus.proto.resource.v1.Resource.getDefaultInstance() : resource_;
} else {
return resourceBuilder_.getMessage();
}
}
/**
*
* The resource for the metric. If unset, it may be set to a default value
* provided for a sequence of messages in an RPC stream.
*
*
* .opencensus.proto.resource.v1.Resource resource = 3;
*/
public Builder setResource(io.opencensus.proto.resource.v1.Resource value) {
if (resourceBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
resource_ = value;
onChanged();
} else {
resourceBuilder_.setMessage(value);
}
return this;
}
/**
*
* The resource for the metric. If unset, it may be set to a default value
* provided for a sequence of messages in an RPC stream.
*
*
* .opencensus.proto.resource.v1.Resource resource = 3;
*/
public Builder setResource(
io.opencensus.proto.resource.v1.Resource.Builder builderForValue) {
if (resourceBuilder_ == null) {
resource_ = builderForValue.build();
onChanged();
} else {
resourceBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
* The resource for the metric. If unset, it may be set to a default value
* provided for a sequence of messages in an RPC stream.
*
*
* .opencensus.proto.resource.v1.Resource resource = 3;
*/
public Builder mergeResource(io.opencensus.proto.resource.v1.Resource value) {
if (resourceBuilder_ == null) {
if (resource_ != null) {
resource_ =
io.opencensus.proto.resource.v1.Resource.newBuilder(resource_).mergeFrom(value).buildPartial();
} else {
resource_ = value;
}
onChanged();
} else {
resourceBuilder_.mergeFrom(value);
}
return this;
}
/**
*
* The resource for the metric. If unset, it may be set to a default value
* provided for a sequence of messages in an RPC stream.
*
*
* .opencensus.proto.resource.v1.Resource resource = 3;
*/
public Builder clearResource() {
if (resourceBuilder_ == null) {
resource_ = null;
onChanged();
} else {
resource_ = null;
resourceBuilder_ = null;
}
return this;
}
/**
*
* The resource for the metric. If unset, it may be set to a default value
* provided for a sequence of messages in an RPC stream.
*
*
* .opencensus.proto.resource.v1.Resource resource = 3;
*/
public io.opencensus.proto.resource.v1.Resource.Builder getResourceBuilder() {
onChanged();
return getResourceFieldBuilder().getBuilder();
}
/**
*
* The resource for the metric. If unset, it may be set to a default value
* provided for a sequence of messages in an RPC stream.
*
*
* .opencensus.proto.resource.v1.Resource resource = 3;
*/
public io.opencensus.proto.resource.v1.ResourceOrBuilder getResourceOrBuilder() {
if (resourceBuilder_ != null) {
return resourceBuilder_.getMessageOrBuilder();
} else {
return resource_ == null ?
io.opencensus.proto.resource.v1.Resource.getDefaultInstance() : resource_;
}
}
/**
*
* The resource for the metric. If unset, it may be set to a default value
* provided for a sequence of messages in an RPC stream.
*
*
* .opencensus.proto.resource.v1.Resource resource = 3;
*/
private com.google.protobuf.SingleFieldBuilderV3<
io.opencensus.proto.resource.v1.Resource, io.opencensus.proto.resource.v1.Resource.Builder, io.opencensus.proto.resource.v1.ResourceOrBuilder>
getResourceFieldBuilder() {
if (resourceBuilder_ == null) {
resourceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
io.opencensus.proto.resource.v1.Resource, io.opencensus.proto.resource.v1.Resource.Builder, io.opencensus.proto.resource.v1.ResourceOrBuilder>(
getResource(),
getParentForChildren(),
isClean());
resource_ = null;
}
return resourceBuilder_;
}
@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:opencensus.proto.metrics.v1.Metric)
}
// @@protoc_insertion_point(class_scope:opencensus.proto.metrics.v1.Metric)
private static final io.opencensus.proto.metrics.v1.Metric DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.opencensus.proto.metrics.v1.Metric();
}
public static io.opencensus.proto.metrics.v1.Metric getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public Metric parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new Metric(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public io.opencensus.proto.metrics.v1.Metric getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}