Class RetryOption

  • All Implemented Interfaces:
    Serializable

    @BetaApi
    public class RetryOption
    extends Object
    implements Serializable
    This class represents an options wrapper around the RetrySettings 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.
    See Also:
    Serialized Form
    • Method Detail

      • totalTimeout

        public static RetryOption totalTimeout​(org.threeten.bp.Duration totalTimeout)
        See RetrySettings.getTotalTimeout().
      • initialRetryDelay

        public static RetryOption initialRetryDelay​(org.threeten.bp.Duration initialRetryDelay)
        See RetrySettings.getInitialRetryDelay().
      • retryDelayMultiplier

        public static RetryOption retryDelayMultiplier​(double retryDelayMultiplier)
        See RetrySettings.getRetryDelayMultiplier().
      • maxRetryDelay

        public static RetryOption maxRetryDelay​(org.threeten.bp.Duration maxRetryDelay)
        See RetrySettings.getMaxRetryDelay().
      • maxAttempts

        public static RetryOption maxAttempts​(int maxAttempts)
        See RetrySettings.getMaxAttempts().
      • jittered

        public static RetryOption jittered​(boolean jittered)
        See RetrySettings.isJittered() ()}.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • mergeToSettings

        public static com.google.api.gax.retrying.RetrySettings mergeToSettings​(com.google.api.gax.retrying.RetrySettings settings,
                                                                                RetryOption... options)
        Creates a new RetrySettings instance, merging provided settings and multiple RetryOptions, each of which represents a single property in RetrySettings. It is an alternative way of initializing RetrySettings instances.
        Parameters:
        settings - retry settings
        options - zero or more Retry
        Returns:
        new RetrySettings instance, which is a result of merging options into settings, i.e. each element in options, if present, overrides corresponding property in settings