Interface ApiVersionInserter
public interface ApiVersionInserter
Contract to insert an API version into the URI or headers of a request.
Use shortcut, static factory methods on this interface to create one of the built-in inserter type implementations:
Use the builder() for further options such as if you want to also
configure an ApiVersionFormatter.
- Since:
- 7.0
- Author:
- Rossen Stoyanchev
- 
Nested Class SummaryNested Classes
- 
Method SummaryModifier and TypeMethodDescriptionstatic ApiVersionInserter.Builderbuilder()Create a builder for anApiVersionInserter.default URIinsertVersion(Object version, URI uri) Insert the version into the URI.default voidinsertVersion(Object version, HttpHeaders headers) Insert the version into the request headers.static ApiVersionInserterCreate an inserter that sets a header.static ApiVersionInserteruseMediaTypeParam(@Nullable String mediaTypeParam) Create an inserter to set a MediaType parameter on the "Content-Type" header.static ApiVersionInserterusePathSegment(@Nullable Integer pathSegmentIndex) Create an inserter that inserts a path segment.static ApiVersionInserteruseQueryParam(@Nullable String queryParam) Create an inserter that sets a query parameter.
- 
Method Details- 
insertVersion
- 
insertVersionInsert the version into the request headers.The default implementation does not modify the supplied headers. - Parameters:
- version- the version to insert
- headers- the request headers
 
- 
useHeaderCreate an inserter that sets a header.- Parameters:
- header- the name of a header to hold the version
 
- 
useQueryParamCreate an inserter that sets a query parameter.- Parameters:
- queryParam- the name of a query parameter to hold the version
 
- 
useMediaTypeParamCreate an inserter to set a MediaType parameter on the "Content-Type" header.- Parameters:
- mediaTypeParam- the name of the media type parameter to hold the version
 
- 
usePathSegmentCreate an inserter that inserts a path segment.- Parameters:
- pathSegmentIndex- the index of the path segment to hold the version
 
- 
builderCreate a builder for anApiVersionInserter.
 
-