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 SummaryModifier 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- 
setRequestPredicatepublic 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
 
- 
setDeprecationDateSpecify a deprecation date for the "Deprecation" response header.- Parameters:
- date- the deprecation date
- Returns:
- the same spec instance
 
- 
setDeprecationLinkSpecify a URL for the "Link" response header withrel="deprecation"andtype="text/html".- Parameters:
- uri- the link value
- Returns:
- the same spec instance
 
- 
setDeprecationLinkpublic StandardApiVersionDeprecationHandler.VersionSpec setDeprecationLink(URI uri, MediaType mediaType) Variation ofsetDeprecationLink(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
 
- 
setSunsetDateSpecify a deprecation date for the "Sunset" response header.- Parameters:
- date- the sunset date
- Returns:
- the same spec instance
 
- 
setSunsetLinkSpecify a URL for the "Link" response header withrel="sunset"andtype="text/html".- Parameters:
- uri- the link value
- Returns:
- the same spec instance
 
- 
setSunsetLinkVariation ofsetSunsetLink(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
 
 
-