Class RequestOption

java.lang.Object
org.azd.abstractions.RequestOption

public class RequestOption extends Object
Configuration class to configure the Api request before sending.
  • Constructor Details

    • RequestOption

      public RequestOption()
  • Method Details

    • getInstance

      public static RequestOption getInstance()
      Get a new instance.
      Returns:
      RequestObject instance.
    • getRedirectPolicy

      public HttpClient.Redirect getRedirectPolicy()
      Get the Http redirect policy.
      Returns:
      Default redirect policy.
    • setRedirectPolicy

      public void setRedirectPolicy(HttpClient.Redirect redirectPolicy)
      Sets the redirect policy.
      Parameters:
      redirectPolicy - Redirect policy to set.
    • getVersion

      public HttpClient.Version getVersion()
      Get the Http version.
      Returns:
      Default http version which is Http2.0.
    • setVersion

      public void setVersion(HttpClient.Version version)
      Sets the Http version.
      Parameters:
      version - Http version to set.
    • getConnectionTimeOut

      public Duration getConnectionTimeOut()
      Request timeout duration.
      Returns:
      Default timeout value. Set to 10 seconds.
    • setConnectionTimeOut

      public void setConnectionTimeOut(long seconds)
      Sets the timeout duration.
      Parameters:
      seconds - Seconds to set as timeout duration.
    • getProxySelector

      public ProxySelector getProxySelector()
      Get the proxy selector object.
      Returns:
      ProxySelector ProxySelector.
    • setProxySelector

      public void setProxySelector(ProxySelector proxySelector)
      Sets the proxy selector object.
      Parameters:
      proxySelector - Proxy selector object to set.
    • getAuthenticator

      public Authenticator getAuthenticator()
      Get the proxy authentication.
      Returns:
      Authenticator Authenticator.
    • setAuthenticator

      public void setAuthenticator(Authenticator authenticator)
      Sets the proxy authenticator.
      Parameters:
      authenticator - Proxy authenticator to set.