Class RedirectHandlerOption

java.lang.Object
com.microsoft.kiota.http.middleware.options.RedirectHandlerOption
All Implemented Interfaces:
com.microsoft.kiota.RequestOption

public class RedirectHandlerOption extends Object implements com.microsoft.kiota.RequestOption
Options to be passed to the redirect middleware.
  • Field Details

    • DEFAULT_MAX_REDIRECTS

      public static final int DEFAULT_MAX_REDIRECTS
      The default maximum number of redirects to follow
      See Also:
    • MAX_REDIRECTS

      public static final int MAX_REDIRECTS
      The absolute maximum number of redirects that can be followed
      See Also:
    • DEFAULT_SHOULD_REDIRECT

      @Nonnull public static final IShouldRedirect DEFAULT_SHOULD_REDIRECT
      Default redirect evaluation, always follow redirect information.
  • Constructor Details

    • RedirectHandlerOption

      public RedirectHandlerOption()
      Create default instance of redirect options, with default values of max redirects and should redirect
    • RedirectHandlerOption

      public RedirectHandlerOption(int maxRedirects, @Nullable IShouldRedirect shouldRedirect)
      Create an instance with provided values
      Parameters:
      maxRedirects - Max redirects to occur
      shouldRedirect - Should redirect callback called before every redirect
  • Method Details

    • maxRedirects

      public int maxRedirects()
      Gets the maximum number of redirects to follow.
      Returns:
      max redirects
    • shouldRedirect

      @Nonnull public IShouldRedirect shouldRedirect()
      Gets the callback evaluating whether a redirect should be followed.
      Returns:
      should redirect
    • getType

      @Nonnull public <T extends com.microsoft.kiota.RequestOption> Class<T> getType()
      Specified by:
      getType in interface com.microsoft.kiota.RequestOption