public static final class MetricRule.Builder extends 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 type google.api.MetricRule
Inherited Members
com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)
Static Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Methods
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public MetricRule.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Overrides
build()
public MetricRule build()
buildPartial()
public MetricRule buildPartial()
clear()
public MetricRule.Builder clear()
Overrides
clearField(Descriptors.FieldDescriptor field)
public MetricRule.Builder clearField(Descriptors.FieldDescriptor field)
Overrides
clearMetricCosts()
public MetricRule.Builder clearMetricCosts()
clearOneof(Descriptors.OneofDescriptor oneof)
public MetricRule.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Overrides
clearSelector()
public MetricRule.Builder clearSelector()
Selects the methods to which this rule applies.
Refer to selector for syntax
details.
string selector = 1;
clone()
public MetricRule.Builder clone()
Overrides
containsMetricCosts(String key)
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;
Parameter |
Name |
Description |
key |
String
|
getDefaultInstanceForType()
public MetricRule getDefaultInstanceForType()
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
Overrides
getMetricCosts() (deprecated)
public Map<String,Long> getMetricCosts()
getMetricCostsCount()
public int getMetricCostsCount()
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;
Returns |
Type |
Description |
int |
|
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;
getMetricCostsOrDefault(String key, long defaultValue)
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;
Parameters |
Name |
Description |
key |
String
|
defaultValue |
long
|
Returns |
Type |
Description |
long |
|
getMetricCostsOrThrow(String key)
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;
Parameter |
Name |
Description |
key |
String
|
Returns |
Type |
Description |
long |
|
getMutableMetricCosts() (deprecated)
public Map<String,Long> getMutableMetricCosts()
Use alternate mutation accessors instead.
getSelector()
public String getSelector()
Selects the methods to which this rule applies.
Refer to selector for syntax
details.
string selector = 1;
Returns |
Type |
Description |
String |
The selector.
|
getSelectorBytes()
public ByteString getSelectorBytes()
Selects the methods to which this rule applies.
Refer to selector for syntax
details.
string selector = 1;
Returns |
Type |
Description |
ByteString |
The bytes for selector.
|
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Overrides
internalGetMapFieldReflection(int number)
protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter |
Name |
Description |
number |
int
|
Returns |
Type |
Description |
com.google.protobuf.MapFieldReflectionAccessor |
|
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)
internalGetMutableMapFieldReflection(int number)
protected MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number)
Parameter |
Name |
Description |
number |
int
|
Returns |
Type |
Description |
com.google.protobuf.MapFieldReflectionAccessor |
|
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)
isInitialized()
public final boolean isInitialized()
Overrides
mergeFrom(MetricRule other)
public MetricRule.Builder mergeFrom(MetricRule other)
public MetricRule.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Overrides
mergeFrom(Message other)
public MetricRule.Builder mergeFrom(Message other)
Parameter |
Name |
Description |
other |
Message
|
Overrides
mergeUnknownFields(UnknownFieldSet unknownFields)
public final MetricRule.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Overrides
putAllMetricCosts(Map<String,Long> values)
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;
putMetricCosts(String key, long value)
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;
removeMetricCosts(String key)
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;
Parameter |
Name |
Description |
key |
String
|
setField(Descriptors.FieldDescriptor field, Object value)
public MetricRule.Builder setField(Descriptors.FieldDescriptor field, Object value)
Overrides
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public MetricRule.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Overrides
setSelector(String value)
public MetricRule.Builder setSelector(String value)
Selects the methods to which this rule applies.
Refer to selector for syntax
details.
string selector = 1;
Parameter |
Name |
Description |
value |
String
The selector to set.
|
setSelectorBytes(ByteString value)
public MetricRule.Builder setSelectorBytes(ByteString value)
Selects the methods to which this rule applies.
Refer to selector for syntax
details.
string selector = 1;
Parameter |
Name |
Description |
value |
ByteString
The bytes for selector to set.
|
setUnknownFields(UnknownFieldSet unknownFields)
public final MetricRule.Builder setUnknownFields(UnknownFieldSet unknownFields)
Overrides