@Singleton @Requires(beans={RoutesVersioningConfiguration.class,HeaderVersionResolverConfiguration.class}) public class HeaderVersionResolver extends 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 |
---|---|
Optional<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 Optional<String> resolve(HttpRequest<?> request)
VersionResolver
resolve
in interface VersionResolver<HttpRequest<?>,String>
request
- The type of object to resolve from