@ -34,7 +34,7 @@ import org.springframework.web.accept.SemanticApiVersionParser;
import org.springframework.web.server.ServerWebExchange ;
import org.springframework.web.server.ServerWebExchange ;
/ * *
/ * *
* { @code ApiDeprecationHandler } based on
* { @code ApiVersion DeprecationHandler } based on
* < a href = "https://datatracker.ietf.org/doc/html/rfc9745" > RFC 9745 < / a > and
* < a href = "https://datatracker.ietf.org/doc/html/rfc9745" > RFC 9745 < / a > and
* < a href = "https://datatracker.ietf.org/doc/html/rfc8594" > RFC 8594 < / a > that
* < a href = "https://datatracker.ietf.org/doc/html/rfc8594" > RFC 8594 < / a > that
* provides the option to set the "Deprecation" and "Sunset" response headers ,
* provides the option to set the "Deprecation" and "Sunset" response headers ,
@ -46,7 +46,7 @@ import org.springframework.web.server.ServerWebExchange;
* @author Rossen Stoyanchev
* @author Rossen Stoyanchev
* @since 7 . 0
* @since 7 . 0
* /
* /
public class StandardApiDeprecationHandler implements ApiDeprecationHandler {
public class StandardApiVersion DeprecationHandler implements ApiVersion DeprecationHandler {
private final ApiVersionParser < ? > versionParser ;
private final ApiVersionParser < ? > versionParser ;
@ -58,9 +58,9 @@ public class StandardApiDeprecationHandler implements ApiDeprecationHandler {
* < p > By default , { @link SemanticApiVersionParser } is used to parse configured
* < p > By default , { @link SemanticApiVersionParser } is used to parse configured
* API versions , so those can be compared to request versions parsed at runtime .
* API versions , so those can be compared to request versions parsed at runtime .
* If you have a custom parser , then please use the
* If you have a custom parser , then please use the
* { @link # StandardApiDeprecationHandler ( ApiVersionParser ) } constructor .
* { @link # StandardApiVersion DeprecationHandler ( ApiVersionParser ) } constructor .
* /
* /
public StandardApiDeprecationHandler ( ) {
public StandardApiVersion DeprecationHandler ( ) {
this ( new SemanticApiVersionParser ( ) ) ;
this ( new SemanticApiVersionParser ( ) ) ;
}
}
@ -69,7 +69,7 @@ public class StandardApiDeprecationHandler implements ApiDeprecationHandler {
* This needs to be the same as the parser type used at runtime to parse
* This needs to be the same as the parser type used at runtime to parse
* request versions .
* request versions .
* /
* /
public StandardApiDeprecationHandler ( ApiVersionParser < ? > parser ) {
public StandardApiVersion DeprecationHandler ( ApiVersionParser < ? > parser ) {
this . versionParser = parser ;
this . versionParser = parser ;
}
}
@ -108,7 +108,7 @@ public class StandardApiDeprecationHandler implements ApiDeprecationHandler {
@Override
@Override
public String toString ( ) {
public String toString ( ) {
return "StandardApiDeprecationHandler " + this . infos . values ( ) ;
return "StandardApiVersion DeprecationHandler " + this . infos . values ( ) ;
}
}
@ -121,7 +121,7 @@ public class StandardApiDeprecationHandler implements ApiDeprecationHandler {
private VersionSpec ( Comparable < ? > version ) {
private VersionSpec ( Comparable < ? > version ) {
this . version = version ;
this . version = version ;
StandardApiDeprecationHandler . this . infos . put ( version , new VersionInfo ( version ) ) ;
StandardApiVersion DeprecationHandler . this . infos . put ( version , new VersionInfo ( version ) ) ;
}
}
/ * *
/ * *
@ -197,7 +197,7 @@ public class StandardApiDeprecationHandler implements ApiDeprecationHandler {
}
}
private VersionSpec map ( Function < VersionInfo , VersionInfo > function ) {
private VersionSpec map ( Function < VersionInfo , VersionInfo > function ) {
StandardApiDeprecationHandler . this . infos . compute ( this . version , ( version , versionInfo ) - > {
StandardApiVersion DeprecationHandler . this . infos . compute ( this . version , ( version , versionInfo ) - > {
Assert . state ( versionInfo ! = null , "No VersionInfo" ) ;
Assert . state ( versionInfo ! = null , "No VersionInfo" ) ;
return function . apply ( versionInfo ) ;
return function . apply ( versionInfo ) ;
} ) ;
} ) ;