Class 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 type google.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.GeneratedMessageV3.Builder

        getParentForChildren
      • 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
      • Methods inherited from interface com.google.protobuf.Message.Builder

        mergeDelimitedFrom, mergeDelimitedFrom
      • Methods inherited from interface com.google.protobuf.MessageLite.Builder

        mergeFrom
      • Methods inherited from interface com.google.protobuf.MessageOrBuilder

        findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
    • Method Detail

      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetMapFieldReflection

        protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection​(int number)
        Overrides:
        internalGetMapFieldReflection in class com.google.protobuf.GeneratedMessage.Builder<MetricRule.Builder>
      • internalGetMutableMapFieldReflection

        protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection​(int number)
        Overrides:
        internalGetMutableMapFieldReflection in class com.google.protobuf.GeneratedMessage.Builder<MetricRule.Builder>
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Overrides:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<MetricRule.Builder>
      • clear

        public MetricRule.Builder clear()
        Specified by:
        clear in interface com.google.protobuf.Message.Builder
        Specified by:
        clear in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clear in class com.google.protobuf.GeneratedMessageV3.Builder<MetricRule.Builder>
      • getDescriptorForType

        public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
        Specified by:
        getDescriptorForType in interface com.google.protobuf.Message.Builder
        Specified by:
        getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
        Overrides:
        getDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<MetricRule.Builder>
      • getDefaultInstanceForType

        public MetricRule getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<com.google.protobuf.GeneratedMessageV3>
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
      • build

        public MetricRule build()
        Specified by:
        build in interface com.google.protobuf.Message.Builder
        Specified by:
        build in interface com.google.protobuf.MessageLite.Builder
      • buildPartial

        public MetricRule buildPartial()
        Specified by:
        buildPartial in interface com.google.protobuf.Message.Builder
        Specified by:
        buildPartial in interface com.google.protobuf.MessageLite.Builder
      • clone

        public MetricRule.Builder clone()
        Specified by:
        clone in interface com.google.protobuf.Message.Builder
        Specified by:
        clone in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clone in class com.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 interface com.google.protobuf.Message.Builder
        Overrides:
        setField in class com.google.protobuf.GeneratedMessageV3.Builder<MetricRule.Builder>
      • clearField

        public MetricRule.Builder clearField​(com.google.protobuf.Descriptors.FieldDescriptor field)
        Specified by:
        clearField in interface com.google.protobuf.Message.Builder
        Overrides:
        clearField in class com.google.protobuf.GeneratedMessageV3.Builder<MetricRule.Builder>
      • clearOneof

        public MetricRule.Builder clearOneof​(com.google.protobuf.Descriptors.OneofDescriptor oneof)
        Specified by:
        clearOneof in interface com.google.protobuf.Message.Builder
        Overrides:
        clearOneof in class com.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 interface com.google.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class com.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 interface com.google.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<MetricRule.Builder>
      • mergeFrom

        public MetricRule.Builder mergeFrom​(com.google.protobuf.Message other)
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<MetricRule.Builder>
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.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 interface com.google.protobuf.Message.Builder
        Specified by:
        mergeFrom in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        mergeFrom in class com.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 interface MetricRuleOrBuilder
        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 interface MetricRuleOrBuilder
        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 interface MetricRuleOrBuilder
      • 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 interface MetricRuleOrBuilder
      • 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 interface MetricRuleOrBuilder
      • 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 interface MetricRuleOrBuilder
      • 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 interface MetricRuleOrBuilder
      • 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 interface com.google.protobuf.Message.Builder
        Overrides:
        setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<MetricRule.Builder>
      • mergeUnknownFields

        public final MetricRule.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<MetricRule.Builder>