Class StandardApiVersionDeprecationHandler.VersionSpec
java.lang.Object
org.springframework.web.reactive.accept.StandardApiVersionDeprecationHandler.VersionSpec
- Enclosing class:
StandardApiVersionDeprecationHandler
A spec to configure deprecation details for an API version.
- Since:
- 7.0
- Author:
- Rossen Stoyanchev
-
Method Summary
Modifier and TypeMethodDescriptionSpecify a deprecation date for the "Deprecation" response header.setDeprecationLink
(URI uri) Specify a URL for the "Link" response header withrel="deprecation"
andtype="text/html"
.setDeprecationLink
(URI uri, MediaType mediaType) Variation ofsetDeprecationLink(URI)
for use with a media type other than "text/html".setExchangePredicate
(Predicate<ServerWebExchange> predicate) Set a predicate to further filter the exchanges to handle.setSunsetDate
(ZonedDateTime date) Specify a deprecation date for the "Sunset" response header.setSunsetLink
(URI uri) Specify a URL for the "Link" response header withrel="sunset"
andtype="text/html"
.setSunsetLink
(URI uri, MediaType mediaType) Variation ofsetSunsetLink(URI)
for use with a media type other than "text/html".
-
Method Details
-
setExchangePredicate
public StandardApiVersionDeprecationHandler.VersionSpec setExchangePredicate(Predicate<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
Specify a URL for the "Link" response header withrel="deprecation"
andtype="text/html"
.- Parameters:
uri
- the link value- Returns:
- the same spec instance
-
setDeprecationLink
public StandardApiVersionDeprecationHandler.VersionSpec setDeprecationLink(URI uri, MediaType mediaType) Variation ofsetDeprecationLink(URI)
for use with a media type other than "text/html".- Parameters:
uri
- the link valuemediaType
- 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 withrel="sunset"
andtype="text/html"
.- Parameters:
uri
- the link value- Returns:
- the same spec instance
-
setSunsetLink
Variation ofsetSunsetLink(URI)
for use with a media type other than "text/html".- Parameters:
uri
- the link valuemediaType
- the media type to use- Returns:
- the same spec instance
-