Class StandardApiVersionDeprecationHandler.VersionSpec

java.lang.Object
org.springframework.web.reactive.accept.StandardApiVersionDeprecationHandler.VersionSpec
Enclosing class:
StandardApiVersionDeprecationHandler

public final class StandardApiVersionDeprecationHandler.VersionSpec extends Object
A spec to configure deprecation details for an API version.
Since:
7.0
Author:
Rossen Stoyanchev
  • Method Details

    • setExchangePredicate

      public StandardApiVersionDeprecationHandler.VersionSpec setExchangePredicate(Predicate<org.springframework.web.server.ServerWebExchange> predicate)
      Set a predicate to further filter the exchanges to handle.

      By default, all exchanges with the deprecated version are handled. This predicate can help to further narrow down the exchanges that should expose deprecation information.

      Parameters:
      predicate - a predicate to check the request with
      Returns:
      the same spec instance
    • setDeprecationDate

      Specify a deprecation date for the "Deprecation" response header.
      Parameters:
      date - the deprecation date
      Returns:
      the same spec instance
    • setDeprecationLink

      public StandardApiVersionDeprecationHandler.VersionSpec setDeprecationLink(URI uri)
      Specify a URL for the "Link" response header with rel="deprecation" and type="text/html".
      Parameters:
      uri - the link value
      Returns:
      the same spec instance
    • setDeprecationLink

      public StandardApiVersionDeprecationHandler.VersionSpec setDeprecationLink(URI uri, org.springframework.http.MediaType mediaType)
      Variation of setDeprecationLink(URI) for use with a media type other than "text/html".
      Parameters:
      uri - the link value
      mediaType - the media type to use
      Returns:
      the same spec instance
    • setSunsetDate

      Specify a deprecation date for the "Sunset" response header.
      Parameters:
      date - the sunset date
      Returns:
      the same spec instance
    • setSunsetLink

      Specify a URL for the "Link" response header with rel="sunset" and type="text/html".
      Parameters:
      uri - the link value
      Returns:
      the same spec instance
    • setSunsetLink

      public StandardApiVersionDeprecationHandler.VersionSpec setSunsetLink(URI uri, org.springframework.http.MediaType mediaType)
      Variation of setSunsetLink(URI) for use with a media type other than "text/html".
      Parameters:
      uri - the link value
      mediaType - the media type to use
      Returns:
      the same spec instance