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
  • Method Details

    • insertVersion

      default URI insertVersion(Object version, URI uri)
      Insert the version into the URI.

      The default implementation returns the supplied URI unmodified.

      Parameters:
      version - the version to insert
      uri - the URI for the request
      Returns:
      the updated URI, or the original URI unmodified
    • insertVersion

      default void insertVersion(Object version, HttpHeaders headers)
      Insert 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
    • fromHeader

      static ApiVersionInserter.Builder fromHeader(@Nullable String header)
      Create a builder for an inserter that sets a header.
      Parameters:
      header - the name of a header to hold the version
    • fromQueryParam

      static ApiVersionInserter.Builder fromQueryParam(@Nullable String queryParam)
      Create a builder for an inserter that sets a query parameter.
      Parameters:
      queryParam - the name of a query parameter to hold the version
    • fromPathSegment

      static ApiVersionInserter.Builder fromPathSegment(@Nullable Integer pathSegmentIndex)
      Create a builder for an inserter that inserts a path segment.
      Parameters:
      pathSegmentIndex - the index of the path segment to hold the version