Package com.google.api
Class MetricRule.Builder
- java.lang.Object
-
- com.google.protobuf.AbstractMessageLite.Builder
-
- com.google.protobuf.AbstractMessage.Builder<BuilderType>
-
- com.google.protobuf.GeneratedMessageV3.Builder<MetricRule.Builder>
-
- com.google.api.MetricRule.Builder
-
- All Implemented Interfaces:
MetricRuleOrBuilder,com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Cloneable
- Enclosing class:
- MetricRule
public static final class MetricRule.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<MetricRule.Builder> implements MetricRuleOrBuilder
Bind API methods to metrics. Binding a method to a metric causes that metric's configured quota behaviors to apply to the method call.
Protobuf typegoogle.api.MetricRule
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description MetricRule.BuilderaddRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)MetricRulebuild()MetricRulebuildPartial()MetricRule.Builderclear()MetricRule.BuilderclearField(com.google.protobuf.Descriptors.FieldDescriptor field)MetricRule.BuilderclearMetricCosts()MetricRule.BuilderclearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)MetricRule.BuilderclearSelector()Selects the methods to which this rule applies.MetricRule.Builderclone()booleancontainsMetricCosts(String key)Metrics to update when the selected methods are called, and the associated cost applied to each metric.MetricRulegetDefaultInstanceForType()static com.google.protobuf.Descriptors.DescriptorgetDescriptor()com.google.protobuf.Descriptors.DescriptorgetDescriptorForType()Map<String,Long>getMetricCosts()Deprecated.intgetMetricCostsCount()Metrics to update when the selected methods are called, and the associated cost applied to each metric.Map<String,Long>getMetricCostsMap()Metrics to update when the selected methods are called, and the associated cost applied to each metric.longgetMetricCostsOrDefault(String key, long defaultValue)Metrics to update when the selected methods are called, and the associated cost applied to each metric.longgetMetricCostsOrThrow(String key)Metrics to update when the selected methods are called, and the associated cost applied to each metric.Map<String,Long>getMutableMetricCosts()Deprecated.StringgetSelector()Selects the methods to which this rule applies.com.google.protobuf.ByteStringgetSelectorBytes()Selects the methods to which this rule applies.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()protected com.google.protobuf.MapFieldinternalGetMapField(int number)protected com.google.protobuf.MapFieldinternalGetMutableMapField(int number)booleanisInitialized()MetricRule.BuildermergeFrom(MetricRule other)MetricRule.BuildermergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)MetricRule.BuildermergeFrom(com.google.protobuf.Message other)MetricRule.BuildermergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)MetricRule.BuilderputAllMetricCosts(Map<String,Long> values)Metrics to update when the selected methods are called, and the associated cost applied to each metric.MetricRule.BuilderputMetricCosts(String key, long value)Metrics to update when the selected methods are called, and the associated cost applied to each metric.MetricRule.BuilderremoveMetricCosts(String key)Metrics to update when the selected methods are called, and the associated cost applied to each metric.MetricRule.BuildersetField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)MetricRule.BuildersetRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)MetricRule.BuildersetSelector(String value)Selects the methods to which this rule applies.MetricRule.BuildersetSelectorBytes(com.google.protobuf.ByteString value)Selects the methods to which this rule applies.MetricRule.BuildersetUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)-
Methods inherited from class com.google.protobuf.GeneratedMessageV3.Builder
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, isClean, markClean, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setUnknownFieldSetBuilder, setUnknownFieldsProto3
-
Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString
-
Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageException
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Method Detail
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
-
internalGetMapField
protected com.google.protobuf.MapField internalGetMapField(int number)
- Overrides:
internalGetMapFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<MetricRule.Builder>
-
internalGetMutableMapField
protected com.google.protobuf.MapField internalGetMutableMapField(int number)
- Overrides:
internalGetMutableMapFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<MetricRule.Builder>
-
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessageV3.Builder<MetricRule.Builder>
-
clear
public MetricRule.Builder clear()
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessageV3.Builder<MetricRule.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessageV3.Builder<MetricRule.Builder>
-
getDefaultInstanceForType
public MetricRule getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
public MetricRule build()
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
public MetricRule buildPartial()
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
clone
public MetricRule.Builder clone()
- Specified by:
clonein interfacecom.google.protobuf.Message.Builder- Specified by:
clonein interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clonein classcom.google.protobuf.GeneratedMessageV3.Builder<MetricRule.Builder>
-
setField
public MetricRule.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
- Specified by:
setFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<MetricRule.Builder>
-
clearField
public MetricRule.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
- Specified by:
clearFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
clearFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<MetricRule.Builder>
-
clearOneof
public MetricRule.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
- Specified by:
clearOneofin interfacecom.google.protobuf.Message.Builder- Overrides:
clearOneofin classcom.google.protobuf.GeneratedMessageV3.Builder<MetricRule.Builder>
-
setRepeatedField
public MetricRule.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
- Specified by:
setRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<MetricRule.Builder>
-
addRepeatedField
public MetricRule.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
- Specified by:
addRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
addRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<MetricRule.Builder>
-
mergeFrom
public MetricRule.Builder mergeFrom(com.google.protobuf.Message other)
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<MetricRule.Builder>
-
mergeFrom
public MetricRule.Builder mergeFrom(MetricRule other)
-
isInitialized
public final boolean isInitialized()
- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessageV3.Builder<MetricRule.Builder>
-
mergeFrom
public MetricRule.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<MetricRule.Builder>- Throws:
IOException
-
getSelector
public String getSelector()
Selects the methods to which this rule applies. Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
string selector = 1;- Specified by:
getSelectorin interfaceMetricRuleOrBuilder- Returns:
- The selector.
-
getSelectorBytes
public com.google.protobuf.ByteString getSelectorBytes()
Selects the methods to which this rule applies. Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
string selector = 1;- Specified by:
getSelectorBytesin interfaceMetricRuleOrBuilder- Returns:
- The bytes for selector.
-
setSelector
public MetricRule.Builder setSelector(String value)
Selects the methods to which this rule applies. Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
string selector = 1;- Parameters:
value- The selector to set.- Returns:
- This builder for chaining.
-
clearSelector
public MetricRule.Builder clearSelector()
Selects the methods to which this rule applies. Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
string selector = 1;- Returns:
- This builder for chaining.
-
setSelectorBytes
public MetricRule.Builder setSelectorBytes(com.google.protobuf.ByteString value)
Selects the methods to which this rule applies. Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
string selector = 1;- Parameters:
value- The bytes for selector to set.- Returns:
- This builder for chaining.
-
getMetricCostsCount
public int getMetricCostsCount()
Description copied from interface:MetricRuleOrBuilderMetrics to update when the selected methods are called, and the associated cost applied to each metric. The key of the map is the metric name, and the values are the amount increased for the metric against which the quota limits are defined. The value must not be negative.
map<string, int64> metric_costs = 2;- Specified by:
getMetricCostsCountin interfaceMetricRuleOrBuilder
-
containsMetricCosts
public boolean containsMetricCosts(String key)
Metrics to update when the selected methods are called, and the associated cost applied to each metric. The key of the map is the metric name, and the values are the amount increased for the metric against which the quota limits are defined. The value must not be negative.
map<string, int64> metric_costs = 2;- Specified by:
containsMetricCostsin interfaceMetricRuleOrBuilder
-
getMetricCosts
@Deprecated public Map<String,Long> getMetricCosts()
Deprecated.UsegetMetricCostsMap()instead.- Specified by:
getMetricCostsin interfaceMetricRuleOrBuilder
-
getMetricCostsMap
public Map<String,Long> getMetricCostsMap()
Metrics to update when the selected methods are called, and the associated cost applied to each metric. The key of the map is the metric name, and the values are the amount increased for the metric against which the quota limits are defined. The value must not be negative.
map<string, int64> metric_costs = 2;- Specified by:
getMetricCostsMapin interfaceMetricRuleOrBuilder
-
getMetricCostsOrDefault
public long getMetricCostsOrDefault(String key, long defaultValue)
Metrics to update when the selected methods are called, and the associated cost applied to each metric. The key of the map is the metric name, and the values are the amount increased for the metric against which the quota limits are defined. The value must not be negative.
map<string, int64> metric_costs = 2;- Specified by:
getMetricCostsOrDefaultin interfaceMetricRuleOrBuilder
-
getMetricCostsOrThrow
public long getMetricCostsOrThrow(String key)
Metrics to update when the selected methods are called, and the associated cost applied to each metric. The key of the map is the metric name, and the values are the amount increased for the metric against which the quota limits are defined. The value must not be negative.
map<string, int64> metric_costs = 2;- Specified by:
getMetricCostsOrThrowin interfaceMetricRuleOrBuilder
-
clearMetricCosts
public MetricRule.Builder clearMetricCosts()
-
removeMetricCosts
public MetricRule.Builder removeMetricCosts(String key)
Metrics to update when the selected methods are called, and the associated cost applied to each metric. The key of the map is the metric name, and the values are the amount increased for the metric against which the quota limits are defined. The value must not be negative.
map<string, int64> metric_costs = 2;
-
getMutableMetricCosts
@Deprecated public Map<String,Long> getMutableMetricCosts()
Deprecated.Use alternate mutation accessors instead.
-
putMetricCosts
public MetricRule.Builder putMetricCosts(String key, long value)
Metrics to update when the selected methods are called, and the associated cost applied to each metric. The key of the map is the metric name, and the values are the amount increased for the metric against which the quota limits are defined. The value must not be negative.
map<string, int64> metric_costs = 2;
-
putAllMetricCosts
public MetricRule.Builder putAllMetricCosts(Map<String,Long> values)
Metrics to update when the selected methods are called, and the associated cost applied to each metric. The key of the map is the metric name, and the values are the amount increased for the metric against which the quota limits are defined. The value must not be negative.
map<string, int64> metric_costs = 2;
-
setUnknownFields
public final MetricRule.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
- Specified by:
setUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
setUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<MetricRule.Builder>
-
mergeUnknownFields
public final MetricRule.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
- Specified by:
mergeUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<MetricRule.Builder>
-
-