@Singleton @Requires(beans={RoutesVersioningConfiguration.class,HeaderVersionResolverConfiguration.class}) public class HeaderVersionResolver extends java.lang.Object implements RequestVersionResolver
RequestVersionResolver
responsible for extracting version from HttpHeaders
.Constructor and Description |
---|
HeaderVersionResolver(HeaderVersionResolverConfiguration configuration)
Creates a
RequestVersionResolver to extract version from request header. |
Modifier and Type | Method and Description |
---|---|
java.util.Optional<java.lang.String> |
resolve(HttpRequest<?> request)
Resolves a version from a given object.
|
@Inject public HeaderVersionResolver(HeaderVersionResolverConfiguration configuration)
RequestVersionResolver
to extract version from request header.configuration
- A configuration to pick correct request header names.public java.util.Optional<java.lang.String> resolve(HttpRequest<?> request)
VersionResolver
resolve
in interface VersionResolver<HttpRequest<?>,java.lang.String>
request
- The type of object to resolve from