Class MethodConfig.RetryPolicy.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessageV3.Builder<MethodConfig.RetryPolicy.Builder>
io.grpc.serviceconfig.MethodConfig.RetryPolicy.Builder
All Implemented Interfaces:
com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, MethodConfig.RetryPolicyOrBuilder, Cloneable
Enclosing class:
MethodConfig.RetryPolicy

public static final class MethodConfig.RetryPolicy.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<MethodConfig.RetryPolicy.Builder> implements MethodConfig.RetryPolicyOrBuilder
 The retry policy for outgoing RPCs.
 
Protobuf type grpc.service_config.MethodConfig.RetryPolicy
  • Method Details

    • getDescriptor

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

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<MethodConfig.RetryPolicy.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<MethodConfig.RetryPolicy.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.GeneratedMessageV3.Builder<MethodConfig.RetryPolicy.Builder>
    • getDefaultInstanceForType

      public MethodConfig.RetryPolicy getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

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

      public MethodConfig.RetryPolicy buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.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<MethodConfig.RetryPolicy.Builder>
    • setField

      public MethodConfig.RetryPolicy.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      setField in interface com.google.protobuf.Message.Builder
      Overrides:
      setField in class com.google.protobuf.GeneratedMessageV3.Builder<MethodConfig.RetryPolicy.Builder>
    • clearField

      public MethodConfig.RetryPolicy.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<MethodConfig.RetryPolicy.Builder>
    • clearOneof

      public MethodConfig.RetryPolicy.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<MethodConfig.RetryPolicy.Builder>
    • setRepeatedField

      public MethodConfig.RetryPolicy.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
      Specified by:
      setRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<MethodConfig.RetryPolicy.Builder>
    • addRepeatedField

      public MethodConfig.RetryPolicy.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      addRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<MethodConfig.RetryPolicy.Builder>
    • mergeFrom

      public MethodConfig.RetryPolicy.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<MethodConfig.RetryPolicy.Builder>
    • mergeFrom

    • isInitialized

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

      public MethodConfig.RetryPolicy.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<MethodConfig.RetryPolicy.Builder>
      Throws:
      IOException
    • getMaxAttempts

      public int getMaxAttempts()
       The maximum number of RPC attempts, including the original attempt.
      
       This field is required and must be greater than 1.
       Any value greater than 5 will be treated as if it were 5.
       
      uint32 max_attempts = 1;
      Specified by:
      getMaxAttempts in interface MethodConfig.RetryPolicyOrBuilder
      Returns:
      The maxAttempts.
    • setMaxAttempts

      public MethodConfig.RetryPolicy.Builder setMaxAttempts(int value)
       The maximum number of RPC attempts, including the original attempt.
      
       This field is required and must be greater than 1.
       Any value greater than 5 will be treated as if it were 5.
       
      uint32 max_attempts = 1;
      Parameters:
      value - The maxAttempts to set.
      Returns:
      This builder for chaining.
    • clearMaxAttempts

      public MethodConfig.RetryPolicy.Builder clearMaxAttempts()
       The maximum number of RPC attempts, including the original attempt.
      
       This field is required and must be greater than 1.
       Any value greater than 5 will be treated as if it were 5.
       
      uint32 max_attempts = 1;
      Returns:
      This builder for chaining.
    • hasInitialBackoff

      public boolean hasInitialBackoff()
       Exponential backoff parameters. The initial retry attempt will occur at
       random(0, initial_backoff). In general, the nth attempt will occur at
       random(0,
         min(initial_backoff*backoff_multiplier**(n-1), max_backoff)).
       Required. Must be greater than zero.
       
      .google.protobuf.Duration initial_backoff = 2;
      Specified by:
      hasInitialBackoff in interface MethodConfig.RetryPolicyOrBuilder
      Returns:
      Whether the initialBackoff field is set.
    • getInitialBackoff

      public com.google.protobuf.Duration getInitialBackoff()
       Exponential backoff parameters. The initial retry attempt will occur at
       random(0, initial_backoff). In general, the nth attempt will occur at
       random(0,
         min(initial_backoff*backoff_multiplier**(n-1), max_backoff)).
       Required. Must be greater than zero.
       
      .google.protobuf.Duration initial_backoff = 2;
      Specified by:
      getInitialBackoff in interface MethodConfig.RetryPolicyOrBuilder
      Returns:
      The initialBackoff.
    • setInitialBackoff

      public MethodConfig.RetryPolicy.Builder setInitialBackoff(com.google.protobuf.Duration value)
       Exponential backoff parameters. The initial retry attempt will occur at
       random(0, initial_backoff). In general, the nth attempt will occur at
       random(0,
         min(initial_backoff*backoff_multiplier**(n-1), max_backoff)).
       Required. Must be greater than zero.
       
      .google.protobuf.Duration initial_backoff = 2;
    • setInitialBackoff

      public MethodConfig.RetryPolicy.Builder setInitialBackoff(com.google.protobuf.Duration.Builder builderForValue)
       Exponential backoff parameters. The initial retry attempt will occur at
       random(0, initial_backoff). In general, the nth attempt will occur at
       random(0,
         min(initial_backoff*backoff_multiplier**(n-1), max_backoff)).
       Required. Must be greater than zero.
       
      .google.protobuf.Duration initial_backoff = 2;
    • mergeInitialBackoff

      public MethodConfig.RetryPolicy.Builder mergeInitialBackoff(com.google.protobuf.Duration value)
       Exponential backoff parameters. The initial retry attempt will occur at
       random(0, initial_backoff). In general, the nth attempt will occur at
       random(0,
         min(initial_backoff*backoff_multiplier**(n-1), max_backoff)).
       Required. Must be greater than zero.
       
      .google.protobuf.Duration initial_backoff = 2;
    • clearInitialBackoff

      public MethodConfig.RetryPolicy.Builder clearInitialBackoff()
       Exponential backoff parameters. The initial retry attempt will occur at
       random(0, initial_backoff). In general, the nth attempt will occur at
       random(0,
         min(initial_backoff*backoff_multiplier**(n-1), max_backoff)).
       Required. Must be greater than zero.
       
      .google.protobuf.Duration initial_backoff = 2;
    • getInitialBackoffBuilder

      public com.google.protobuf.Duration.Builder getInitialBackoffBuilder()
       Exponential backoff parameters. The initial retry attempt will occur at
       random(0, initial_backoff). In general, the nth attempt will occur at
       random(0,
         min(initial_backoff*backoff_multiplier**(n-1), max_backoff)).
       Required. Must be greater than zero.
       
      .google.protobuf.Duration initial_backoff = 2;
    • getInitialBackoffOrBuilder

      public com.google.protobuf.DurationOrBuilder getInitialBackoffOrBuilder()
       Exponential backoff parameters. The initial retry attempt will occur at
       random(0, initial_backoff). In general, the nth attempt will occur at
       random(0,
         min(initial_backoff*backoff_multiplier**(n-1), max_backoff)).
       Required. Must be greater than zero.
       
      .google.protobuf.Duration initial_backoff = 2;
      Specified by:
      getInitialBackoffOrBuilder in interface MethodConfig.RetryPolicyOrBuilder
    • hasMaxBackoff

      public boolean hasMaxBackoff()
       Required. Must be greater than zero.
       
      .google.protobuf.Duration max_backoff = 3;
      Specified by:
      hasMaxBackoff in interface MethodConfig.RetryPolicyOrBuilder
      Returns:
      Whether the maxBackoff field is set.
    • getMaxBackoff

      public com.google.protobuf.Duration getMaxBackoff()
       Required. Must be greater than zero.
       
      .google.protobuf.Duration max_backoff = 3;
      Specified by:
      getMaxBackoff in interface MethodConfig.RetryPolicyOrBuilder
      Returns:
      The maxBackoff.
    • setMaxBackoff

      public MethodConfig.RetryPolicy.Builder setMaxBackoff(com.google.protobuf.Duration value)
       Required. Must be greater than zero.
       
      .google.protobuf.Duration max_backoff = 3;
    • setMaxBackoff

      public MethodConfig.RetryPolicy.Builder setMaxBackoff(com.google.protobuf.Duration.Builder builderForValue)
       Required. Must be greater than zero.
       
      .google.protobuf.Duration max_backoff = 3;
    • mergeMaxBackoff

      public MethodConfig.RetryPolicy.Builder mergeMaxBackoff(com.google.protobuf.Duration value)
       Required. Must be greater than zero.
       
      .google.protobuf.Duration max_backoff = 3;
    • clearMaxBackoff

      public MethodConfig.RetryPolicy.Builder clearMaxBackoff()
       Required. Must be greater than zero.
       
      .google.protobuf.Duration max_backoff = 3;
    • getMaxBackoffBuilder

      public com.google.protobuf.Duration.Builder getMaxBackoffBuilder()
       Required. Must be greater than zero.
       
      .google.protobuf.Duration max_backoff = 3;
    • getMaxBackoffOrBuilder

      public com.google.protobuf.DurationOrBuilder getMaxBackoffOrBuilder()
       Required. Must be greater than zero.
       
      .google.protobuf.Duration max_backoff = 3;
      Specified by:
      getMaxBackoffOrBuilder in interface MethodConfig.RetryPolicyOrBuilder
    • getBackoffMultiplier

      public float getBackoffMultiplier()
       Required. Must be greater than zero.
       
      float backoff_multiplier = 4;
      Specified by:
      getBackoffMultiplier in interface MethodConfig.RetryPolicyOrBuilder
      Returns:
      The backoffMultiplier.
    • setBackoffMultiplier

      public MethodConfig.RetryPolicy.Builder setBackoffMultiplier(float value)
       Required. Must be greater than zero.
       
      float backoff_multiplier = 4;
      Parameters:
      value - The backoffMultiplier to set.
      Returns:
      This builder for chaining.
    • clearBackoffMultiplier

      public MethodConfig.RetryPolicy.Builder clearBackoffMultiplier()
       Required. Must be greater than zero.
       
      float backoff_multiplier = 4;
      Returns:
      This builder for chaining.
    • getRetryableStatusCodesList

      public List<com.google.rpc.Code> getRetryableStatusCodesList()
       The set of status codes which may be retried.
      
       This field is required and must be non-empty.
       
      repeated .google.rpc.Code retryable_status_codes = 5;
      Specified by:
      getRetryableStatusCodesList in interface MethodConfig.RetryPolicyOrBuilder
      Returns:
      A list containing the retryableStatusCodes.
    • getRetryableStatusCodesCount

      public int getRetryableStatusCodesCount()
       The set of status codes which may be retried.
      
       This field is required and must be non-empty.
       
      repeated .google.rpc.Code retryable_status_codes = 5;
      Specified by:
      getRetryableStatusCodesCount in interface MethodConfig.RetryPolicyOrBuilder
      Returns:
      The count of retryableStatusCodes.
    • getRetryableStatusCodes

      public com.google.rpc.Code getRetryableStatusCodes(int index)
       The set of status codes which may be retried.
      
       This field is required and must be non-empty.
       
      repeated .google.rpc.Code retryable_status_codes = 5;
      Specified by:
      getRetryableStatusCodes in interface MethodConfig.RetryPolicyOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The retryableStatusCodes at the given index.
    • setRetryableStatusCodes

      public MethodConfig.RetryPolicy.Builder setRetryableStatusCodes(int index, com.google.rpc.Code value)
       The set of status codes which may be retried.
      
       This field is required and must be non-empty.
       
      repeated .google.rpc.Code retryable_status_codes = 5;
      Parameters:
      index - The index to set the value at.
      value - The retryableStatusCodes to set.
      Returns:
      This builder for chaining.
    • addRetryableStatusCodes

      public MethodConfig.RetryPolicy.Builder addRetryableStatusCodes(com.google.rpc.Code value)
       The set of status codes which may be retried.
      
       This field is required and must be non-empty.
       
      repeated .google.rpc.Code retryable_status_codes = 5;
      Parameters:
      value - The retryableStatusCodes to add.
      Returns:
      This builder for chaining.
    • addAllRetryableStatusCodes

      public MethodConfig.RetryPolicy.Builder addAllRetryableStatusCodes(Iterable<? extends com.google.rpc.Code> values)
       The set of status codes which may be retried.
      
       This field is required and must be non-empty.
       
      repeated .google.rpc.Code retryable_status_codes = 5;
      Parameters:
      values - The retryableStatusCodes to add.
      Returns:
      This builder for chaining.
    • clearRetryableStatusCodes

      public MethodConfig.RetryPolicy.Builder clearRetryableStatusCodes()
       The set of status codes which may be retried.
      
       This field is required and must be non-empty.
       
      repeated .google.rpc.Code retryable_status_codes = 5;
      Returns:
      This builder for chaining.
    • getRetryableStatusCodesValueList

      public List<Integer> getRetryableStatusCodesValueList()
       The set of status codes which may be retried.
      
       This field is required and must be non-empty.
       
      repeated .google.rpc.Code retryable_status_codes = 5;
      Specified by:
      getRetryableStatusCodesValueList in interface MethodConfig.RetryPolicyOrBuilder
      Returns:
      A list containing the enum numeric values on the wire for retryableStatusCodes.
    • getRetryableStatusCodesValue

      public int getRetryableStatusCodesValue(int index)
       The set of status codes which may be retried.
      
       This field is required and must be non-empty.
       
      repeated .google.rpc.Code retryable_status_codes = 5;
      Specified by:
      getRetryableStatusCodesValue in interface MethodConfig.RetryPolicyOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The enum numeric value on the wire of retryableStatusCodes at the given index.
    • setRetryableStatusCodesValue

      public MethodConfig.RetryPolicy.Builder setRetryableStatusCodesValue(int index, int value)
       The set of status codes which may be retried.
      
       This field is required and must be non-empty.
       
      repeated .google.rpc.Code retryable_status_codes = 5;
      Parameters:
      index - The index to set the value at.
      value - The enum numeric value on the wire for retryableStatusCodes to set.
      Returns:
      This builder for chaining.
    • addRetryableStatusCodesValue

      public MethodConfig.RetryPolicy.Builder addRetryableStatusCodesValue(int value)
       The set of status codes which may be retried.
      
       This field is required and must be non-empty.
       
      repeated .google.rpc.Code retryable_status_codes = 5;
      Parameters:
      value - The enum numeric value on the wire for retryableStatusCodes to add.
      Returns:
      This builder for chaining.
    • addAllRetryableStatusCodesValue

      public MethodConfig.RetryPolicy.Builder addAllRetryableStatusCodesValue(Iterable<Integer> values)
       The set of status codes which may be retried.
      
       This field is required and must be non-empty.
       
      repeated .google.rpc.Code retryable_status_codes = 5;
      Parameters:
      values - The enum numeric values on the wire for retryableStatusCodes to add.
      Returns:
      This builder for chaining.
    • setUnknownFields

      public final MethodConfig.RetryPolicy.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<MethodConfig.RetryPolicy.Builder>
    • mergeUnknownFields

      public final MethodConfig.RetryPolicy.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<MethodConfig.RetryPolicy.Builder>