Class RetryLock.Builder<T>
java.lang.Object
cloud.opencode.base.lock.local.RetryLock.Builder<T>
- Type Parameters:
T- the type of lock token | 锁令牌类型
Builder for RetryLock Configuration
RetryLock 配置构建器
Provides a fluent API for configuring retry behavior.
提供流式API用于配置重试行为。
- Since:
- JDK 25, opencode-base-lock V1.0.3
- Author:
- Leon Soo www.LeonSoo.com
-
Method Summary
Modifier and TypeMethodDescriptionbackoffMultiplier(double backoffMultiplier) Sets the backoff multiplier 设置退避倍数build()Builds the configured RetryLock 构建配置好的 RetryLockSets the maximum delay cap 设置最大延迟上限maxRetries(int maxRetries) Sets the maximum number of retry attempts 设置最大重试次数retryDelay(Duration retryDelay) Sets the initial delay between retries 设置重试之间的初始延迟
-
Method Details
-
maxRetries
Sets the maximum number of retry attempts 设置最大重试次数- Parameters:
maxRetries- the max retries (>= 0) | 最大重试次数(>= 0)- Returns:
- this builder | 此构建器
-
retryDelay
Sets the initial delay between retries 设置重试之间的初始延迟- Parameters:
retryDelay- the initial delay | 初始延迟- Returns:
- this builder | 此构建器
-
backoffMultiplier
Sets the backoff multiplier 设置退避倍数- Parameters:
backoffMultiplier- the multiplier (>= 1.0) | 倍数(>= 1.0)- Returns:
- this builder | 此构建器
-
maxDelay
Sets the maximum delay cap 设置最大延迟上限- Parameters:
maxDelay- the max delay | 最大延迟- Returns:
- this builder | 此构建器
-
build
-