Class RetryProperties.Builder
java.lang.Object
co.yellowdog.platform.model.builders.ValidatedBuilder<RetryProperties>
co.yellowdog.platform.model.RetryProperties.Builder
- Enclosing class:
RetryProperties
A builder that can be used to build a new RetryProperties that is automatically validated on build.
-
Method Summary
Modifier and TypeMethodDescriptionBuilds the object without enforcing validation constraints.initialInterval(Duration initialInterval) The initial interval before the first retry attempt.maxAttempts(int maxAttempts) The maximum number of retries after the initial request fails.maxInterval(Duration maxInterval) The maximum interval between retry attempts.toString()Methods inherited from class ValidatedBuilder
build, validateModifier and TypeMethodDescriptionbuild()Builds and validates the object.Set<jakarta.validation.ConstraintViolation<RetryProperties>> validate()Performs validation based on the current builder properties and returns the ConstraintViolations without throwing.
-
Method Details
-
maxAttempts
The maximum number of retries after the initial request fails. A request is sent at most maxAttempts + 1 times before retries are exhausted.- Parameters:
maxAttempts- the maximum number of retries after the initial request- Returns:
this.
-
initialInterval
The initial interval before the first retry attempt. With Full Jitter applied, the actual interval of the first retry is anywhere between 0 and this value. Subsequent retry intervals grow exponentially.- Parameters:
initialInterval- the initial interval before the first retry attempt- Returns:
this.
-
maxInterval
The maximum interval between retry attempts.- Parameters:
maxInterval- the maximum interval between retry attempts- Returns:
this.
-
buildUnchecked
Description copied from class:ValidatedBuilderBuilds the object without enforcing validation constraints. Use this when the object is validated later, for example as part of an enclosing object built withValidatedBuilder.build(), or when it does not need to be valid on its own.- Overrides:
buildUncheckedin classValidatedBuilder<RetryProperties>- Returns:
- the object being built
-
toString
-