Package com.google.cloud
Class RetryOption
- java.lang.Object
-
- com.google.cloud.RetryOption
-
- All Implemented Interfaces:
Serializable
@BetaApi public class RetryOption extends Object implements Serializable
This class represents an options wrapper around theRetrySettingsclass 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.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)inthashCode()static RetryOptioninitialRetryDelay(org.threeten.bp.Duration initialRetryDelay)static RetryOptionjittered(boolean jittered)SeeRetrySettings.isJittered()()}.static RetryOptionmaxAttempts(int maxAttempts)static RetryOptionmaxRetryDelay(org.threeten.bp.Duration maxRetryDelay)static RetrySettingsmergeToSettings(RetrySettings settings, RetryOption... options)Creates a newRetrySettingsinstance, merging provided settings and multipleRetryOptions, each of which represents a single property inRetrySettings.static RetryOptionretryDelayMultiplier(double retryDelayMultiplier)static RetryOptiontotalTimeout(org.threeten.bp.Duration totalTimeout)
-
-
-
Method Detail
-
totalTimeout
public static RetryOption totalTimeout(org.threeten.bp.Duration totalTimeout)
-
initialRetryDelay
public static RetryOption initialRetryDelay(org.threeten.bp.Duration initialRetryDelay)
-
retryDelayMultiplier
public static RetryOption retryDelayMultiplier(double retryDelayMultiplier)
-
maxRetryDelay
public static RetryOption maxRetryDelay(org.threeten.bp.Duration maxRetryDelay)
-
maxAttempts
public static RetryOption maxAttempts(int maxAttempts)
-
jittered
public static RetryOption jittered(boolean jittered)
SeeRetrySettings.isJittered()()}.
-
mergeToSettings
public static RetrySettings mergeToSettings(RetrySettings settings, RetryOption... options)
Creates a newRetrySettingsinstance, merging provided settings and multipleRetryOptions, each of which represents a single property inRetrySettings. It is an alternative way of initializingRetrySettingsinstances.- Parameters:
settings- retry settingsoptions- zero or more Retry- Returns:
- new
RetrySettingsinstance, which is a result of mergingoptionsintosettings, i.e. each element inoptions, if present, overrides corresponding property insettings
-
-