Package com.google.api
Class MetricRule.Builder
- java.lang.Object
-
- com.google.protobuf.AbstractMessageLite.Builder
-
- com.google.protobuf.AbstractMessage.Builder<BuilderT>
-
- com.google.protobuf.GeneratedMessage.Builder<BuilderT>
-
- com.google.protobuf.GeneratedMessage.ExtendableBuilder<com.google.protobuf.GeneratedMessageV3,BuilderT>
-
- com.google.protobuf.GeneratedMessageV3.Builder<MetricRule.Builder>
-
- com.google.api.MetricRule.Builder
-
- All Implemented Interfaces:
MetricRuleOrBuilder
,com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<com.google.protobuf.GeneratedMessageV3>
,com.google.protobuf.Message.Builder
,com.google.protobuf.MessageLite.Builder
,com.google.protobuf.MessageLiteOrBuilder
,com.google.protobuf.MessageOrBuilder
,java.lang.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.Builder
addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
MetricRule
build()
MetricRule
buildPartial()
MetricRule.Builder
clear()
MetricRule.Builder
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
MetricRule.Builder
clearMetricCosts()
MetricRule.Builder
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
MetricRule.Builder
clearSelector()
Selects the methods to which this rule applies.MetricRule.Builder
clone()
boolean
containsMetricCosts(java.lang.String key)
Metrics to update when the selected methods are called, and the associated cost applied to each metric.MetricRule
getDefaultInstanceForType()
static com.google.protobuf.Descriptors.Descriptor
getDescriptor()
com.google.protobuf.Descriptors.Descriptor
getDescriptorForType()
java.util.Map<java.lang.String,java.lang.Long>
getMetricCosts()
Deprecated.int
getMetricCostsCount()
Metrics to update when the selected methods are called, and the associated cost applied to each metric.java.util.Map<java.lang.String,java.lang.Long>
getMetricCostsMap()
Metrics to update when the selected methods are called, and the associated cost applied to each metric.long
getMetricCostsOrDefault(java.lang.String key, long defaultValue)
Metrics to update when the selected methods are called, and the associated cost applied to each metric.long
getMetricCostsOrThrow(java.lang.String key)
Metrics to update when the selected methods are called, and the associated cost applied to each metric.java.util.Map<java.lang.String,java.lang.Long>
getMutableMetricCosts()
Deprecated.java.lang.String
getSelector()
Selects the methods to which this rule applies.com.google.protobuf.ByteString
getSelectorBytes()
Selects the methods to which this rule applies.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()
protected com.google.protobuf.MapFieldReflectionAccessor
internalGetMapFieldReflection(int number)
protected com.google.protobuf.MapFieldReflectionAccessor
internalGetMutableMapFieldReflection(int number)
boolean
isInitialized()
MetricRule.Builder
mergeFrom(MetricRule other)
MetricRule.Builder
mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
MetricRule.Builder
mergeFrom(com.google.protobuf.Message other)
MetricRule.Builder
mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
MetricRule.Builder
putAllMetricCosts(java.util.Map<java.lang.String,java.lang.Long> values)
Metrics to update when the selected methods are called, and the associated cost applied to each metric.MetricRule.Builder
putMetricCosts(java.lang.String key, long value)
Metrics to update when the selected methods are called, and the associated cost applied to each metric.MetricRule.Builder
removeMetricCosts(java.lang.String key)
Metrics to update when the selected methods are called, and the associated cost applied to each metric.MetricRule.Builder
setField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
MetricRule.Builder
setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)
MetricRule.Builder
setSelector(java.lang.String value)
Selects the methods to which this rule applies.MetricRule.Builder
setSelectorBytes(com.google.protobuf.ByteString value)
Selects the methods to which this rule applies.MetricRule.Builder
setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
-
Methods inherited from class com.google.protobuf.GeneratedMessage.ExtendableBuilder
addExtension, clearExtension, extensionsAreInitialized, getAllFields, getExtension, getExtension, getExtensionCount, getField, getFieldBuilder, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, hasExtension, hasField, mergeExtensionFields, newBuilderForField, parseUnknownField, setExtension, setExtension
-
Methods inherited from class com.google.protobuf.GeneratedMessage.Builder
getOneofFieldDescriptor, getUnknownFields, getUnknownFieldSetBuilder, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, onBuilt, onChanged, 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()
-
internalGetMapFieldReflection
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
- Overrides:
internalGetMapFieldReflection
in classcom.google.protobuf.GeneratedMessage.Builder<MetricRule.Builder>
-
internalGetMutableMapFieldReflection
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number)
- Overrides:
internalGetMutableMapFieldReflection
in classcom.google.protobuf.GeneratedMessage.Builder<MetricRule.Builder>
-
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
- Overrides:
internalGetFieldAccessorTable
in classcom.google.protobuf.GeneratedMessageV3.Builder<MetricRule.Builder>
-
clear
public MetricRule.Builder clear()
- Specified by:
clear
in interfacecom.google.protobuf.Message.Builder
- Specified by:
clear
in interfacecom.google.protobuf.MessageLite.Builder
- Overrides:
clear
in classcom.google.protobuf.GeneratedMessageV3.Builder<MetricRule.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
- Specified by:
getDescriptorForType
in interfacecom.google.protobuf.Message.Builder
- Specified by:
getDescriptorForType
in interfacecom.google.protobuf.MessageOrBuilder
- Overrides:
getDescriptorForType
in classcom.google.protobuf.GeneratedMessage.Builder<MetricRule.Builder>
-
getDefaultInstanceForType
public MetricRule getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<com.google.protobuf.GeneratedMessageV3>
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageOrBuilder
-
build
public MetricRule build()
- Specified by:
build
in interfacecom.google.protobuf.Message.Builder
- Specified by:
build
in interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
public MetricRule buildPartial()
- Specified by:
buildPartial
in interfacecom.google.protobuf.Message.Builder
- Specified by:
buildPartial
in interfacecom.google.protobuf.MessageLite.Builder
-
clone
public MetricRule.Builder clone()
- Specified by:
clone
in interfacecom.google.protobuf.Message.Builder
- Specified by:
clone
in interfacecom.google.protobuf.MessageLite.Builder
- Overrides:
clone
in classcom.google.protobuf.GeneratedMessageV3.Builder<MetricRule.Builder>
-
setField
public MetricRule.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
- Specified by:
setField
in interfacecom.google.protobuf.Message.Builder
- Overrides:
setField
in classcom.google.protobuf.GeneratedMessageV3.Builder<MetricRule.Builder>
-
clearField
public MetricRule.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
- Specified by:
clearField
in interfacecom.google.protobuf.Message.Builder
- Overrides:
clearField
in classcom.google.protobuf.GeneratedMessageV3.Builder<MetricRule.Builder>
-
clearOneof
public MetricRule.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
- Specified by:
clearOneof
in interfacecom.google.protobuf.Message.Builder
- Overrides:
clearOneof
in classcom.google.protobuf.GeneratedMessageV3.Builder<MetricRule.Builder>
-
setRepeatedField
public MetricRule.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)
- Specified by:
setRepeatedField
in interfacecom.google.protobuf.Message.Builder
- Overrides:
setRepeatedField
in classcom.google.protobuf.GeneratedMessageV3.Builder<MetricRule.Builder>
-
addRepeatedField
public MetricRule.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
- Specified by:
addRepeatedField
in interfacecom.google.protobuf.Message.Builder
- Overrides:
addRepeatedField
in classcom.google.protobuf.GeneratedMessageV3.Builder<MetricRule.Builder>
-
mergeFrom
public MetricRule.Builder mergeFrom(com.google.protobuf.Message other)
- Specified by:
mergeFrom
in interfacecom.google.protobuf.Message.Builder
- Overrides:
mergeFrom
in classcom.google.protobuf.AbstractMessage.Builder<MetricRule.Builder>
-
mergeFrom
public MetricRule.Builder mergeFrom(MetricRule other)
-
isInitialized
public final boolean isInitialized()
- Specified by:
isInitialized
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Overrides:
isInitialized
in classcom.google.protobuf.GeneratedMessage.ExtendableBuilder<com.google.protobuf.GeneratedMessageV3,MetricRule.Builder>
-
mergeFrom
public MetricRule.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
- Specified by:
mergeFrom
in interfacecom.google.protobuf.Message.Builder
- Specified by:
mergeFrom
in interfacecom.google.protobuf.MessageLite.Builder
- Overrides:
mergeFrom
in classcom.google.protobuf.AbstractMessage.Builder<MetricRule.Builder>
- Throws:
java.io.IOException
-
getSelector
public java.lang.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:
getSelector
in 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:
getSelectorBytes
in interfaceMetricRuleOrBuilder
- Returns:
- The bytes for selector.
-
setSelector
public MetricRule.Builder setSelector(java.lang.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:MetricRuleOrBuilder
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:
getMetricCostsCount
in interfaceMetricRuleOrBuilder
-
containsMetricCosts
public boolean containsMetricCosts(java.lang.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:
containsMetricCosts
in interfaceMetricRuleOrBuilder
-
getMetricCosts
@Deprecated public java.util.Map<java.lang.String,java.lang.Long> getMetricCosts()
Deprecated.UsegetMetricCostsMap()
instead.- Specified by:
getMetricCosts
in interfaceMetricRuleOrBuilder
-
getMetricCostsMap
public java.util.Map<java.lang.String,java.lang.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:
getMetricCostsMap
in interfaceMetricRuleOrBuilder
-
getMetricCostsOrDefault
public long getMetricCostsOrDefault(java.lang.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:
getMetricCostsOrDefault
in interfaceMetricRuleOrBuilder
-
getMetricCostsOrThrow
public long getMetricCostsOrThrow(java.lang.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:
getMetricCostsOrThrow
in interfaceMetricRuleOrBuilder
-
clearMetricCosts
public MetricRule.Builder clearMetricCosts()
-
removeMetricCosts
public MetricRule.Builder removeMetricCosts(java.lang.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 java.util.Map<java.lang.String,java.lang.Long> getMutableMetricCosts()
Deprecated.Use alternate mutation accessors instead.
-
putMetricCosts
public MetricRule.Builder putMetricCosts(java.lang.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(java.util.Map<java.lang.String,java.lang.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:
setUnknownFields
in interfacecom.google.protobuf.Message.Builder
- Overrides:
setUnknownFields
in classcom.google.protobuf.GeneratedMessageV3.Builder<MetricRule.Builder>
-
mergeUnknownFields
public final MetricRule.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
- Specified by:
mergeUnknownFields
in interfacecom.google.protobuf.Message.Builder
- Overrides:
mergeUnknownFields
in classcom.google.protobuf.GeneratedMessageV3.Builder<MetricRule.Builder>
-
-