Interface RedirectConfig.RedirectPredicate

Enclosing interface:
RedirectConfig
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface RedirectConfig.RedirectPredicate
Predicate to make the final decision if redirect should be performed or not based on the given context.

Implementations should prefer running this predicate as the last check, after validation of the HttpResponseStatus, RedirectConfig.maxRedirects(), RedirectConfig.allowedMethods(), presence of the Location header, and RedirectConfig.allowNonRelativeRedirects().

  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    test(boolean relative, int redirectCount, HttpRequestMetaData previousRequest, HttpResponseMetaData redirectResponse)
    Decides if a redirect should be performed or not based on the given context.
  • Method Details

    • test

      boolean test(boolean relative, int redirectCount, HttpRequestMetaData previousRequest, HttpResponseMetaData redirectResponse)
      Decides if a redirect should be performed or not based on the given context.
      Parameters:
      relative - if true, the redirect location was identified as relative to the previous request
      redirectCount - sequential counter of already processed redirects (starts from 0)
      previousRequest - previous request that was redirected
      redirectResponse - response to redirect
      Returns:
      true if the redirect should be processed based on the given context