All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.opencensus.proto.stats.v1.Measurement Maven / Gradle / Ivy

There is a newer version: 1.0.46
Show newest version
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: opencensus/proto/stats/v1/stats.proto

package io.opencensus.proto.stats.v1;

/**
 * 
 * Describes a data point to be collected for a Measure.
 * 
* * Protobuf type {@code opencensus.proto.stats.v1.Measurement} */ public final class Measurement extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:opencensus.proto.stats.v1.Measurement) MeasurementOrBuilder { private static final long serialVersionUID = 0L; // Use Measurement.newBuilder() to construct. private Measurement(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private Measurement() { tags_ = java.util.Collections.emptyList(); measureName_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new Measurement(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private Measurement( 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: { if (!((mutable_bitField0_ & 0x00000001) != 0)) { tags_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000001; } tags_.add( input.readMessage(io.opencensus.proto.stats.v1.Tag.parser(), extensionRegistry)); break; } case 18: { java.lang.String s = input.readStringRequireUtf8(); measureName_ = s; break; } case 25: { valueCase_ = 3; value_ = input.readDouble(); break; } case 32: { valueCase_ = 4; value_ = input.readInt64(); break; } case 42: { com.google.protobuf.Timestamp.Builder subBuilder = null; if (time_ != null) { subBuilder = time_.toBuilder(); } time_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(time_); time_ = subBuilder.buildPartial(); } break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) != 0)) { tags_ = java.util.Collections.unmodifiableList(tags_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return io.opencensus.proto.stats.v1.StatsProto.internal_static_opencensus_proto_stats_v1_Measurement_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return io.opencensus.proto.stats.v1.StatsProto.internal_static_opencensus_proto_stats_v1_Measurement_fieldAccessorTable .ensureFieldAccessorsInitialized( io.opencensus.proto.stats.v1.Measurement.class, io.opencensus.proto.stats.v1.Measurement.Builder.class); } private int valueCase_ = 0; private java.lang.Object value_; public enum ValueCase implements com.google.protobuf.Internal.EnumLite { DOUBLE_VALUE(3), INT_VALUE(4), VALUE_NOT_SET(0); private final int value; private ValueCase(int value) { this.value = value; } /** * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated public static ValueCase valueOf(int value) { return forNumber(value); } public static ValueCase forNumber(int value) { switch (value) { case 3: return DOUBLE_VALUE; case 4: return INT_VALUE; case 0: return VALUE_NOT_SET; default: return null; } } public int getNumber() { return this.value; } }; public ValueCase getValueCase() { return ValueCase.forNumber( valueCase_); } public static final int TAGS_FIELD_NUMBER = 1; private java.util.List tags_; /** * repeated .opencensus.proto.stats.v1.Tag tags = 1; */ public java.util.List getTagsList() { return tags_; } /** * repeated .opencensus.proto.stats.v1.Tag tags = 1; */ public java.util.List getTagsOrBuilderList() { return tags_; } /** * repeated .opencensus.proto.stats.v1.Tag tags = 1; */ public int getTagsCount() { return tags_.size(); } /** * repeated .opencensus.proto.stats.v1.Tag tags = 1; */ public io.opencensus.proto.stats.v1.Tag getTags(int index) { return tags_.get(index); } /** * repeated .opencensus.proto.stats.v1.Tag tags = 1; */ public io.opencensus.proto.stats.v1.TagOrBuilder getTagsOrBuilder( int index) { return tags_.get(index); } public static final int MEASURE_NAME_FIELD_NUMBER = 2; private volatile java.lang.Object measureName_; /** *
   * The name of the measure to which the value is applied.
   * 
* * string measure_name = 2; */ public java.lang.String getMeasureName() { java.lang.Object ref = measureName_; 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(); measureName_ = s; return s; } } /** *
   * The name of the measure to which the value is applied.
   * 
* * string measure_name = 2; */ public com.google.protobuf.ByteString getMeasureNameBytes() { java.lang.Object ref = measureName_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); measureName_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int DOUBLE_VALUE_FIELD_NUMBER = 3; /** * double double_value = 3; */ public double getDoubleValue() { if (valueCase_ == 3) { return (java.lang.Double) value_; } return 0D; } public static final int INT_VALUE_FIELD_NUMBER = 4; /** * int64 int_value = 4; */ public long getIntValue() { if (valueCase_ == 4) { return (java.lang.Long) value_; } return 0L; } public static final int TIME_FIELD_NUMBER = 5; private com.google.protobuf.Timestamp time_; /** *
   * The time when this measurement was recorded. If the implementation uses a async buffer to
   * record measurements this may be the time when the measurement was read from the buffer.
   * 
* * .google.protobuf.Timestamp time = 5; */ public boolean hasTime() { return time_ != null; } /** *
   * The time when this measurement was recorded. If the implementation uses a async buffer to
   * record measurements this may be the time when the measurement was read from the buffer.
   * 
* * .google.protobuf.Timestamp time = 5; */ public com.google.protobuf.Timestamp getTime() { return time_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : time_; } /** *
   * The time when this measurement was recorded. If the implementation uses a async buffer to
   * record measurements this may be the time when the measurement was read from the buffer.
   * 
* * .google.protobuf.Timestamp time = 5; */ public com.google.protobuf.TimestampOrBuilder getTimeOrBuilder() { return getTime(); } 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 { for (int i = 0; i < tags_.size(); i++) { output.writeMessage(1, tags_.get(i)); } if (!getMeasureNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, measureName_); } if (valueCase_ == 3) { output.writeDouble( 3, (double)((java.lang.Double) value_)); } if (valueCase_ == 4) { output.writeInt64( 4, (long)((java.lang.Long) value_)); } if (time_ != null) { output.writeMessage(5, getTime()); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; for (int i = 0; i < tags_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, tags_.get(i)); } if (!getMeasureNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, measureName_); } if (valueCase_ == 3) { size += com.google.protobuf.CodedOutputStream .computeDoubleSize( 3, (double)((java.lang.Double) value_)); } if (valueCase_ == 4) { size += com.google.protobuf.CodedOutputStream .computeInt64Size( 4, (long)((java.lang.Long) value_)); } if (time_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(5, getTime()); } 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.stats.v1.Measurement)) { return super.equals(obj); } io.opencensus.proto.stats.v1.Measurement other = (io.opencensus.proto.stats.v1.Measurement) obj; if (!getTagsList() .equals(other.getTagsList())) return false; if (!getMeasureName() .equals(other.getMeasureName())) return false; if (hasTime() != other.hasTime()) return false; if (hasTime()) { if (!getTime() .equals(other.getTime())) return false; } if (!getValueCase().equals(other.getValueCase())) return false; switch (valueCase_) { case 3: if (java.lang.Double.doubleToLongBits(getDoubleValue()) != java.lang.Double.doubleToLongBits( other.getDoubleValue())) return false; break; case 4: if (getIntValue() != other.getIntValue()) return false; break; case 0: default: } 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 (getTagsCount() > 0) { hash = (37 * hash) + TAGS_FIELD_NUMBER; hash = (53 * hash) + getTagsList().hashCode(); } hash = (37 * hash) + MEASURE_NAME_FIELD_NUMBER; hash = (53 * hash) + getMeasureName().hashCode(); if (hasTime()) { hash = (37 * hash) + TIME_FIELD_NUMBER; hash = (53 * hash) + getTime().hashCode(); } switch (valueCase_) { case 3: hash = (37 * hash) + DOUBLE_VALUE_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( java.lang.Double.doubleToLongBits(getDoubleValue())); break; case 4: hash = (37 * hash) + INT_VALUE_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getIntValue()); break; case 0: default: } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static io.opencensus.proto.stats.v1.Measurement parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static io.opencensus.proto.stats.v1.Measurement 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.stats.v1.Measurement parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static io.opencensus.proto.stats.v1.Measurement 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.stats.v1.Measurement parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static io.opencensus.proto.stats.v1.Measurement parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static io.opencensus.proto.stats.v1.Measurement parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static io.opencensus.proto.stats.v1.Measurement 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.stats.v1.Measurement parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static io.opencensus.proto.stats.v1.Measurement 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.stats.v1.Measurement parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static io.opencensus.proto.stats.v1.Measurement 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.stats.v1.Measurement 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; } /** *
   * Describes a data point to be collected for a Measure.
   * 
* * Protobuf type {@code opencensus.proto.stats.v1.Measurement} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:opencensus.proto.stats.v1.Measurement) io.opencensus.proto.stats.v1.MeasurementOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return io.opencensus.proto.stats.v1.StatsProto.internal_static_opencensus_proto_stats_v1_Measurement_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return io.opencensus.proto.stats.v1.StatsProto.internal_static_opencensus_proto_stats_v1_Measurement_fieldAccessorTable .ensureFieldAccessorsInitialized( io.opencensus.proto.stats.v1.Measurement.class, io.opencensus.proto.stats.v1.Measurement.Builder.class); } // Construct using io.opencensus.proto.stats.v1.Measurement.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { getTagsFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); if (tagsBuilder_ == null) { tags_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); } else { tagsBuilder_.clear(); } measureName_ = ""; if (timeBuilder_ == null) { time_ = null; } else { time_ = null; timeBuilder_ = null; } valueCase_ = 0; value_ = null; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return io.opencensus.proto.stats.v1.StatsProto.internal_static_opencensus_proto_stats_v1_Measurement_descriptor; } @java.lang.Override public io.opencensus.proto.stats.v1.Measurement getDefaultInstanceForType() { return io.opencensus.proto.stats.v1.Measurement.getDefaultInstance(); } @java.lang.Override public io.opencensus.proto.stats.v1.Measurement build() { io.opencensus.proto.stats.v1.Measurement result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public io.opencensus.proto.stats.v1.Measurement buildPartial() { io.opencensus.proto.stats.v1.Measurement result = new io.opencensus.proto.stats.v1.Measurement(this); int from_bitField0_ = bitField0_; if (tagsBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { tags_ = java.util.Collections.unmodifiableList(tags_); bitField0_ = (bitField0_ & ~0x00000001); } result.tags_ = tags_; } else { result.tags_ = tagsBuilder_.build(); } result.measureName_ = measureName_; if (valueCase_ == 3) { result.value_ = value_; } if (valueCase_ == 4) { result.value_ = value_; } if (timeBuilder_ == null) { result.time_ = time_; } else { result.time_ = timeBuilder_.build(); } result.valueCase_ = valueCase_; 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.stats.v1.Measurement) { return mergeFrom((io.opencensus.proto.stats.v1.Measurement)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(io.opencensus.proto.stats.v1.Measurement other) { if (other == io.opencensus.proto.stats.v1.Measurement.getDefaultInstance()) return this; if (tagsBuilder_ == null) { if (!other.tags_.isEmpty()) { if (tags_.isEmpty()) { tags_ = other.tags_; bitField0_ = (bitField0_ & ~0x00000001); } else { ensureTagsIsMutable(); tags_.addAll(other.tags_); } onChanged(); } } else { if (!other.tags_.isEmpty()) { if (tagsBuilder_.isEmpty()) { tagsBuilder_.dispose(); tagsBuilder_ = null; tags_ = other.tags_; bitField0_ = (bitField0_ & ~0x00000001); tagsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getTagsFieldBuilder() : null; } else { tagsBuilder_.addAllMessages(other.tags_); } } } if (!other.getMeasureName().isEmpty()) { measureName_ = other.measureName_; onChanged(); } if (other.hasTime()) { mergeTime(other.getTime()); } switch (other.getValueCase()) { case DOUBLE_VALUE: { setDoubleValue(other.getDoubleValue()); break; } case INT_VALUE: { setIntValue(other.getIntValue()); break; } case VALUE_NOT_SET: { break; } } 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.stats.v1.Measurement parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (io.opencensus.proto.stats.v1.Measurement) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int valueCase_ = 0; private java.lang.Object value_; public ValueCase getValueCase() { return ValueCase.forNumber( valueCase_); } public Builder clearValue() { valueCase_ = 0; value_ = null; onChanged(); return this; } private int bitField0_; private java.util.List tags_ = java.util.Collections.emptyList(); private void ensureTagsIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { tags_ = new java.util.ArrayList(tags_); bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilderV3< io.opencensus.proto.stats.v1.Tag, io.opencensus.proto.stats.v1.Tag.Builder, io.opencensus.proto.stats.v1.TagOrBuilder> tagsBuilder_; /** * repeated .opencensus.proto.stats.v1.Tag tags = 1; */ public java.util.List getTagsList() { if (tagsBuilder_ == null) { return java.util.Collections.unmodifiableList(tags_); } else { return tagsBuilder_.getMessageList(); } } /** * repeated .opencensus.proto.stats.v1.Tag tags = 1; */ public int getTagsCount() { if (tagsBuilder_ == null) { return tags_.size(); } else { return tagsBuilder_.getCount(); } } /** * repeated .opencensus.proto.stats.v1.Tag tags = 1; */ public io.opencensus.proto.stats.v1.Tag getTags(int index) { if (tagsBuilder_ == null) { return tags_.get(index); } else { return tagsBuilder_.getMessage(index); } } /** * repeated .opencensus.proto.stats.v1.Tag tags = 1; */ public Builder setTags( int index, io.opencensus.proto.stats.v1.Tag value) { if (tagsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureTagsIsMutable(); tags_.set(index, value); onChanged(); } else { tagsBuilder_.setMessage(index, value); } return this; } /** * repeated .opencensus.proto.stats.v1.Tag tags = 1; */ public Builder setTags( int index, io.opencensus.proto.stats.v1.Tag.Builder builderForValue) { if (tagsBuilder_ == null) { ensureTagsIsMutable(); tags_.set(index, builderForValue.build()); onChanged(); } else { tagsBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * repeated .opencensus.proto.stats.v1.Tag tags = 1; */ public Builder addTags(io.opencensus.proto.stats.v1.Tag value) { if (tagsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureTagsIsMutable(); tags_.add(value); onChanged(); } else { tagsBuilder_.addMessage(value); } return this; } /** * repeated .opencensus.proto.stats.v1.Tag tags = 1; */ public Builder addTags( int index, io.opencensus.proto.stats.v1.Tag value) { if (tagsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureTagsIsMutable(); tags_.add(index, value); onChanged(); } else { tagsBuilder_.addMessage(index, value); } return this; } /** * repeated .opencensus.proto.stats.v1.Tag tags = 1; */ public Builder addTags( io.opencensus.proto.stats.v1.Tag.Builder builderForValue) { if (tagsBuilder_ == null) { ensureTagsIsMutable(); tags_.add(builderForValue.build()); onChanged(); } else { tagsBuilder_.addMessage(builderForValue.build()); } return this; } /** * repeated .opencensus.proto.stats.v1.Tag tags = 1; */ public Builder addTags( int index, io.opencensus.proto.stats.v1.Tag.Builder builderForValue) { if (tagsBuilder_ == null) { ensureTagsIsMutable(); tags_.add(index, builderForValue.build()); onChanged(); } else { tagsBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * repeated .opencensus.proto.stats.v1.Tag tags = 1; */ public Builder addAllTags( java.lang.Iterable values) { if (tagsBuilder_ == null) { ensureTagsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, tags_); onChanged(); } else { tagsBuilder_.addAllMessages(values); } return this; } /** * repeated .opencensus.proto.stats.v1.Tag tags = 1; */ public Builder clearTags() { if (tagsBuilder_ == null) { tags_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { tagsBuilder_.clear(); } return this; } /** * repeated .opencensus.proto.stats.v1.Tag tags = 1; */ public Builder removeTags(int index) { if (tagsBuilder_ == null) { ensureTagsIsMutable(); tags_.remove(index); onChanged(); } else { tagsBuilder_.remove(index); } return this; } /** * repeated .opencensus.proto.stats.v1.Tag tags = 1; */ public io.opencensus.proto.stats.v1.Tag.Builder getTagsBuilder( int index) { return getTagsFieldBuilder().getBuilder(index); } /** * repeated .opencensus.proto.stats.v1.Tag tags = 1; */ public io.opencensus.proto.stats.v1.TagOrBuilder getTagsOrBuilder( int index) { if (tagsBuilder_ == null) { return tags_.get(index); } else { return tagsBuilder_.getMessageOrBuilder(index); } } /** * repeated .opencensus.proto.stats.v1.Tag tags = 1; */ public java.util.List getTagsOrBuilderList() { if (tagsBuilder_ != null) { return tagsBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(tags_); } } /** * repeated .opencensus.proto.stats.v1.Tag tags = 1; */ public io.opencensus.proto.stats.v1.Tag.Builder addTagsBuilder() { return getTagsFieldBuilder().addBuilder( io.opencensus.proto.stats.v1.Tag.getDefaultInstance()); } /** * repeated .opencensus.proto.stats.v1.Tag tags = 1; */ public io.opencensus.proto.stats.v1.Tag.Builder addTagsBuilder( int index) { return getTagsFieldBuilder().addBuilder( index, io.opencensus.proto.stats.v1.Tag.getDefaultInstance()); } /** * repeated .opencensus.proto.stats.v1.Tag tags = 1; */ public java.util.List getTagsBuilderList() { return getTagsFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< io.opencensus.proto.stats.v1.Tag, io.opencensus.proto.stats.v1.Tag.Builder, io.opencensus.proto.stats.v1.TagOrBuilder> getTagsFieldBuilder() { if (tagsBuilder_ == null) { tagsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< io.opencensus.proto.stats.v1.Tag, io.opencensus.proto.stats.v1.Tag.Builder, io.opencensus.proto.stats.v1.TagOrBuilder>( tags_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); tags_ = null; } return tagsBuilder_; } private java.lang.Object measureName_ = ""; /** *
     * The name of the measure to which the value is applied.
     * 
* * string measure_name = 2; */ public java.lang.String getMeasureName() { java.lang.Object ref = measureName_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); measureName_ = s; return s; } else { return (java.lang.String) ref; } } /** *
     * The name of the measure to which the value is applied.
     * 
* * string measure_name = 2; */ public com.google.protobuf.ByteString getMeasureNameBytes() { java.lang.Object ref = measureName_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); measureName_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** *
     * The name of the measure to which the value is applied.
     * 
* * string measure_name = 2; */ public Builder setMeasureName( java.lang.String value) { if (value == null) { throw new NullPointerException(); } measureName_ = value; onChanged(); return this; } /** *
     * The name of the measure to which the value is applied.
     * 
* * string measure_name = 2; */ public Builder clearMeasureName() { measureName_ = getDefaultInstance().getMeasureName(); onChanged(); return this; } /** *
     * The name of the measure to which the value is applied.
     * 
* * string measure_name = 2; */ public Builder setMeasureNameBytes( com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); measureName_ = value; onChanged(); return this; } /** * double double_value = 3; */ public double getDoubleValue() { if (valueCase_ == 3) { return (java.lang.Double) value_; } return 0D; } /** * double double_value = 3; */ public Builder setDoubleValue(double value) { valueCase_ = 3; value_ = value; onChanged(); return this; } /** * double double_value = 3; */ public Builder clearDoubleValue() { if (valueCase_ == 3) { valueCase_ = 0; value_ = null; onChanged(); } return this; } /** * int64 int_value = 4; */ public long getIntValue() { if (valueCase_ == 4) { return (java.lang.Long) value_; } return 0L; } /** * int64 int_value = 4; */ public Builder setIntValue(long value) { valueCase_ = 4; value_ = value; onChanged(); return this; } /** * int64 int_value = 4; */ public Builder clearIntValue() { if (valueCase_ == 4) { valueCase_ = 0; value_ = null; onChanged(); } return this; } private com.google.protobuf.Timestamp time_; private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> timeBuilder_; /** *
     * The time when this measurement was recorded. If the implementation uses a async buffer to
     * record measurements this may be the time when the measurement was read from the buffer.
     * 
* * .google.protobuf.Timestamp time = 5; */ public boolean hasTime() { return timeBuilder_ != null || time_ != null; } /** *
     * The time when this measurement was recorded. If the implementation uses a async buffer to
     * record measurements this may be the time when the measurement was read from the buffer.
     * 
* * .google.protobuf.Timestamp time = 5; */ public com.google.protobuf.Timestamp getTime() { if (timeBuilder_ == null) { return time_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : time_; } else { return timeBuilder_.getMessage(); } } /** *
     * The time when this measurement was recorded. If the implementation uses a async buffer to
     * record measurements this may be the time when the measurement was read from the buffer.
     * 
* * .google.protobuf.Timestamp time = 5; */ public Builder setTime(com.google.protobuf.Timestamp value) { if (timeBuilder_ == null) { if (value == null) { throw new NullPointerException(); } time_ = value; onChanged(); } else { timeBuilder_.setMessage(value); } return this; } /** *
     * The time when this measurement was recorded. If the implementation uses a async buffer to
     * record measurements this may be the time when the measurement was read from the buffer.
     * 
* * .google.protobuf.Timestamp time = 5; */ public Builder setTime( com.google.protobuf.Timestamp.Builder builderForValue) { if (timeBuilder_ == null) { time_ = builderForValue.build(); onChanged(); } else { timeBuilder_.setMessage(builderForValue.build()); } return this; } /** *
     * The time when this measurement was recorded. If the implementation uses a async buffer to
     * record measurements this may be the time when the measurement was read from the buffer.
     * 
* * .google.protobuf.Timestamp time = 5; */ public Builder mergeTime(com.google.protobuf.Timestamp value) { if (timeBuilder_ == null) { if (time_ != null) { time_ = com.google.protobuf.Timestamp.newBuilder(time_).mergeFrom(value).buildPartial(); } else { time_ = value; } onChanged(); } else { timeBuilder_.mergeFrom(value); } return this; } /** *
     * The time when this measurement was recorded. If the implementation uses a async buffer to
     * record measurements this may be the time when the measurement was read from the buffer.
     * 
* * .google.protobuf.Timestamp time = 5; */ public Builder clearTime() { if (timeBuilder_ == null) { time_ = null; onChanged(); } else { time_ = null; timeBuilder_ = null; } return this; } /** *
     * The time when this measurement was recorded. If the implementation uses a async buffer to
     * record measurements this may be the time when the measurement was read from the buffer.
     * 
* * .google.protobuf.Timestamp time = 5; */ public com.google.protobuf.Timestamp.Builder getTimeBuilder() { onChanged(); return getTimeFieldBuilder().getBuilder(); } /** *
     * The time when this measurement was recorded. If the implementation uses a async buffer to
     * record measurements this may be the time when the measurement was read from the buffer.
     * 
* * .google.protobuf.Timestamp time = 5; */ public com.google.protobuf.TimestampOrBuilder getTimeOrBuilder() { if (timeBuilder_ != null) { return timeBuilder_.getMessageOrBuilder(); } else { return time_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : time_; } } /** *
     * The time when this measurement was recorded. If the implementation uses a async buffer to
     * record measurements this may be the time when the measurement was read from the buffer.
     * 
* * .google.protobuf.Timestamp time = 5; */ private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> getTimeFieldBuilder() { if (timeBuilder_ == null) { timeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( getTime(), getParentForChildren(), isClean()); time_ = null; } return timeBuilder_; } @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.stats.v1.Measurement) } // @@protoc_insertion_point(class_scope:opencensus.proto.stats.v1.Measurement) private static final io.opencensus.proto.stats.v1.Measurement DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new io.opencensus.proto.stats.v1.Measurement(); } public static io.opencensus.proto.stats.v1.Measurement getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public Measurement parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new Measurement(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.stats.v1.Measurement getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy