Class MetricRule.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.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.GeneratedMessage.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

    Modifier and Type
    Method
    Description
     
     
     
     
    Selects the methods to which this rule applies.
    boolean
    Metrics to update when the selected methods are called, and the associated cost applied to each metric.
     
    static final com.google.protobuf.Descriptors.Descriptor
     
    com.google.protobuf.Descriptors.Descriptor
     
    Deprecated.
    int
    Metrics to update when the selected methods are called, and the associated cost applied to each metric.
    Metrics to update when the selected methods are called, and the associated cost applied to each metric.
    long
    getMetricCostsOrDefault(String key, long defaultValue)
    Metrics to update when the selected methods are called, and the associated cost applied to each metric.
    long
    Metrics to update when the selected methods are called, and the associated cost applied to each metric.
    Deprecated.
    Selects the methods to which this rule applies.
    com.google.protobuf.ByteString
    Selects the methods to which this rule applies.
    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
     
    protected com.google.protobuf.MapFieldReflectionAccessor
     
    protected com.google.protobuf.MapFieldReflectionAccessor
     
    final boolean
     
     
    mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    mergeFrom(com.google.protobuf.Message other)
     
    Metrics to update when the selected methods are called, and the associated cost applied to each metric.
    putMetricCosts(String key, long value)
    Metrics to update when the selected methods are called, and the associated cost applied to each metric.
    Metrics to update when the selected methods are called, and the associated cost applied to each metric.
    Selects the methods to which this rule applies.
    setSelectorBytes(com.google.protobuf.ByteString value)
    Selects the methods to which this rule applies.

    Methods inherited from class com.google.protobuf.GeneratedMessage.Builder

    addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, 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 Details

    • 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.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.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.GeneratedMessage.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.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
    • 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>
    • mergeFrom

      public MetricRule.Builder mergeFrom(MetricRule other)
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage.Builder<MetricRule.Builder>
    • mergeFrom

      public MetricRule.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws 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:
      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:
      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(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(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
    • getMetricCosts

      @Deprecated public Map<String,Long> getMetricCosts()
      Deprecated.
      Use getMetricCostsMap() instead.
      Specified by:
      getMetricCosts in interface MetricRuleOrBuilder
    • 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:
      getMetricCostsMap in interface MetricRuleOrBuilder
    • 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:
      getMetricCostsOrDefault in interface MetricRuleOrBuilder
    • 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:
      getMetricCostsOrThrow in interface MetricRuleOrBuilder
    • 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;