Class RetryPolicy.Builder

  • All Implemented Interfaces:
    com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, RetryPolicyOrBuilder, java.lang.Cloneable
    Enclosing class:
    RetryPolicy

    public static final class RetryPolicy.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<RetryPolicy.Builder>
    implements RetryPolicyOrBuilder
     How retries ought to be handled, usable by both workflows and activities
     
    Protobuf type temporal.api.common.v1.RetryPolicy
    • Method Detail

      • 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<RetryPolicy.Builder>
      • clear

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

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

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

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

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

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

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

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

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

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

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

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

        public RetryPolicy.Builder mergeFrom​(com.google.protobuf.CodedInputStream input,
                                             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                      throws java.io.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<RetryPolicy.Builder>
        Throws:
        java.io.IOException
      • hasInitialInterval

        public boolean hasInitialInterval()
         Interval of the first retry. If retryBackoffCoefficient is 1.0 then it is used for all retries.
         
        .google.protobuf.Duration initial_interval = 1 [(.gogoproto.stdduration) = true];
        Specified by:
        hasInitialInterval in interface RetryPolicyOrBuilder
        Returns:
        Whether the initialInterval field is set.
      • getInitialInterval

        public com.google.protobuf.Duration getInitialInterval()
         Interval of the first retry. If retryBackoffCoefficient is 1.0 then it is used for all retries.
         
        .google.protobuf.Duration initial_interval = 1 [(.gogoproto.stdduration) = true];
        Specified by:
        getInitialInterval in interface RetryPolicyOrBuilder
        Returns:
        The initialInterval.
      • setInitialInterval

        public RetryPolicy.Builder setInitialInterval​(com.google.protobuf.Duration value)
         Interval of the first retry. If retryBackoffCoefficient is 1.0 then it is used for all retries.
         
        .google.protobuf.Duration initial_interval = 1 [(.gogoproto.stdduration) = true];
      • setInitialInterval

        public RetryPolicy.Builder setInitialInterval​(com.google.protobuf.Duration.Builder builderForValue)
         Interval of the first retry. If retryBackoffCoefficient is 1.0 then it is used for all retries.
         
        .google.protobuf.Duration initial_interval = 1 [(.gogoproto.stdduration) = true];
      • mergeInitialInterval

        public RetryPolicy.Builder mergeInitialInterval​(com.google.protobuf.Duration value)
         Interval of the first retry. If retryBackoffCoefficient is 1.0 then it is used for all retries.
         
        .google.protobuf.Duration initial_interval = 1 [(.gogoproto.stdduration) = true];
      • clearInitialInterval

        public RetryPolicy.Builder clearInitialInterval()
         Interval of the first retry. If retryBackoffCoefficient is 1.0 then it is used for all retries.
         
        .google.protobuf.Duration initial_interval = 1 [(.gogoproto.stdduration) = true];
      • getInitialIntervalBuilder

        public com.google.protobuf.Duration.Builder getInitialIntervalBuilder()
         Interval of the first retry. If retryBackoffCoefficient is 1.0 then it is used for all retries.
         
        .google.protobuf.Duration initial_interval = 1 [(.gogoproto.stdduration) = true];
      • getInitialIntervalOrBuilder

        public com.google.protobuf.DurationOrBuilder getInitialIntervalOrBuilder()
         Interval of the first retry. If retryBackoffCoefficient is 1.0 then it is used for all retries.
         
        .google.protobuf.Duration initial_interval = 1 [(.gogoproto.stdduration) = true];
        Specified by:
        getInitialIntervalOrBuilder in interface RetryPolicyOrBuilder
      • getBackoffCoefficient

        public double getBackoffCoefficient()
         Coefficient used to calculate the next retry interval.
         The next retry interval is previous interval multiplied by the coefficient.
         Must be 1 or larger.
         
        double backoff_coefficient = 2;
        Specified by:
        getBackoffCoefficient in interface RetryPolicyOrBuilder
        Returns:
        The backoffCoefficient.
      • setBackoffCoefficient

        public RetryPolicy.Builder setBackoffCoefficient​(double value)
         Coefficient used to calculate the next retry interval.
         The next retry interval is previous interval multiplied by the coefficient.
         Must be 1 or larger.
         
        double backoff_coefficient = 2;
        Parameters:
        value - The backoffCoefficient to set.
        Returns:
        This builder for chaining.
      • clearBackoffCoefficient

        public RetryPolicy.Builder clearBackoffCoefficient()
         Coefficient used to calculate the next retry interval.
         The next retry interval is previous interval multiplied by the coefficient.
         Must be 1 or larger.
         
        double backoff_coefficient = 2;
        Returns:
        This builder for chaining.
      • hasMaximumInterval

        public boolean hasMaximumInterval()
         Maximum interval between retries. Exponential backoff leads to interval increase.
         This value is the cap of the increase. Default is 100x of the initial interval.
         
        .google.protobuf.Duration maximum_interval = 3 [(.gogoproto.stdduration) = true];
        Specified by:
        hasMaximumInterval in interface RetryPolicyOrBuilder
        Returns:
        Whether the maximumInterval field is set.
      • getMaximumInterval

        public com.google.protobuf.Duration getMaximumInterval()
         Maximum interval between retries. Exponential backoff leads to interval increase.
         This value is the cap of the increase. Default is 100x of the initial interval.
         
        .google.protobuf.Duration maximum_interval = 3 [(.gogoproto.stdduration) = true];
        Specified by:
        getMaximumInterval in interface RetryPolicyOrBuilder
        Returns:
        The maximumInterval.
      • setMaximumInterval

        public RetryPolicy.Builder setMaximumInterval​(com.google.protobuf.Duration value)
         Maximum interval between retries. Exponential backoff leads to interval increase.
         This value is the cap of the increase. Default is 100x of the initial interval.
         
        .google.protobuf.Duration maximum_interval = 3 [(.gogoproto.stdduration) = true];
      • setMaximumInterval

        public RetryPolicy.Builder setMaximumInterval​(com.google.protobuf.Duration.Builder builderForValue)
         Maximum interval between retries. Exponential backoff leads to interval increase.
         This value is the cap of the increase. Default is 100x of the initial interval.
         
        .google.protobuf.Duration maximum_interval = 3 [(.gogoproto.stdduration) = true];
      • mergeMaximumInterval

        public RetryPolicy.Builder mergeMaximumInterval​(com.google.protobuf.Duration value)
         Maximum interval between retries. Exponential backoff leads to interval increase.
         This value is the cap of the increase. Default is 100x of the initial interval.
         
        .google.protobuf.Duration maximum_interval = 3 [(.gogoproto.stdduration) = true];
      • clearMaximumInterval

        public RetryPolicy.Builder clearMaximumInterval()
         Maximum interval between retries. Exponential backoff leads to interval increase.
         This value is the cap of the increase. Default is 100x of the initial interval.
         
        .google.protobuf.Duration maximum_interval = 3 [(.gogoproto.stdduration) = true];
      • getMaximumIntervalBuilder

        public com.google.protobuf.Duration.Builder getMaximumIntervalBuilder()
         Maximum interval between retries. Exponential backoff leads to interval increase.
         This value is the cap of the increase. Default is 100x of the initial interval.
         
        .google.protobuf.Duration maximum_interval = 3 [(.gogoproto.stdduration) = true];
      • getMaximumIntervalOrBuilder

        public com.google.protobuf.DurationOrBuilder getMaximumIntervalOrBuilder()
         Maximum interval between retries. Exponential backoff leads to interval increase.
         This value is the cap of the increase. Default is 100x of the initial interval.
         
        .google.protobuf.Duration maximum_interval = 3 [(.gogoproto.stdduration) = true];
        Specified by:
        getMaximumIntervalOrBuilder in interface RetryPolicyOrBuilder
      • getMaximumAttempts

        public int getMaximumAttempts()
         Maximum number of attempts. When exceeded the retries stop even if not expired yet.
         1 disables retries. 0 means unlimited (up to the timeouts)
         
        int32 maximum_attempts = 4;
        Specified by:
        getMaximumAttempts in interface RetryPolicyOrBuilder
        Returns:
        The maximumAttempts.
      • setMaximumAttempts

        public RetryPolicy.Builder setMaximumAttempts​(int value)
         Maximum number of attempts. When exceeded the retries stop even if not expired yet.
         1 disables retries. 0 means unlimited (up to the timeouts)
         
        int32 maximum_attempts = 4;
        Parameters:
        value - The maximumAttempts to set.
        Returns:
        This builder for chaining.
      • clearMaximumAttempts

        public RetryPolicy.Builder clearMaximumAttempts()
         Maximum number of attempts. When exceeded the retries stop even if not expired yet.
         1 disables retries. 0 means unlimited (up to the timeouts)
         
        int32 maximum_attempts = 4;
        Returns:
        This builder for chaining.
      • getNonRetryableErrorTypesList

        public com.google.protobuf.ProtocolStringList getNonRetryableErrorTypesList()
         Non-Retryable errors types. Will stop retrying if the error type matches this list. Note that
         this is not a substring match, the error *type* (not message) must match exactly.
         
        repeated string non_retryable_error_types = 5;
        Specified by:
        getNonRetryableErrorTypesList in interface RetryPolicyOrBuilder
        Returns:
        A list containing the nonRetryableErrorTypes.
      • getNonRetryableErrorTypesCount

        public int getNonRetryableErrorTypesCount()
         Non-Retryable errors types. Will stop retrying if the error type matches this list. Note that
         this is not a substring match, the error *type* (not message) must match exactly.
         
        repeated string non_retryable_error_types = 5;
        Specified by:
        getNonRetryableErrorTypesCount in interface RetryPolicyOrBuilder
        Returns:
        The count of nonRetryableErrorTypes.
      • getNonRetryableErrorTypes

        public java.lang.String getNonRetryableErrorTypes​(int index)
         Non-Retryable errors types. Will stop retrying if the error type matches this list. Note that
         this is not a substring match, the error *type* (not message) must match exactly.
         
        repeated string non_retryable_error_types = 5;
        Specified by:
        getNonRetryableErrorTypes in interface RetryPolicyOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The nonRetryableErrorTypes at the given index.
      • getNonRetryableErrorTypesBytes

        public com.google.protobuf.ByteString getNonRetryableErrorTypesBytes​(int index)
         Non-Retryable errors types. Will stop retrying if the error type matches this list. Note that
         this is not a substring match, the error *type* (not message) must match exactly.
         
        repeated string non_retryable_error_types = 5;
        Specified by:
        getNonRetryableErrorTypesBytes in interface RetryPolicyOrBuilder
        Parameters:
        index - The index of the value to return.
        Returns:
        The bytes of the nonRetryableErrorTypes at the given index.
      • setNonRetryableErrorTypes

        public RetryPolicy.Builder setNonRetryableErrorTypes​(int index,
                                                             java.lang.String value)
         Non-Retryable errors types. Will stop retrying if the error type matches this list. Note that
         this is not a substring match, the error *type* (not message) must match exactly.
         
        repeated string non_retryable_error_types = 5;
        Parameters:
        index - The index to set the value at.
        value - The nonRetryableErrorTypes to set.
        Returns:
        This builder for chaining.
      • addNonRetryableErrorTypes

        public RetryPolicy.Builder addNonRetryableErrorTypes​(java.lang.String value)
         Non-Retryable errors types. Will stop retrying if the error type matches this list. Note that
         this is not a substring match, the error *type* (not message) must match exactly.
         
        repeated string non_retryable_error_types = 5;
        Parameters:
        value - The nonRetryableErrorTypes to add.
        Returns:
        This builder for chaining.
      • addAllNonRetryableErrorTypes

        public RetryPolicy.Builder addAllNonRetryableErrorTypes​(java.lang.Iterable<java.lang.String> values)
         Non-Retryable errors types. Will stop retrying if the error type matches this list. Note that
         this is not a substring match, the error *type* (not message) must match exactly.
         
        repeated string non_retryable_error_types = 5;
        Parameters:
        values - The nonRetryableErrorTypes to add.
        Returns:
        This builder for chaining.
      • clearNonRetryableErrorTypes

        public RetryPolicy.Builder clearNonRetryableErrorTypes()
         Non-Retryable errors types. Will stop retrying if the error type matches this list. Note that
         this is not a substring match, the error *type* (not message) must match exactly.
         
        repeated string non_retryable_error_types = 5;
        Returns:
        This builder for chaining.
      • addNonRetryableErrorTypesBytes

        public RetryPolicy.Builder addNonRetryableErrorTypesBytes​(com.google.protobuf.ByteString value)
         Non-Retryable errors types. Will stop retrying if the error type matches this list. Note that
         this is not a substring match, the error *type* (not message) must match exactly.
         
        repeated string non_retryable_error_types = 5;
        Parameters:
        value - The bytes of the nonRetryableErrorTypes to add.
        Returns:
        This builder for chaining.
      • setUnknownFields

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

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