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

com.google.api.servicecontrol.v1.MetricValue Maven / Gradle / Ivy

The newest version!
/*
 * Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/api/servicecontrol/v1/metric_value.proto

// Protobuf Java Version: 3.25.5
package com.google.api.servicecontrol.v1;

/**
 *
 *
 * 
 * Represents a single metric value.
 * 
* * Protobuf type {@code google.api.servicecontrol.v1.MetricValue} */ public final class MetricValue extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.api.servicecontrol.v1.MetricValue) MetricValueOrBuilder { private static final long serialVersionUID = 0L; // Use MetricValue.newBuilder() to construct. private MetricValue(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private MetricValue() {} @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new MetricValue(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.servicecontrol.v1.MetricValueSetProto .internal_static_google_api_servicecontrol_v1_MetricValue_descriptor; } @SuppressWarnings({"rawtypes"}) @java.lang.Override protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( int number) { switch (number) { case 1: return internalGetLabels(); default: throw new RuntimeException("Invalid map field number: " + number); } } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.servicecontrol.v1.MetricValueSetProto .internal_static_google_api_servicecontrol_v1_MetricValue_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.api.servicecontrol.v1.MetricValue.class, com.google.api.servicecontrol.v1.MetricValue.Builder.class); } private int bitField0_; private int valueCase_ = 0; @SuppressWarnings("serial") private java.lang.Object value_; public enum ValueCase implements com.google.protobuf.Internal.EnumLite, com.google.protobuf.AbstractMessage.InternalOneOfEnum { BOOL_VALUE(4), INT64_VALUE(5), DOUBLE_VALUE(6), STRING_VALUE(7), DISTRIBUTION_VALUE(8), VALUE_NOT_SET(0); private final int value; private ValueCase(int value) { this.value = value; } /** * @param value The number of the enum to look for. * @return The enum associated with the given number. * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated public static ValueCase valueOf(int value) { return forNumber(value); } public static ValueCase forNumber(int value) { switch (value) { case 4: return BOOL_VALUE; case 5: return INT64_VALUE; case 6: return DOUBLE_VALUE; case 7: return STRING_VALUE; case 8: return DISTRIBUTION_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 LABELS_FIELD_NUMBER = 1; private static final class LabelsDefaultEntryHolder { static final com.google.protobuf.MapEntry defaultEntry = com.google.protobuf.MapEntry.newDefaultInstance( com.google.api.servicecontrol.v1.MetricValueSetProto .internal_static_google_api_servicecontrol_v1_MetricValue_LabelsEntry_descriptor, com.google.protobuf.WireFormat.FieldType.STRING, "", com.google.protobuf.WireFormat.FieldType.STRING, ""); } @SuppressWarnings("serial") private com.google.protobuf.MapField 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(); } /** * * *
   * The labels describing the metric value.
   * See comments on [google.api.servicecontrol.v1.Operation.labels][google.api.servicecontrol.v1.Operation.labels] for
   * the overriding relationship.
   * Note that this map must not contain monitored resource labels.
   * 
* * map<string, string> labels = 1; */ @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(); } /** * * *
   * The labels describing the metric value.
   * See comments on [google.api.servicecontrol.v1.Operation.labels][google.api.servicecontrol.v1.Operation.labels] for
   * the overriding relationship.
   * Note that this map must not contain monitored resource labels.
   * 
* * map<string, string> labels = 1; */ @java.lang.Override public java.util.Map getLabelsMap() { return internalGetLabels().getMap(); } /** * * *
   * The labels describing the metric value.
   * See comments on [google.api.servicecontrol.v1.Operation.labels][google.api.servicecontrol.v1.Operation.labels] for
   * the overriding relationship.
   * Note that this map must not contain monitored resource labels.
   * 
* * map<string, string> labels = 1; */ @java.lang.Override public /* nullable */ java.lang.String getLabelsOrDefault( java.lang.String key, /* nullable */ java.lang.String defaultValue) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map map = internalGetLabels().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /** * * *
   * The labels describing the metric value.
   * See comments on [google.api.servicecontrol.v1.Operation.labels][google.api.servicecontrol.v1.Operation.labels] for
   * the overriding relationship.
   * Note that this map must not contain monitored resource labels.
   * 
* * map<string, string> labels = 1; */ @java.lang.Override public java.lang.String getLabelsOrThrow(java.lang.String key) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map map = internalGetLabels().getMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } return map.get(key); } public static final int START_TIME_FIELD_NUMBER = 2; private com.google.protobuf.Timestamp startTime_; /** * * *
   * The start of the time period over which this metric value's measurement
   * applies. The time period has different semantics for different metric
   * types (cumulative, delta, and gauge). See the metric definition
   * documentation in the service configuration for details. If not specified,
   * [google.api.servicecontrol.v1.Operation.start_time][google.api.servicecontrol.v1.Operation.start_time] will be used.
   * 
* * .google.protobuf.Timestamp start_time = 2; * * @return Whether the startTime field is set. */ @java.lang.Override public boolean hasStartTime() { return ((bitField0_ & 0x00000001) != 0); } /** * * *
   * The start of the time period over which this metric value's measurement
   * applies. The time period has different semantics for different metric
   * types (cumulative, delta, and gauge). See the metric definition
   * documentation in the service configuration for details. If not specified,
   * [google.api.servicecontrol.v1.Operation.start_time][google.api.servicecontrol.v1.Operation.start_time] will be used.
   * 
* * .google.protobuf.Timestamp start_time = 2; * * @return The startTime. */ @java.lang.Override public com.google.protobuf.Timestamp getStartTime() { return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; } /** * * *
   * The start of the time period over which this metric value's measurement
   * applies. The time period has different semantics for different metric
   * types (cumulative, delta, and gauge). See the metric definition
   * documentation in the service configuration for details. If not specified,
   * [google.api.servicecontrol.v1.Operation.start_time][google.api.servicecontrol.v1.Operation.start_time] will be used.
   * 
* * .google.protobuf.Timestamp start_time = 2; */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; } public static final int END_TIME_FIELD_NUMBER = 3; private com.google.protobuf.Timestamp endTime_; /** * * *
   * The end of the time period over which this metric value's measurement
   * applies.  If not specified,
   * [google.api.servicecontrol.v1.Operation.end_time][google.api.servicecontrol.v1.Operation.end_time] will be used.
   * 
* * .google.protobuf.Timestamp end_time = 3; * * @return Whether the endTime field is set. */ @java.lang.Override public boolean hasEndTime() { return ((bitField0_ & 0x00000002) != 0); } /** * * *
   * The end of the time period over which this metric value's measurement
   * applies.  If not specified,
   * [google.api.servicecontrol.v1.Operation.end_time][google.api.servicecontrol.v1.Operation.end_time] will be used.
   * 
* * .google.protobuf.Timestamp end_time = 3; * * @return The endTime. */ @java.lang.Override public com.google.protobuf.Timestamp getEndTime() { return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; } /** * * *
   * The end of the time period over which this metric value's measurement
   * applies.  If not specified,
   * [google.api.servicecontrol.v1.Operation.end_time][google.api.servicecontrol.v1.Operation.end_time] will be used.
   * 
* * .google.protobuf.Timestamp end_time = 3; */ @java.lang.Override public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; } public static final int BOOL_VALUE_FIELD_NUMBER = 4; /** * * *
   * A boolean value.
   * 
* * bool bool_value = 4; * * @return Whether the boolValue field is set. */ @java.lang.Override public boolean hasBoolValue() { return valueCase_ == 4; } /** * * *
   * A boolean value.
   * 
* * bool bool_value = 4; * * @return The boolValue. */ @java.lang.Override public boolean getBoolValue() { if (valueCase_ == 4) { return (java.lang.Boolean) value_; } return false; } public static final int INT64_VALUE_FIELD_NUMBER = 5; /** * * *
   * A signed 64-bit integer value.
   * 
* * int64 int64_value = 5; * * @return Whether the int64Value field is set. */ @java.lang.Override public boolean hasInt64Value() { return valueCase_ == 5; } /** * * *
   * A signed 64-bit integer value.
   * 
* * int64 int64_value = 5; * * @return The int64Value. */ @java.lang.Override public long getInt64Value() { if (valueCase_ == 5) { return (java.lang.Long) value_; } return 0L; } public static final int DOUBLE_VALUE_FIELD_NUMBER = 6; /** * * *
   * A double precision floating point value.
   * 
* * double double_value = 6; * * @return Whether the doubleValue field is set. */ @java.lang.Override public boolean hasDoubleValue() { return valueCase_ == 6; } /** * * *
   * A double precision floating point value.
   * 
* * double double_value = 6; * * @return The doubleValue. */ @java.lang.Override public double getDoubleValue() { if (valueCase_ == 6) { return (java.lang.Double) value_; } return 0D; } public static final int STRING_VALUE_FIELD_NUMBER = 7; /** * * *
   * A text string value.
   * 
* * string string_value = 7; * * @return Whether the stringValue field is set. */ public boolean hasStringValue() { return valueCase_ == 7; } /** * * *
   * A text string value.
   * 
* * string string_value = 7; * * @return The stringValue. */ public java.lang.String getStringValue() { java.lang.Object ref = ""; if (valueCase_ == 7) { ref = value_; } if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (valueCase_ == 7) { value_ = s; } return s; } } /** * * *
   * A text string value.
   * 
* * string string_value = 7; * * @return The bytes for stringValue. */ public com.google.protobuf.ByteString getStringValueBytes() { java.lang.Object ref = ""; if (valueCase_ == 7) { ref = value_; } if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); if (valueCase_ == 7) { value_ = b; } return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int DISTRIBUTION_VALUE_FIELD_NUMBER = 8; /** * * *
   * A distribution value.
   * 
* * .google.api.servicecontrol.v1.Distribution distribution_value = 8; * * @return Whether the distributionValue field is set. */ @java.lang.Override public boolean hasDistributionValue() { return valueCase_ == 8; } /** * * *
   * A distribution value.
   * 
* * .google.api.servicecontrol.v1.Distribution distribution_value = 8; * * @return The distributionValue. */ @java.lang.Override public com.google.api.servicecontrol.v1.Distribution getDistributionValue() { if (valueCase_ == 8) { return (com.google.api.servicecontrol.v1.Distribution) value_; } return com.google.api.servicecontrol.v1.Distribution.getDefaultInstance(); } /** * * *
   * A distribution value.
   * 
* * .google.api.servicecontrol.v1.Distribution distribution_value = 8; */ @java.lang.Override public com.google.api.servicecontrol.v1.DistributionOrBuilder getDistributionValueOrBuilder() { if (valueCase_ == 8) { return (com.google.api.servicecontrol.v1.Distribution) value_; } return com.google.api.servicecontrol.v1.Distribution.getDefaultInstance(); } 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 { com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 1); if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(2, getStartTime()); } if (((bitField0_ & 0x00000002) != 0)) { output.writeMessage(3, getEndTime()); } if (valueCase_ == 4) { output.writeBool(4, (boolean) ((java.lang.Boolean) value_)); } if (valueCase_ == 5) { output.writeInt64(5, (long) ((java.lang.Long) value_)); } if (valueCase_ == 6) { output.writeDouble(6, (double) ((java.lang.Double) value_)); } if (valueCase_ == 7) { com.google.protobuf.GeneratedMessageV3.writeString(output, 7, value_); } if (valueCase_ == 8) { output.writeMessage(8, (com.google.api.servicecontrol.v1.Distribution) value_); } getUnknownFields().writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; for (java.util.Map.Entry entry : internalGetLabels().getMap().entrySet()) { com.google.protobuf.MapEntry labels__ = LabelsDefaultEntryHolder.defaultEntry .newBuilderForType() .setKey(entry.getKey()) .setValue(entry.getValue()) .build(); size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, labels__); } if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStartTime()); } if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getEndTime()); } if (valueCase_ == 4) { size += com.google.protobuf.CodedOutputStream.computeBoolSize( 4, (boolean) ((java.lang.Boolean) value_)); } if (valueCase_ == 5) { size += com.google.protobuf.CodedOutputStream.computeInt64Size( 5, (long) ((java.lang.Long) value_)); } if (valueCase_ == 6) { size += com.google.protobuf.CodedOutputStream.computeDoubleSize( 6, (double) ((java.lang.Double) value_)); } if (valueCase_ == 7) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, value_); } if (valueCase_ == 8) { size += com.google.protobuf.CodedOutputStream.computeMessageSize( 8, (com.google.api.servicecontrol.v1.Distribution) value_); } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.api.servicecontrol.v1.MetricValue)) { return super.equals(obj); } com.google.api.servicecontrol.v1.MetricValue other = (com.google.api.servicecontrol.v1.MetricValue) obj; if (!internalGetLabels().equals(other.internalGetLabels())) return false; if (hasStartTime() != other.hasStartTime()) return false; if (hasStartTime()) { if (!getStartTime().equals(other.getStartTime())) return false; } if (hasEndTime() != other.hasEndTime()) return false; if (hasEndTime()) { if (!getEndTime().equals(other.getEndTime())) return false; } if (!getValueCase().equals(other.getValueCase())) return false; switch (valueCase_) { case 4: if (getBoolValue() != other.getBoolValue()) return false; break; case 5: if (getInt64Value() != other.getInt64Value()) return false; break; case 6: if (java.lang.Double.doubleToLongBits(getDoubleValue()) != java.lang.Double.doubleToLongBits(other.getDoubleValue())) return false; break; case 7: if (!getStringValue().equals(other.getStringValue())) return false; break; case 8: if (!getDistributionValue().equals(other.getDistributionValue())) return false; break; case 0: default: } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (!internalGetLabels().getMap().isEmpty()) { hash = (37 * hash) + LABELS_FIELD_NUMBER; hash = (53 * hash) + internalGetLabels().hashCode(); } if (hasStartTime()) { hash = (37 * hash) + START_TIME_FIELD_NUMBER; hash = (53 * hash) + getStartTime().hashCode(); } if (hasEndTime()) { hash = (37 * hash) + END_TIME_FIELD_NUMBER; hash = (53 * hash) + getEndTime().hashCode(); } switch (valueCase_) { case 4: hash = (37 * hash) + BOOL_VALUE_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getBoolValue()); break; case 5: hash = (37 * hash) + INT64_VALUE_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getInt64Value()); break; case 6: hash = (37 * hash) + DOUBLE_VALUE_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( java.lang.Double.doubleToLongBits(getDoubleValue())); break; case 7: hash = (37 * hash) + STRING_VALUE_FIELD_NUMBER; hash = (53 * hash) + getStringValue().hashCode(); break; case 8: hash = (37 * hash) + DISTRIBUTION_VALUE_FIELD_NUMBER; hash = (53 * hash) + getDistributionValue().hashCode(); break; case 0: default: } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } public static com.google.api.servicecontrol.v1.MetricValue parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.api.servicecontrol.v1.MetricValue parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.api.servicecontrol.v1.MetricValue parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.api.servicecontrol.v1.MetricValue parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.api.servicecontrol.v1.MetricValue parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.api.servicecontrol.v1.MetricValue parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.api.servicecontrol.v1.MetricValue parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.api.servicecontrol.v1.MetricValue 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.google.api.servicecontrol.v1.MetricValue parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } public static com.google.api.servicecontrol.v1.MetricValue 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.google.api.servicecontrol.v1.MetricValue parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.api.servicecontrol.v1.MetricValue 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.google.api.servicecontrol.v1.MetricValue 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; } /** * * *
   * Represents a single metric value.
   * 
* * Protobuf type {@code google.api.servicecontrol.v1.MetricValue} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.api.servicecontrol.v1.MetricValue) com.google.api.servicecontrol.v1.MetricValueOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.api.servicecontrol.v1.MetricValueSetProto .internal_static_google_api_servicecontrol_v1_MetricValue_descriptor; } @SuppressWarnings({"rawtypes"}) protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( int number) { switch (number) { case 1: return internalGetLabels(); default: throw new RuntimeException("Invalid map field number: " + number); } } @SuppressWarnings({"rawtypes"}) protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( int number) { switch (number) { case 1: return internalGetMutableLabels(); default: throw new RuntimeException("Invalid map field number: " + number); } } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.api.servicecontrol.v1.MetricValueSetProto .internal_static_google_api_servicecontrol_v1_MetricValue_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.api.servicecontrol.v1.MetricValue.class, com.google.api.servicecontrol.v1.MetricValue.Builder.class); } // Construct using com.google.api.servicecontrol.v1.MetricValue.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { getStartTimeFieldBuilder(); getEndTimeFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); bitField0_ = 0; internalGetMutableLabels().clear(); startTime_ = null; if (startTimeBuilder_ != null) { startTimeBuilder_.dispose(); startTimeBuilder_ = null; } endTime_ = null; if (endTimeBuilder_ != null) { endTimeBuilder_.dispose(); endTimeBuilder_ = null; } if (distributionValueBuilder_ != null) { distributionValueBuilder_.clear(); } valueCase_ = 0; value_ = null; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.api.servicecontrol.v1.MetricValueSetProto .internal_static_google_api_servicecontrol_v1_MetricValue_descriptor; } @java.lang.Override public com.google.api.servicecontrol.v1.MetricValue getDefaultInstanceForType() { return com.google.api.servicecontrol.v1.MetricValue.getDefaultInstance(); } @java.lang.Override public com.google.api.servicecontrol.v1.MetricValue build() { com.google.api.servicecontrol.v1.MetricValue result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.google.api.servicecontrol.v1.MetricValue buildPartial() { com.google.api.servicecontrol.v1.MetricValue result = new com.google.api.servicecontrol.v1.MetricValue(this); if (bitField0_ != 0) { buildPartial0(result); } buildPartialOneofs(result); onBuilt(); return result; } private void buildPartial0(com.google.api.servicecontrol.v1.MetricValue result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { result.labels_ = internalGetLabels(); result.labels_.makeImmutable(); } int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000002) != 0)) { result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); to_bitField0_ |= 0x00000001; } if (((from_bitField0_ & 0x00000004) != 0)) { result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); to_bitField0_ |= 0x00000002; } result.bitField0_ |= to_bitField0_; } private void buildPartialOneofs(com.google.api.servicecontrol.v1.MetricValue result) { result.valueCase_ = valueCase_; result.value_ = this.value_; if (valueCase_ == 8 && distributionValueBuilder_ != null) { result.value_ = distributionValueBuilder_.build(); } } @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.google.api.servicecontrol.v1.MetricValue) { return mergeFrom((com.google.api.servicecontrol.v1.MetricValue) other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.google.api.servicecontrol.v1.MetricValue other) { if (other == com.google.api.servicecontrol.v1.MetricValue.getDefaultInstance()) return this; internalGetMutableLabels().mergeFrom(other.internalGetLabels()); bitField0_ |= 0x00000001; if (other.hasStartTime()) { mergeStartTime(other.getStartTime()); } if (other.hasEndTime()) { mergeEndTime(other.getEndTime()); } switch (other.getValueCase()) { case BOOL_VALUE: { setBoolValue(other.getBoolValue()); break; } case INT64_VALUE: { setInt64Value(other.getInt64Value()); break; } case DOUBLE_VALUE: { setDoubleValue(other.getDoubleValue()); break; } case STRING_VALUE: { valueCase_ = 7; value_ = other.value_; onChanged(); break; } case DISTRIBUTION_VALUE: { mergeDistributionValue(other.getDistributionValue()); break; } case VALUE_NOT_SET: { break; } } this.mergeUnknownFields(other.getUnknownFields()); 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 { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 10: { com.google.protobuf.MapEntry labels__ = input.readMessage( LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); internalGetMutableLabels() .getMutableMap() .put(labels__.getKey(), labels__.getValue()); bitField0_ |= 0x00000001; break; } // case 10 case 18: { input.readMessage(getStartTimeFieldBuilder().getBuilder(), extensionRegistry); bitField0_ |= 0x00000002; break; } // case 18 case 26: { input.readMessage(getEndTimeFieldBuilder().getBuilder(), extensionRegistry); bitField0_ |= 0x00000004; break; } // case 26 case 32: { value_ = input.readBool(); valueCase_ = 4; break; } // case 32 case 40: { value_ = input.readInt64(); valueCase_ = 5; break; } // case 40 case 49: { value_ = input.readDouble(); valueCase_ = 6; break; } // case 49 case 58: { java.lang.String s = input.readStringRequireUtf8(); valueCase_ = 7; value_ = s; break; } // case 58 case 66: { input.readMessage( getDistributionValueFieldBuilder().getBuilder(), extensionRegistry); valueCase_ = 8; break; } // case 66 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag } break; } // default: } // switch (tag) } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.unwrapIOException(); } finally { onChanged(); } // finally 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 com.google.protobuf.MapField 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() { if (labels_ == null) { labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); } if (!labels_.isMutable()) { labels_ = labels_.copy(); } bitField0_ |= 0x00000001; onChanged(); return labels_; } public int getLabelsCount() { return internalGetLabels().getMap().size(); } /** * * *
     * The labels describing the metric value.
     * See comments on [google.api.servicecontrol.v1.Operation.labels][google.api.servicecontrol.v1.Operation.labels] for
     * the overriding relationship.
     * Note that this map must not contain monitored resource labels.
     * 
* * map<string, string> labels = 1; */ @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(); } /** * * *
     * The labels describing the metric value.
     * See comments on [google.api.servicecontrol.v1.Operation.labels][google.api.servicecontrol.v1.Operation.labels] for
     * the overriding relationship.
     * Note that this map must not contain monitored resource labels.
     * 
* * map<string, string> labels = 1; */ @java.lang.Override public java.util.Map getLabelsMap() { return internalGetLabels().getMap(); } /** * * *
     * The labels describing the metric value.
     * See comments on [google.api.servicecontrol.v1.Operation.labels][google.api.servicecontrol.v1.Operation.labels] for
     * the overriding relationship.
     * Note that this map must not contain monitored resource labels.
     * 
* * map<string, string> labels = 1; */ @java.lang.Override public /* nullable */ java.lang.String getLabelsOrDefault( java.lang.String key, /* nullable */ java.lang.String defaultValue) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map map = internalGetLabels().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /** * * *
     * The labels describing the metric value.
     * See comments on [google.api.servicecontrol.v1.Operation.labels][google.api.servicecontrol.v1.Operation.labels] for
     * the overriding relationship.
     * Note that this map must not contain monitored resource labels.
     * 
* * map<string, string> labels = 1; */ @java.lang.Override public java.lang.String getLabelsOrThrow(java.lang.String key) { if (key == null) { throw new NullPointerException("map key"); } java.util.Map map = internalGetLabels().getMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } return map.get(key); } public Builder clearLabels() { bitField0_ = (bitField0_ & ~0x00000001); internalGetMutableLabels().getMutableMap().clear(); return this; } /** * * *
     * The labels describing the metric value.
     * See comments on [google.api.servicecontrol.v1.Operation.labels][google.api.servicecontrol.v1.Operation.labels] for
     * the overriding relationship.
     * Note that this map must not contain monitored resource labels.
     * 
* * map<string, string> labels = 1; */ public Builder removeLabels(java.lang.String key) { if (key == null) { throw new NullPointerException("map key"); } internalGetMutableLabels().getMutableMap().remove(key); return this; } /** Use alternate mutation accessors instead. */ @java.lang.Deprecated public java.util.Map getMutableLabels() { bitField0_ |= 0x00000001; return internalGetMutableLabels().getMutableMap(); } /** * * *
     * The labels describing the metric value.
     * See comments on [google.api.servicecontrol.v1.Operation.labels][google.api.servicecontrol.v1.Operation.labels] for
     * the overriding relationship.
     * Note that this map must not contain monitored resource labels.
     * 
* * map<string, string> labels = 1; */ public Builder putLabels(java.lang.String key, java.lang.String value) { if (key == null) { throw new NullPointerException("map key"); } if (value == null) { throw new NullPointerException("map value"); } internalGetMutableLabels().getMutableMap().put(key, value); bitField0_ |= 0x00000001; return this; } /** * * *
     * The labels describing the metric value.
     * See comments on [google.api.servicecontrol.v1.Operation.labels][google.api.servicecontrol.v1.Operation.labels] for
     * the overriding relationship.
     * Note that this map must not contain monitored resource labels.
     * 
* * map<string, string> labels = 1; */ public Builder putAllLabels(java.util.Map values) { internalGetMutableLabels().getMutableMap().putAll(values); bitField0_ |= 0x00000001; return this; } private com.google.protobuf.Timestamp startTime_; private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> startTimeBuilder_; /** * * *
     * The start of the time period over which this metric value's measurement
     * applies. The time period has different semantics for different metric
     * types (cumulative, delta, and gauge). See the metric definition
     * documentation in the service configuration for details. If not specified,
     * [google.api.servicecontrol.v1.Operation.start_time][google.api.servicecontrol.v1.Operation.start_time] will be used.
     * 
* * .google.protobuf.Timestamp start_time = 2; * * @return Whether the startTime field is set. */ public boolean hasStartTime() { return ((bitField0_ & 0x00000002) != 0); } /** * * *
     * The start of the time period over which this metric value's measurement
     * applies. The time period has different semantics for different metric
     * types (cumulative, delta, and gauge). See the metric definition
     * documentation in the service configuration for details. If not specified,
     * [google.api.servicecontrol.v1.Operation.start_time][google.api.servicecontrol.v1.Operation.start_time] will be used.
     * 
* * .google.protobuf.Timestamp start_time = 2; * * @return The startTime. */ public com.google.protobuf.Timestamp getStartTime() { if (startTimeBuilder_ == null) { return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; } else { return startTimeBuilder_.getMessage(); } } /** * * *
     * The start of the time period over which this metric value's measurement
     * applies. The time period has different semantics for different metric
     * types (cumulative, delta, and gauge). See the metric definition
     * documentation in the service configuration for details. If not specified,
     * [google.api.servicecontrol.v1.Operation.start_time][google.api.servicecontrol.v1.Operation.start_time] will be used.
     * 
* * .google.protobuf.Timestamp start_time = 2; */ public Builder setStartTime(com.google.protobuf.Timestamp value) { if (startTimeBuilder_ == null) { if (value == null) { throw new NullPointerException(); } startTime_ = value; } else { startTimeBuilder_.setMessage(value); } bitField0_ |= 0x00000002; onChanged(); return this; } /** * * *
     * The start of the time period over which this metric value's measurement
     * applies. The time period has different semantics for different metric
     * types (cumulative, delta, and gauge). See the metric definition
     * documentation in the service configuration for details. If not specified,
     * [google.api.servicecontrol.v1.Operation.start_time][google.api.servicecontrol.v1.Operation.start_time] will be used.
     * 
* * .google.protobuf.Timestamp start_time = 2; */ public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (startTimeBuilder_ == null) { startTime_ = builderForValue.build(); } else { startTimeBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000002; onChanged(); return this; } /** * * *
     * The start of the time period over which this metric value's measurement
     * applies. The time period has different semantics for different metric
     * types (cumulative, delta, and gauge). See the metric definition
     * documentation in the service configuration for details. If not specified,
     * [google.api.servicecontrol.v1.Operation.start_time][google.api.servicecontrol.v1.Operation.start_time] will be used.
     * 
* * .google.protobuf.Timestamp start_time = 2; */ public Builder mergeStartTime(com.google.protobuf.Timestamp value) { if (startTimeBuilder_ == null) { if (((bitField0_ & 0x00000002) != 0) && startTime_ != null && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { getStartTimeBuilder().mergeFrom(value); } else { startTime_ = value; } } else { startTimeBuilder_.mergeFrom(value); } if (startTime_ != null) { bitField0_ |= 0x00000002; onChanged(); } return this; } /** * * *
     * The start of the time period over which this metric value's measurement
     * applies. The time period has different semantics for different metric
     * types (cumulative, delta, and gauge). See the metric definition
     * documentation in the service configuration for details. If not specified,
     * [google.api.servicecontrol.v1.Operation.start_time][google.api.servicecontrol.v1.Operation.start_time] will be used.
     * 
* * .google.protobuf.Timestamp start_time = 2; */ public Builder clearStartTime() { bitField0_ = (bitField0_ & ~0x00000002); startTime_ = null; if (startTimeBuilder_ != null) { startTimeBuilder_.dispose(); startTimeBuilder_ = null; } onChanged(); return this; } /** * * *
     * The start of the time period over which this metric value's measurement
     * applies. The time period has different semantics for different metric
     * types (cumulative, delta, and gauge). See the metric definition
     * documentation in the service configuration for details. If not specified,
     * [google.api.servicecontrol.v1.Operation.start_time][google.api.servicecontrol.v1.Operation.start_time] will be used.
     * 
* * .google.protobuf.Timestamp start_time = 2; */ public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { bitField0_ |= 0x00000002; onChanged(); return getStartTimeFieldBuilder().getBuilder(); } /** * * *
     * The start of the time period over which this metric value's measurement
     * applies. The time period has different semantics for different metric
     * types (cumulative, delta, and gauge). See the metric definition
     * documentation in the service configuration for details. If not specified,
     * [google.api.servicecontrol.v1.Operation.start_time][google.api.servicecontrol.v1.Operation.start_time] will be used.
     * 
* * .google.protobuf.Timestamp start_time = 2; */ public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { if (startTimeBuilder_ != null) { return startTimeBuilder_.getMessageOrBuilder(); } else { return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; } } /** * * *
     * The start of the time period over which this metric value's measurement
     * applies. The time period has different semantics for different metric
     * types (cumulative, delta, and gauge). See the metric definition
     * documentation in the service configuration for details. If not specified,
     * [google.api.servicecontrol.v1.Operation.start_time][google.api.servicecontrol.v1.Operation.start_time] will be used.
     * 
* * .google.protobuf.Timestamp start_time = 2; */ private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> getStartTimeFieldBuilder() { if (startTimeBuilder_ == null) { startTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( getStartTime(), getParentForChildren(), isClean()); startTime_ = null; } return startTimeBuilder_; } private com.google.protobuf.Timestamp endTime_; private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> endTimeBuilder_; /** * * *
     * The end of the time period over which this metric value's measurement
     * applies.  If not specified,
     * [google.api.servicecontrol.v1.Operation.end_time][google.api.servicecontrol.v1.Operation.end_time] will be used.
     * 
* * .google.protobuf.Timestamp end_time = 3; * * @return Whether the endTime field is set. */ public boolean hasEndTime() { return ((bitField0_ & 0x00000004) != 0); } /** * * *
     * The end of the time period over which this metric value's measurement
     * applies.  If not specified,
     * [google.api.servicecontrol.v1.Operation.end_time][google.api.servicecontrol.v1.Operation.end_time] will be used.
     * 
* * .google.protobuf.Timestamp end_time = 3; * * @return The endTime. */ public com.google.protobuf.Timestamp getEndTime() { if (endTimeBuilder_ == null) { return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; } else { return endTimeBuilder_.getMessage(); } } /** * * *
     * The end of the time period over which this metric value's measurement
     * applies.  If not specified,
     * [google.api.servicecontrol.v1.Operation.end_time][google.api.servicecontrol.v1.Operation.end_time] will be used.
     * 
* * .google.protobuf.Timestamp end_time = 3; */ public Builder setEndTime(com.google.protobuf.Timestamp value) { if (endTimeBuilder_ == null) { if (value == null) { throw new NullPointerException(); } endTime_ = value; } else { endTimeBuilder_.setMessage(value); } bitField0_ |= 0x00000004; onChanged(); return this; } /** * * *
     * The end of the time period over which this metric value's measurement
     * applies.  If not specified,
     * [google.api.servicecontrol.v1.Operation.end_time][google.api.servicecontrol.v1.Operation.end_time] will be used.
     * 
* * .google.protobuf.Timestamp end_time = 3; */ public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { if (endTimeBuilder_ == null) { endTime_ = builderForValue.build(); } else { endTimeBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000004; onChanged(); return this; } /** * * *
     * The end of the time period over which this metric value's measurement
     * applies.  If not specified,
     * [google.api.servicecontrol.v1.Operation.end_time][google.api.servicecontrol.v1.Operation.end_time] will be used.
     * 
* * .google.protobuf.Timestamp end_time = 3; */ public Builder mergeEndTime(com.google.protobuf.Timestamp value) { if (endTimeBuilder_ == null) { if (((bitField0_ & 0x00000004) != 0) && endTime_ != null && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { getEndTimeBuilder().mergeFrom(value); } else { endTime_ = value; } } else { endTimeBuilder_.mergeFrom(value); } if (endTime_ != null) { bitField0_ |= 0x00000004; onChanged(); } return this; } /** * * *
     * The end of the time period over which this metric value's measurement
     * applies.  If not specified,
     * [google.api.servicecontrol.v1.Operation.end_time][google.api.servicecontrol.v1.Operation.end_time] will be used.
     * 
* * .google.protobuf.Timestamp end_time = 3; */ public Builder clearEndTime() { bitField0_ = (bitField0_ & ~0x00000004); endTime_ = null; if (endTimeBuilder_ != null) { endTimeBuilder_.dispose(); endTimeBuilder_ = null; } onChanged(); return this; } /** * * *
     * The end of the time period over which this metric value's measurement
     * applies.  If not specified,
     * [google.api.servicecontrol.v1.Operation.end_time][google.api.servicecontrol.v1.Operation.end_time] will be used.
     * 
* * .google.protobuf.Timestamp end_time = 3; */ public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { bitField0_ |= 0x00000004; onChanged(); return getEndTimeFieldBuilder().getBuilder(); } /** * * *
     * The end of the time period over which this metric value's measurement
     * applies.  If not specified,
     * [google.api.servicecontrol.v1.Operation.end_time][google.api.servicecontrol.v1.Operation.end_time] will be used.
     * 
* * .google.protobuf.Timestamp end_time = 3; */ public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { if (endTimeBuilder_ != null) { return endTimeBuilder_.getMessageOrBuilder(); } else { return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; } } /** * * *
     * The end of the time period over which this metric value's measurement
     * applies.  If not specified,
     * [google.api.servicecontrol.v1.Operation.end_time][google.api.servicecontrol.v1.Operation.end_time] will be used.
     * 
* * .google.protobuf.Timestamp end_time = 3; */ private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> getEndTimeFieldBuilder() { if (endTimeBuilder_ == null) { endTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( getEndTime(), getParentForChildren(), isClean()); endTime_ = null; } return endTimeBuilder_; } /** * * *
     * A boolean value.
     * 
* * bool bool_value = 4; * * @return Whether the boolValue field is set. */ public boolean hasBoolValue() { return valueCase_ == 4; } /** * * *
     * A boolean value.
     * 
* * bool bool_value = 4; * * @return The boolValue. */ public boolean getBoolValue() { if (valueCase_ == 4) { return (java.lang.Boolean) value_; } return false; } /** * * *
     * A boolean value.
     * 
* * bool bool_value = 4; * * @param value The boolValue to set. * @return This builder for chaining. */ public Builder setBoolValue(boolean value) { valueCase_ = 4; value_ = value; onChanged(); return this; } /** * * *
     * A boolean value.
     * 
* * bool bool_value = 4; * * @return This builder for chaining. */ public Builder clearBoolValue() { if (valueCase_ == 4) { valueCase_ = 0; value_ = null; onChanged(); } return this; } /** * * *
     * A signed 64-bit integer value.
     * 
* * int64 int64_value = 5; * * @return Whether the int64Value field is set. */ public boolean hasInt64Value() { return valueCase_ == 5; } /** * * *
     * A signed 64-bit integer value.
     * 
* * int64 int64_value = 5; * * @return The int64Value. */ public long getInt64Value() { if (valueCase_ == 5) { return (java.lang.Long) value_; } return 0L; } /** * * *
     * A signed 64-bit integer value.
     * 
* * int64 int64_value = 5; * * @param value The int64Value to set. * @return This builder for chaining. */ public Builder setInt64Value(long value) { valueCase_ = 5; value_ = value; onChanged(); return this; } /** * * *
     * A signed 64-bit integer value.
     * 
* * int64 int64_value = 5; * * @return This builder for chaining. */ public Builder clearInt64Value() { if (valueCase_ == 5) { valueCase_ = 0; value_ = null; onChanged(); } return this; } /** * * *
     * A double precision floating point value.
     * 
* * double double_value = 6; * * @return Whether the doubleValue field is set. */ public boolean hasDoubleValue() { return valueCase_ == 6; } /** * * *
     * A double precision floating point value.
     * 
* * double double_value = 6; * * @return The doubleValue. */ public double getDoubleValue() { if (valueCase_ == 6) { return (java.lang.Double) value_; } return 0D; } /** * * *
     * A double precision floating point value.
     * 
* * double double_value = 6; * * @param value The doubleValue to set. * @return This builder for chaining. */ public Builder setDoubleValue(double value) { valueCase_ = 6; value_ = value; onChanged(); return this; } /** * * *
     * A double precision floating point value.
     * 
* * double double_value = 6; * * @return This builder for chaining. */ public Builder clearDoubleValue() { if (valueCase_ == 6) { valueCase_ = 0; value_ = null; onChanged(); } return this; } /** * * *
     * A text string value.
     * 
* * string string_value = 7; * * @return Whether the stringValue field is set. */ @java.lang.Override public boolean hasStringValue() { return valueCase_ == 7; } /** * * *
     * A text string value.
     * 
* * string string_value = 7; * * @return The stringValue. */ @java.lang.Override public java.lang.String getStringValue() { java.lang.Object ref = ""; if (valueCase_ == 7) { ref = value_; } if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (valueCase_ == 7) { value_ = s; } return s; } else { return (java.lang.String) ref; } } /** * * *
     * A text string value.
     * 
* * string string_value = 7; * * @return The bytes for stringValue. */ @java.lang.Override public com.google.protobuf.ByteString getStringValueBytes() { java.lang.Object ref = ""; if (valueCase_ == 7) { ref = value_; } if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); if (valueCase_ == 7) { value_ = b; } return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * * *
     * A text string value.
     * 
* * string string_value = 7; * * @param value The stringValue to set. * @return This builder for chaining. */ public Builder setStringValue(java.lang.String value) { if (value == null) { throw new NullPointerException(); } valueCase_ = 7; value_ = value; onChanged(); return this; } /** * * *
     * A text string value.
     * 
* * string string_value = 7; * * @return This builder for chaining. */ public Builder clearStringValue() { if (valueCase_ == 7) { valueCase_ = 0; value_ = null; onChanged(); } return this; } /** * * *
     * A text string value.
     * 
* * string string_value = 7; * * @param value The bytes for stringValue to set. * @return This builder for chaining. */ public Builder setStringValueBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); valueCase_ = 7; value_ = value; onChanged(); return this; } private com.google.protobuf.SingleFieldBuilderV3< com.google.api.servicecontrol.v1.Distribution, com.google.api.servicecontrol.v1.Distribution.Builder, com.google.api.servicecontrol.v1.DistributionOrBuilder> distributionValueBuilder_; /** * * *
     * A distribution value.
     * 
* * .google.api.servicecontrol.v1.Distribution distribution_value = 8; * * @return Whether the distributionValue field is set. */ @java.lang.Override public boolean hasDistributionValue() { return valueCase_ == 8; } /** * * *
     * A distribution value.
     * 
* * .google.api.servicecontrol.v1.Distribution distribution_value = 8; * * @return The distributionValue. */ @java.lang.Override public com.google.api.servicecontrol.v1.Distribution getDistributionValue() { if (distributionValueBuilder_ == null) { if (valueCase_ == 8) { return (com.google.api.servicecontrol.v1.Distribution) value_; } return com.google.api.servicecontrol.v1.Distribution.getDefaultInstance(); } else { if (valueCase_ == 8) { return distributionValueBuilder_.getMessage(); } return com.google.api.servicecontrol.v1.Distribution.getDefaultInstance(); } } /** * * *
     * A distribution value.
     * 
* * .google.api.servicecontrol.v1.Distribution distribution_value = 8; */ public Builder setDistributionValue(com.google.api.servicecontrol.v1.Distribution value) { if (distributionValueBuilder_ == null) { if (value == null) { throw new NullPointerException(); } value_ = value; onChanged(); } else { distributionValueBuilder_.setMessage(value); } valueCase_ = 8; return this; } /** * * *
     * A distribution value.
     * 
* * .google.api.servicecontrol.v1.Distribution distribution_value = 8; */ public Builder setDistributionValue( com.google.api.servicecontrol.v1.Distribution.Builder builderForValue) { if (distributionValueBuilder_ == null) { value_ = builderForValue.build(); onChanged(); } else { distributionValueBuilder_.setMessage(builderForValue.build()); } valueCase_ = 8; return this; } /** * * *
     * A distribution value.
     * 
* * .google.api.servicecontrol.v1.Distribution distribution_value = 8; */ public Builder mergeDistributionValue(com.google.api.servicecontrol.v1.Distribution value) { if (distributionValueBuilder_ == null) { if (valueCase_ == 8 && value_ != com.google.api.servicecontrol.v1.Distribution.getDefaultInstance()) { value_ = com.google.api.servicecontrol.v1.Distribution.newBuilder( (com.google.api.servicecontrol.v1.Distribution) value_) .mergeFrom(value) .buildPartial(); } else { value_ = value; } onChanged(); } else { if (valueCase_ == 8) { distributionValueBuilder_.mergeFrom(value); } else { distributionValueBuilder_.setMessage(value); } } valueCase_ = 8; return this; } /** * * *
     * A distribution value.
     * 
* * .google.api.servicecontrol.v1.Distribution distribution_value = 8; */ public Builder clearDistributionValue() { if (distributionValueBuilder_ == null) { if (valueCase_ == 8) { valueCase_ = 0; value_ = null; onChanged(); } } else { if (valueCase_ == 8) { valueCase_ = 0; value_ = null; } distributionValueBuilder_.clear(); } return this; } /** * * *
     * A distribution value.
     * 
* * .google.api.servicecontrol.v1.Distribution distribution_value = 8; */ public com.google.api.servicecontrol.v1.Distribution.Builder getDistributionValueBuilder() { return getDistributionValueFieldBuilder().getBuilder(); } /** * * *
     * A distribution value.
     * 
* * .google.api.servicecontrol.v1.Distribution distribution_value = 8; */ @java.lang.Override public com.google.api.servicecontrol.v1.DistributionOrBuilder getDistributionValueOrBuilder() { if ((valueCase_ == 8) && (distributionValueBuilder_ != null)) { return distributionValueBuilder_.getMessageOrBuilder(); } else { if (valueCase_ == 8) { return (com.google.api.servicecontrol.v1.Distribution) value_; } return com.google.api.servicecontrol.v1.Distribution.getDefaultInstance(); } } /** * * *
     * A distribution value.
     * 
* * .google.api.servicecontrol.v1.Distribution distribution_value = 8; */ private com.google.protobuf.SingleFieldBuilderV3< com.google.api.servicecontrol.v1.Distribution, com.google.api.servicecontrol.v1.Distribution.Builder, com.google.api.servicecontrol.v1.DistributionOrBuilder> getDistributionValueFieldBuilder() { if (distributionValueBuilder_ == null) { if (!(valueCase_ == 8)) { value_ = com.google.api.servicecontrol.v1.Distribution.getDefaultInstance(); } distributionValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.api.servicecontrol.v1.Distribution, com.google.api.servicecontrol.v1.Distribution.Builder, com.google.api.servicecontrol.v1.DistributionOrBuilder>( (com.google.api.servicecontrol.v1.Distribution) value_, getParentForChildren(), isClean()); value_ = null; } valueCase_ = 8; onChanged(); return distributionValueBuilder_; } @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:google.api.servicecontrol.v1.MetricValue) } // @@protoc_insertion_point(class_scope:google.api.servicecontrol.v1.MetricValue) private static final com.google.api.servicecontrol.v1.MetricValue DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.api.servicecontrol.v1.MetricValue(); } public static com.google.api.servicecontrol.v1.MetricValue getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public MetricValue parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { Builder builder = newBuilder(); try { builder.mergeFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(builder.buildPartial()); } catch (com.google.protobuf.UninitializedMessageException e) { throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e) .setUnfinishedMessage(builder.buildPartial()); } return builder.buildPartial(); } }; public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override public com.google.api.servicecontrol.v1.MetricValue getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy