Class AsyncDevintestApiClientBuilder


  • public class AsyncDevintestApiClientBuilder
    extends java.lang.Object
    • Constructor Detail

      • AsyncDevintestApiClientBuilder

        public AsyncDevintestApiClientBuilder()
    • Method Detail

      • maxRetries

        public AsyncDevintestApiClientBuilder maxRetries​(int maxRetries)
        Sets the maximum number of retries for the client. Defaults to 2 retries.
      • buildClientOptions

        protected ClientOptions buildClientOptions()
      • setEnvironment

        protected void setEnvironment​(ClientOptions.Builder builder)
        Sets the environment configuration for the client. Override this method to modify URLs or add environment-specific logic.
        Parameters:
        builder - The ClientOptions.Builder to configure
      • setTimeouts

        protected void setTimeouts​(ClientOptions.Builder builder)
        Sets the request timeout configuration. Override this method to customize timeout behavior.
        Parameters:
        builder - The ClientOptions.Builder to configure
      • setRetries

        protected void setRetries​(ClientOptions.Builder builder)
        Sets the retry configuration for failed requests. Override this method to implement custom retry strategies.
        Parameters:
        builder - The ClientOptions.Builder to configure
      • setHttpClient

        protected void setHttpClient​(ClientOptions.Builder builder)
        Sets the OkHttp client configuration. Override this method to customize HTTP client behavior (interceptors, connection pools, etc).
        Parameters:
        builder - The ClientOptions.Builder to configure
      • setAdditional

        protected void setAdditional​(ClientOptions.Builder builder)
        Override this method to add any additional configuration to the client. This method is called at the end of the configuration chain, allowing you to add custom headers, modify settings, or perform any other client customization.
        Parameters:
        builder - The ClientOptions.Builder to configure Example:
        
         @Override
         protected void setAdditional(ClientOptions.Builder builder) {
             builder.addHeader("X-Request-ID", () -> UUID.randomUUID().toString());
             builder.addHeader("X-Client-Version", "1.0.0");
         }
         
      • validateConfiguration

        protected void validateConfiguration()
        Override this method to add custom validation logic before the client is built. This method is called at the beginning of the build() method to ensure the configuration is valid. Throw an exception to prevent client creation if validation fails. Example:
        
         @Override
         protected void validateConfiguration() {
             super.validateConfiguration(); // Run parent validations
             if (tenantId == null || tenantId.isEmpty()) {
                 throw new IllegalStateException("tenantId is required");
             }
         }