Interface ApiVersionInserter
public interface ApiVersionInserter
Contract to determine how to insert an API version into the URI or headers
of a request.
- Since:
- 7.0
- Author:
- Rossen Stoyanchev
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ApiVersionInserter.Builder
builder()
Create a builder for anApiVersionInserter
.default URI
insertVersion
(Object version, URI uri) Insert the version into the URI.default void
insertVersion
(Object version, HttpHeaders headers) Insert the version into the request headers.static ApiVersionInserter
Create an inserter that sets a header.static ApiVersionInserter
usePathSegment
(@Nullable Integer pathSegmentIndex) Create an inserter that inserts a path segment.static ApiVersionInserter
useQueryParam
(@Nullable String queryParam) Create an inserter that sets a query parameter.
-
Method Details
-
insertVersion
-
insertVersion
Insert the version into the request headers.The default implementation does not modify the supplied headers.
- Parameters:
version
- the version to insertheaders
- the request headers
-
useHeader
Create an inserter that sets a header.- Parameters:
header
- the name of a header to hold the version
-
useQueryParam
Create an inserter that sets a query parameter.- Parameters:
queryParam
- the name of a query parameter to hold the version
-
usePathSegment
Create an inserter that inserts a path segment.- Parameters:
pathSegmentIndex
- the index of the path segment to hold the version
-
builder
Create a builder for anApiVersionInserter
.
-