Class ParameterVersionResolver
java.lang.Object
io.micronaut.web.router.version.resolution.ParameterVersionResolver
- All Implemented Interfaces:
RequestVersionResolver
,VersionResolver<HttpRequest<?>,
String>
@Singleton
@Requires(beans={RoutesVersioningConfiguration.class,ParameterVersionResolverConfiguration.class})
public class ParameterVersionResolver
extends Object
implements RequestVersionResolver
A
RequestVersionResolver
responsible for extracting version from HttpParameters
.- Since:
- 1.1.0
- Author:
- Bogdan Oros
-
Constructor Summary
ConstructorDescriptionParameterVersionResolver
(ParameterVersionResolverConfiguration configuration) Creates aRequestVersionResolver
to extract version from request parameter. -
Method Summary
Modifier and TypeMethodDescriptionresolve
(HttpRequest<?> request) Resolves a version from a given object.
-
Constructor Details
-
ParameterVersionResolver
Creates aRequestVersionResolver
to extract version from request parameter.- Parameters:
configuration
- A configuration to pick correct request parameter names.
-
-
Method Details
-
resolve
Description copied from interface:VersionResolver
Resolves a version from a given object.- Specified by:
resolve
in interfaceVersionResolver<HttpRequest<?>,
String> - Parameters:
request
- The type of object to resolve from- Returns:
- An optional object representing the version
-