# Class RetrySettings.Builder (2.81.0)

2.81.0 (latest) 2.80.0 2.79.0 2.76.0 2.75.0 2.74.1 2.73.1 2.72.2 2.71.0 2.70.3 2.69.0 2.68.2 2.67.0 2.66.0 2.65.0 2.63.1 2.62.0 2.61.0 2.60.0 2.59.1 2.58.0 2.57.0 2.55.0 2.54.1 2.53.0 2.52.0 2.51.0 2.50.0 2.49.0 2.48.1 2.47.0 2.46.1 2.45.0 2.43.0 2.42.0 2.41.0 2.39.0 2.38.0 2.37.0 2.36.0 2.35.0 2.34.1 2.33.0 2.32.1 2.31.1 2.30.1 2.24.0 2.23.3 2.22.0 2.21.0 2.20.1 2.19.6 2.18.7 2.17.0 2.16.0 2.15.0 2.14.0 2.13.0 2.12.2 2.11.0 2.10.0 2.9.0 2.8.1 2.7.1

    public abstract static class RetrySettings.Builder

A base builder class for [RetrySettings](https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings). See the class documentation of [RetrySettings](https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) for a description of the different values that can be set.

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> RetrySettings.Builder

## Inherited Members

[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)

## Constructors

### Builder()

    public Builder()

## Methods

### build()

    public RetrySettings build()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings` |   |

### getInitialRetryDelay()

    public final Duration getInitialRetryDelay()

> [!WARNING]
> **Obsolete**
>
> *Use getInitialRetryDelayDuration() instead*
>
> This feature is stable for usage in this major version, but may be deprecated in a future release.

This method is obsolete. Use [#getInitialRetryDelayDuration()](https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings.Builder#com_google_api_gax_retrying_RetrySettings_Builder_getInitialRetryDelayDuration__) instead

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `org.threeten.bp.Duration` |   |

### getInitialRetryDelayDuration()

    public abstract Duration getInitialRetryDelayDuration()

InitialRetryDelay controls the delay before the first retry/ poll. Subsequent retries and
polls will use this value adjusted according to the RetryDelayMultiplier.

If there are no configurations, Retries have the default initial retry delay value of
`Duration.ZERO` and LROs have a default initial poll delay value of `
Duration.ofMillis(5000)` (5 seconds).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html` |   |

### getInitialRpcTimeout()

    public final Duration getInitialRpcTimeout()

> [!WARNING]
> **Obsolete**
>
> *Use getInitialRpcTimeoutDuration() instead*
>
> This feature is stable for usage in this major version, but may be deprecated in a future release.

This method is obsolete. Use [#getInitialRpcTimeoutDuration()](https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings.Builder#com_google_api_gax_retrying_RetrySettings_Builder_getInitialRpcTimeoutDuration__) instead

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `org.threeten.bp.Duration` |   |

### getInitialRpcTimeoutDuration()

    public abstract Duration getInitialRpcTimeoutDuration()

InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this
value adjusted according to the RpcTimeoutMultiplier. RPC Timeout value of `
Duration.ZERO` allows the RPC to continue indefinitely (until it hits a Connect Timeout or
the connection has been terminated).

[#getTotalTimeout()](https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings.Builder#com_google_api_gax_retrying_RetrySettings_Builder_getTotalTimeout__) caps how long the logic should keep trying the RPC until it
gives up completely. If [#getTotalTimeout()](https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings.Builder#com_google_api_gax_retrying_RetrySettings_Builder_getTotalTimeout__) is set, initialRpcTimeout should be \<=
totalTimeout.

If there are no configurations, Retries have the default initial RPC timeout value of
`Duration.ZERO`. LRO polling does not use the Initial RPC Timeout value.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html` |   |

### getMaxAttempts()

    public abstract int getMaxAttempts()

MaxAttempts defines the maximum number of retry attempts to perform. If this value is set to
0, the logic will instead use the totalTimeout value to determine retries. In the event that
both the maxAttempts and totalTimeout values are both 0, the logic will not retry. If this
value is greater than 0, and the number of attempts exceeds this limit, the logic will give
up retrying even if the total retry time is still lower than totalTimeout.

If there are no configurations, Retries and LROs have the default max attempt value of
`0`. LRO polling does not use this value by default.

The first RPC invocation will be considered attempt #0. Subsequent calls (retries) will
increment the number of attempts and the number of attempts will not exceed this value.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### getMaxRetryDelay()

    public final Duration getMaxRetryDelay()

> [!WARNING]
> **Obsolete**
>
> *Use getMaxRetryDelayDuration() instead*
>
> This feature is stable for usage in this major version, but may be deprecated in a future release.

This method is obsolete. Use [#getMaxRetryDelayDuration()](https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings.Builder#com_google_api_gax_retrying_RetrySettings_Builder_getMaxRetryDelayDuration__) instead

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `org.threeten.bp.Duration` |   |

### getMaxRetryDelayDuration()

    public abstract Duration getMaxRetryDelayDuration()

MaxRetryDelay puts a limit on the value of the retry delay, so that the RetryDelayMultiplier
can't increase the retry delay higher than this amount.

If there are no configurations, Retries have the default max retry delay value of `
Duration.ZERO` and LROs have a default max poll retry delay value of `
Duration.ofMillis(45000)` (45 seconds).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html` |   |

### getMaxRpcTimeout()

    public final Duration getMaxRpcTimeout()

> [!WARNING]
> **Obsolete**
>
> *Use getMaxRpcTimeoutDuration() instead*
>
> This feature is stable for usage in this major version, but may be deprecated in a future release.

This method is obsolete. Use [#getMaxRpcTimeoutDuration()](https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings.Builder#com_google_api_gax_retrying_RetrySettings_Builder_getMaxRpcTimeoutDuration__) instead

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `org.threeten.bp.Duration` |   |

### getMaxRpcTimeoutDuration()

    public abstract Duration getMaxRpcTimeoutDuration()

MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier
can't increase the RPC timeout higher than this amount.

If there are no configurations, Retries have the default Max RPC Timeout value of `
Duration.ZERO`. LRO polling does not use the Max RPC Timeout value.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html` |   |

### getRetryDelayMultiplier()

    public abstract double getRetryDelayMultiplier()

RetryDelayMultiplier controls the change in delay before the next retry or poll. The retry
delay of the previous call is multiplied by the RetryDelayMultiplier to calculate the retry
delay for the next call.

If there are no configurations, Retries have the default retry delay multiplier value of
`1.0` and LROs have a default retry delay multiplier of `1.5`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### getRpcTimeoutMultiplier()

    public abstract double getRpcTimeoutMultiplier()

RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call is
multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call.

If there are no configurations, Retries have the default RPC Timeout Multiplier value of
`1.0`. LRO polling does not use the RPC Timeout Multiplier value.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### getTotalTimeout()

    public final Duration getTotalTimeout()

> [!WARNING]
> **Obsolete**
>
> *Use getTotalTimeoutDuration() instead*
>
> This feature is stable for usage in this major version, but may be deprecated in a future release.

This method is obsolete. Use [#getTotalTimeoutDuration()](https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings.Builder#com_google_api_gax_retrying_RetrySettings_Builder_getTotalTimeoutDuration__) instead

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `org.threeten.bp.Duration` |   |

### getTotalTimeoutDuration()

    public abstract Duration getTotalTimeoutDuration()

TotalTimeout has ultimate control over how long the logic should keep trying the remote call
until it gives up completely. The higher the total timeout, the more retries and polls can be
attempted. If this value is `Duration.ZERO`, then the logic will instead use the number
of attempts to determine retries. In the event that both maxAttempts and totalTimeout values
are both 0, the logic will not retry. If this value is non-`Duration.ZERO`, and the
retry duration has reaches the timeout value, the logic will give up retrying even the number
of attempts is lower than the maxAttempts value.

If there are no configurations, Retries have the default timeout value of `
Duration.ZERO` and LROs have a default total timeout value of `
Duration.ofMillis(300000)` (5 minutes).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html` |   |

### isJittered()

    public abstract boolean isJittered()

Jitter determines if the delay time should be randomized. In most cases, if jitter is set to
`true` the actual delay time is calculated in the following way:

    actualDelay = rand_between(0, min(maxRetryDelay, exponentialDelay))

The default value is `true`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### merge(RetrySettings.Builder newSettings)

    public RetrySettings.Builder merge(RetrySettings.Builder newSettings)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `newSettings` | `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings.Builder` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings.Builder` |   |

### setInitialRetryDelay(Duration initialDelay)

    public final RetrySettings.Builder setInitialRetryDelay(Duration initialDelay)

> [!WARNING]
> **Obsolete**
>
> *Use setInitialRetryDelayDuration(java.time.Duration) instead*
>
> This feature is stable for usage in this major version, but may be deprecated in a future release.

This method is obsolete. Use [#setInitialRetryDelayDuration(java.time.Duration)](https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings.Builder#com_google_api_gax_retrying_RetrySettings_Builder_setInitialRetryDelayDuration_java_time_Duration_)
instead

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `initialDelay` | `org.threeten.bp.Duration` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings.Builder` |   |

### setInitialRetryDelayDuration(Duration initialDelay)

    public abstract RetrySettings.Builder setInitialRetryDelayDuration(Duration initialDelay)

InitialRetryDelay controls the delay before the first retry/ poll. Subsequent retries and
polls will use this value adjusted according to the RetryDelayMultiplier.

If there are no configurations, Retries have the default initial retry delay value of
`Duration.ZERO` and LROs have a default initial poll delay value of `
Duration.ofMillis(5000)` (5 seconds).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `initialDelay` | `https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings.Builder` |   |

### setInitialRpcTimeout(Duration initialTimeout)

    public final RetrySettings.Builder setInitialRpcTimeout(Duration initialTimeout)

> [!WARNING]
> **Obsolete**
>
> *Use setInitialRpcTimeoutDuration(java.time.Duration) instead*
>
> This feature is stable for usage in this major version, but may be deprecated in a future release.

This method is obsolete. Use [#setInitialRpcTimeoutDuration(java.time.Duration)](https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings.Builder#com_google_api_gax_retrying_RetrySettings_Builder_setInitialRpcTimeoutDuration_java_time_Duration_)
instead

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `initialTimeout` | `org.threeten.bp.Duration` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings.Builder` |   |

### setInitialRpcTimeoutDuration(Duration initialTimeout)

    public abstract RetrySettings.Builder setInitialRpcTimeoutDuration(Duration initialTimeout)

InitialRpcTimeout controls the timeout for the initial RPC. Subsequent calls will use this
value adjusted according to the RpcTimeoutMultiplier. RPC Timeout value of `
Duration.ZERO` allows the RPC to continue indefinitely (until it hits a Connect Timeout or
the connection has been terminated).

[#getTotalTimeout()](https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings.Builder#com_google_api_gax_retrying_RetrySettings_Builder_getTotalTimeout__) caps how long the logic should keep trying the RPC until it
gives up completely. If [#getTotalTimeout()](https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings.Builder#com_google_api_gax_retrying_RetrySettings_Builder_getTotalTimeout__) is set, initialRpcTimeout should be \<=
totalTimeout.

If there are no configurations, Retries have the default initial RPC timeout value of
`Duration.ZERO`. LRO polling does not use the Initial RPC Timeout value.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `initialTimeout` | `https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings.Builder` |   |

### setJittered(boolean jittered) (deprecated)

    public abstract RetrySettings.Builder setJittered(boolean jittered)

**Deprecated.** *Retries always jitter.*

Jitter determines if the delay time should be randomized. If jitter is set to `true`
the actual delay time is calculated in the following way:

    actualDelay = rand_between(0, min(maxRetryDelay, exponentialDelay))

The default value is `true`, and this method will be a no-op soon.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `jittered` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings.Builder` |   |

### setLogicalTimeout(Duration timeout)

    public RetrySettings.Builder setLogicalTimeout(Duration timeout)

> [!WARNING]
> **Beta**
>
> This feature is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1) of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see the launch stage descriptions.

Configures the timeout settings with the given timeout such that the logical call will take
no longer than the given timeout and each RPC attempt will use only the time remaining in the
logical call as a timeout.

Using this method in conjunction with individual [RetrySettings](https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) timeout field
setters is not advised, because only the order in which they are invoked determines which
setter is respected.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `timeout` | `https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings.Builder` |   |

### setLogicalTimeout(Duration timeout)

    public RetrySettings.Builder setLogicalTimeout(Duration timeout)

> [!WARNING]
> **Obsolete**
>
> *Use setLogicalTimeout(java.time.Duration) instead*
>
> This feature is stable for usage in this major version, but may be deprecated in a future release.

> [!WARNING]
> **Beta**
>
> This feature is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1) of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see the launch stage descriptions.

This method is obsolete. Use [#setLogicalTimeout(java.time.Duration)](https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings.Builder#com_google_api_gax_retrying_RetrySettings_Builder_setLogicalTimeout_java_time_Duration_) instead.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `timeout` | `org.threeten.bp.Duration` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings.Builder` |   |

### setMaxAttempts(int maxAttempts)

    public abstract RetrySettings.Builder setMaxAttempts(int maxAttempts)

MaxAttempts defines the maximum number of retry attempts to perform. If this value is set to
0, the logic will instead use the totalTimeout value to determine retries. In the event that
both the maxAttempts and totalTimeout values are both 0, the logic will not retry. If this
value is greater than 0, and the number of attempts exceeds this limit, the logic will give
up retrying even if the total retry time is still lower than totalTimeout.

If there are no configurations, Retries and LROs have the default max attempt value of
`0`. LRO polling does not use this value by default.

The first RPC invocation will be considered attempt #0. Subsequent calls (retries) will
increment the number of attempts and the number of attempts will not exceed this value.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `maxAttempts` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings.Builder` |   |

### setMaxRetryDelay(Duration maxDelay)

    public final RetrySettings.Builder setMaxRetryDelay(Duration maxDelay)

> [!WARNING]
> **Obsolete**
>
> *Use setMaxRetryDelayDuration(java.time.Duration) instead*
>
> This feature is stable for usage in this major version, but may be deprecated in a future release.

This method is obsolete. Use [#setMaxRetryDelayDuration(java.time.Duration)](https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings.Builder#com_google_api_gax_retrying_RetrySettings_Builder_setMaxRetryDelayDuration_java_time_Duration_) instead

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `maxDelay` | `org.threeten.bp.Duration` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings.Builder` |   |

### setMaxRetryDelayDuration(Duration maxDelay)

    public abstract RetrySettings.Builder setMaxRetryDelayDuration(Duration maxDelay)

MaxRetryDelay puts a limit on the value of the retry delay, so that the RetryDelayMultiplier
can't increase the retry delay higher than this amount.

If there are no configurations, Retries have the default max retry delay value of `
Duration.ZERO` and LROs have a default max poll retry delay value of `
Duration.ofMillis(45000)` (45 seconds).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `maxDelay` | `https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings.Builder` |   |

### setMaxRpcTimeout(Duration maxTimeout)

    public final RetrySettings.Builder setMaxRpcTimeout(Duration maxTimeout)

> [!WARNING]
> **Obsolete**
>
> *Use setMaxRpcTimeoutDuration(java.time.Duration) instead*
>
> This feature is stable for usage in this major version, but may be deprecated in a future release.

This method is obsolete. Use [#setMaxRpcTimeoutDuration(java.time.Duration)](https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings.Builder#com_google_api_gax_retrying_RetrySettings_Builder_setMaxRpcTimeoutDuration_java_time_Duration_) instead

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `maxTimeout` | `org.threeten.bp.Duration` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings.Builder` |   |

### setMaxRpcTimeoutDuration(Duration maxTimeout)

    public abstract RetrySettings.Builder setMaxRpcTimeoutDuration(Duration maxTimeout)

MaxRpcTimeout puts a limit on the value of the RPC timeout, so that the RpcTimeoutMultiplier
can't increase the RPC timeout higher than this amount.

If there are no configurations, Retries have the default Max RPC Timeout value of `
Duration.ZERO`. LRO polling does not use the Max RPC Timeout value.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `maxTimeout` | `https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings.Builder` |   |

### setRetryDelayMultiplier(double multiplier)

    public abstract RetrySettings.Builder setRetryDelayMultiplier(double multiplier)

RetryDelayMultiplier controls the change in delay before the next retry or poll. The retry
delay of the previous call is multiplied by the RetryDelayMultiplier to calculate the retry
delay for the next call.

If there are no configurations, Retries have the default retry delay multiplier value of
`1.0` and LROs have a default retry delay multiplier of `1.5`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `multiplier` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings.Builder` |   |

### setRpcTimeoutMultiplier(double multiplier)

    public abstract RetrySettings.Builder setRpcTimeoutMultiplier(double multiplier)

RpcTimeoutMultiplier controls the change in RPC timeout. The timeout of the previous call is
multiplied by the RpcTimeoutMultiplier to calculate the timeout for the next call.

If there are no configurations, Retries have the default RPC Timeout Multiplier value of
`1.0`. LRO polling does not use the RPC Timeout Multiplier value.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `multiplier` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings.Builder` |   |

### setTotalTimeout(Duration totalTimeout)

    public final RetrySettings.Builder setTotalTimeout(Duration totalTimeout)

> [!WARNING]
> **Obsolete**
>
> *Use setTotalTimeoutDuration(java.time.Duration) instead*
>
> This feature is stable for usage in this major version, but may be deprecated in a future release.

This method is obsolete. Use [#setTotalTimeoutDuration(java.time.Duration)](https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings.Builder#com_google_api_gax_retrying_RetrySettings_Builder_setTotalTimeoutDuration_java_time_Duration_) instead

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `totalTimeout` | `org.threeten.bp.Duration` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings.Builder` |   |

### setTotalTimeoutDuration(Duration totalTimeout)

    public abstract RetrySettings.Builder setTotalTimeoutDuration(Duration totalTimeout)

TotalTimeout has ultimate control over how long the logic should keep trying the remote call
until it gives up completely. The higher the total timeout, the more retries and polls can be
attempted. If this value is `Duration.ZERO`, then the logic will instead use the number
of attempts to determine retries. In the event that both maxAttempts and totalTimeout values
are both 0, the logic will not retry. If this value is non-`Duration.ZERO`, and the
retry duration has reaches the timeout value, the logic will give up retrying even the number
of attempts is lower than the maxAttempts value.

If there are no configurations, Retries have the default timeout value of `
Duration.ZERO` and LROs have a default total timeout value of `
Duration.ofMillis(300000)` (5 minutes).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `totalTimeout` | `https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings.Builder` |   |