Class StandardApiVersionDeprecationHandler.VersionSpec
java.lang.Object
org.springframework.web.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".setRequestPredicate(Predicate<jakarta.servlet.http.HttpServletRequest> predicate) Set a predicate to filter which requests to send deprecation info to.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
-
setRequestPredicate
public StandardApiVersionDeprecationHandler.VersionSpec setRequestPredicate(Predicate<jakarta.servlet.http.HttpServletRequest> predicate) Set a predicate to filter which requests to send deprecation info to.By default, all requests with the deprecated version are handled. This predicate to narrow the requests 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
-