Class DefaultRetryToken.Builder
- java.lang.Object
-
- software.amazon.awssdk.retries.internal.DefaultRetryToken.Builder
-
- All Implemented Interfaces:
Buildable,CopyableBuilder<DefaultRetryToken.Builder,DefaultRetryToken>,SdkBuilder<DefaultRetryToken.Builder,DefaultRetryToken>
- Enclosing class:
- DefaultRetryToken
public static class DefaultRetryToken.Builder extends Object implements CopyableBuilder<DefaultRetryToken.Builder,DefaultRetryToken>
A builder class to createDefaultRetryTokeninstances or to mutate them.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DefaultRetryToken.BuilderaddFailure(Throwable failure)Adds aThrowableto the retry-token.DefaultRetryTokenbuild()Creates a newDefaultRetryTokenwith the configured values.DefaultRetryToken.BuildercapacityAcquired(int capacityAcquired)Sets the capacity acquired from the token bucket.DefaultRetryToken.BuildercapacityRemaining(int capacityRemaining)Sets the capacity remaining in the token bucket after the last acquire.DefaultRetryToken.BuilderincreaseAttempt()Increments the current attempt count.DefaultRetryToken.Builderscope(String scope)Sets the scope of the retry token.DefaultRetryToken.Builderstate(DefaultRetryToken.TokenState state)Sets the state of the retry token.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.utils.builder.CopyableBuilder
copy
-
Methods inherited from interface software.amazon.awssdk.utils.builder.SdkBuilder
applyMutation
-
-
-
-
Method Detail
-
scope
public DefaultRetryToken.Builder scope(String scope)
Sets the scope of the retry token.
-
state
public DefaultRetryToken.Builder state(DefaultRetryToken.TokenState state)
Sets the state of the retry token.
-
increaseAttempt
public DefaultRetryToken.Builder increaseAttempt()
Increments the current attempt count.
-
capacityAcquired
public DefaultRetryToken.Builder capacityAcquired(int capacityAcquired)
Sets the capacity acquired from the token bucket.
-
capacityRemaining
public DefaultRetryToken.Builder capacityRemaining(int capacityRemaining)
Sets the capacity remaining in the token bucket after the last acquire.
-
addFailure
public DefaultRetryToken.Builder addFailure(Throwable failure)
Adds aThrowableto the retry-token.
-
build
public DefaultRetryToken build()
Creates a newDefaultRetryTokenwith the configured values.- Specified by:
buildin interfaceBuildable- Specified by:
buildin interfaceSdkBuilder<DefaultRetryToken.Builder,DefaultRetryToken>
-
-