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.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()
Returns
Methods
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public MetricRule.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Returns
Overrides
build()
public MetricRule build()
Returns
buildPartial()
public MetricRule buildPartial()
Returns
clear()
public MetricRule.Builder clear()
Returns
Overrides
clearField(Descriptors.FieldDescriptor field)
public MetricRule.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Returns
Overrides
clearMetricCosts()
public MetricRule.Builder clearMetricCosts()
Returns
clearOneof(Descriptors.OneofDescriptor oneof)
public MetricRule.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Returns
Overrides
clearSelector()
public MetricRule.Builder clearSelector()
Selects the methods to which this rule applies.
Refer to selector for syntax details.
string selector = 1;
Returns
clone()
public MetricRule.Builder clone()
Returns
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
Returns
getDefaultInstanceForType()
public MetricRule getDefaultInstanceForType()
Returns
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
Returns
Overrides
getMetricCosts()
public Map<String,Long> getMetricCosts()
Returns
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
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;
Returns
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
Returns
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
Returns
getMutableMetricCosts()
public Map<String,Long> getMutableMetricCosts()
Use alternate mutation accessors instead.
Returns
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
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Overrides
internalGetMapField(int number)
protected MapField internalGetMapField(int number)
Parameter
Returns
Overrides
internalGetMutableMapField(int number)
protected MapField internalGetMutableMapField(int number)
Parameter
Returns
Overrides
isInitialized()
public final boolean isInitialized()
Returns
Overrides
mergeFrom(MetricRule other)
public MetricRule.Builder mergeFrom(MetricRule other)
Parameter
Returns
public MetricRule.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Overrides
Exceptions
mergeFrom(Message other)
public MetricRule.Builder mergeFrom(Message other)
Parameter
Returns
Overrides
mergeUnknownFields(UnknownFieldSet unknownFields)
public final MetricRule.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Returns
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;
Parameter
Returns
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;
Parameters
Returns
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
Returns
setField(Descriptors.FieldDescriptor field, Object value)
public MetricRule.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Returns
Overrides
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public MetricRule.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Returns
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.
|
Returns
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.
|
Returns
setUnknownFields(UnknownFieldSet unknownFields)
public final MetricRule.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Returns
Overrides