Class RetryOption (2.39.0)

Beta

This library is covered by thePre-GA Offerings Terms 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 thelaunch stage descriptions.

publicclassRetryOptionimplementsSerializable

This class represents an options wrapper around theRetrySettings class and is an alternative way of initializing it. The retry options are usually provided in a form of varargs for methods that wait for changes in the status of a resource, do poll operations or retry on failures.

Inheritance

Object >RetryOption

Implements

Serializable

Static Methods

initialRetryDelay(Duration initialRetryDelay)

publicstaticRetryOptioninitialRetryDelay(DurationinitialRetryDelay)
Parameter
NameDescription
initialRetryDelayorg.threeten.bp.Duration
Returns
TypeDescription
RetryOption

jittered(boolean jittered)

publicstaticRetryOptionjittered(booleanjittered)
Parameter
NameDescription
jitteredboolean
Returns
TypeDescription
RetryOption

maxAttempts(int maxAttempts)

publicstaticRetryOptionmaxAttempts(intmaxAttempts)
Parameter
NameDescription
maxAttemptsint
Returns
TypeDescription
RetryOption

maxRetryDelay(Duration maxRetryDelay)

publicstaticRetryOptionmaxRetryDelay(DurationmaxRetryDelay)
Parameter
NameDescription
maxRetryDelayorg.threeten.bp.Duration
Returns
TypeDescription
RetryOption

mergeToSettings(RetrySettings settings, RetryOption[] options)

publicstaticRetrySettingsmergeToSettings(RetrySettingssettings,RetryOption[]options)

Creates a newRetrySettings instance, merging provided settings and multiple RetryOptions, each of which represents a single property inRetrySettings. It is an alternative way of initializingRetrySettings instances.

Parameters
NameDescription
settingsRetrySettings

retry settings

optionsRetryOption[]

zero or more Retry

Returns
TypeDescription
RetrySettings

newRetrySettings instance, which is a result of mergingoptions intosettings, i.e. each element inoptions, if present, overrides corresponding property insettings

retryDelayMultiplier(double retryDelayMultiplier)

publicstaticRetryOptionretryDelayMultiplier(doubleretryDelayMultiplier)
Parameter
NameDescription
retryDelayMultiplierdouble
Returns
TypeDescription
RetryOption

totalTimeout(Duration totalTimeout)

publicstaticRetryOptiontotalTimeout(DurationtotalTimeout)
Parameter
NameDescription
totalTimeoutorg.threeten.bp.Duration
Returns
TypeDescription
RetryOption

Methods

equals(Object o)

publicbooleanequals(Objecto)
Parameter
NameDescription
oObject
Returns
TypeDescription
boolean
Overrides

hashCode()

publicinthashCode()
Returns
TypeDescription
int
Overrides

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-01-31 UTC.