ApiIO<I, O> constructor
ApiIO<I, O> ({
- required String name,
- required String serverName,
- required HttpMethod method,
- required String path,
- ApiInOutCreator<
I> ? inputCreator, - ApiInOutCreator<
O> ? outputCreator, - UriBuilder<
I> ? uriBuilder, - ApiIORequestBuilder<
I> ? requestBuilder, - ApiIOResponseParser<
O> ? responseParser,
Construct API.
In name
, specify a logical name of API.
In serverName
, specify a logical name of ApiServer.
In method
, specify method of http.
In path
, specify the path that is part of the API URI.
In inputCreator
, specify the process to create a DTO for input to an API
In outputCreator
, specify the process to create a DTO for output to an API
In uriBuilder
, specify the process of building uri to request to the server.
In requestBuilder
, specify the process of building HttpClientRequest, an HTTP request to the server.
In responseParser
, specify the process of parsing from HttpClientResponse, an HTTP response from the server, to the output DTO.
Implementation
ApiIO(
{
required String name,
required String serverName,
required HttpMethod method,
required String path,
ApiInOutCreator<I>? inputCreator,
ApiInOutCreator<O>? outputCreator,
UriBuilder<I>? uriBuilder,
ApiIORequestBuilder<I>? requestBuilder,
ApiIOResponseParser<O>? responseParser
}
) : _serverName = serverName,
_method = method,
_path = path,
_inputCreator = inputCreator,
_outputCreator = outputCreator,
_uriBuilder = uriBuilder,
_requestBuilder = requestBuilder,
_responseParser = responseParser,
super(name);