@Singleton @Requires(beans={RoutesVersioningConfiguration.class,ParameterVersionResolverConfiguration.class}) public class ParameterVersionResolver extends java.lang.Object implements RequestVersionResolver
RequestVersionResolver
responsible for extracting version from HttpParameters
.Constructor and Description |
---|
ParameterVersionResolver(ParameterVersionResolverConfiguration configuration)
Creates a
RequestVersionResolver to extract version from request parameter. |
Modifier and Type | Method and Description |
---|---|
java.util.Optional<java.lang.String> |
resolve(HttpRequest<?> request)
Resolves a version from a given object.
|
@Inject public ParameterVersionResolver(ParameterVersionResolverConfiguration configuration)
RequestVersionResolver
to extract version from request parameter.configuration
- A configuration to pick correct request parameter 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