public abstract class ApiMethod<T extends ApiMethod<T,TResult>,TResult> extends Object implements RequestCommand<TResult>, ClientRequestCommand<TResult>
| Modifier and Type | Class and Description |
|---|---|
static class |
ApiMethod.ParamEntry<K,V> |
| Constructor and Description |
|---|
ApiMethod(ApiHttpClient apiHttpClient) |
ApiMethod(ApiHttpClient apiHttpClient,
ApiHttpHeaders headers,
List<ApiMethod.ParamEntry<String,String>> queryParams) |
ApiMethod(ApiMethod<T,TResult> apiMethod) |
public ApiMethod(ApiHttpClient apiHttpClient)
public ApiMethod(ApiHttpClient apiHttpClient, ApiHttpHeaders headers, List<ApiMethod.ParamEntry<String,String>> queryParams)
public T addHeader(String key, String value)
key - header namevalue - header valuepublic T withoutHeader(String key)
key - header namepublic T withHeader(String key, String value)
key - header namevalue - header valuepublic T withHeaders(ApiHttpHeaders headers)
headers - public T contentType(String contentType)
contentType - public ApiHttpHeaders getHeaders()
public <V> T addQueryParam(String key, V value)
V - value typekey - query parameter namevalue - query parameter valuepublic <V> T withQueryParam(String key, V value)
V - value typekey - query parameter namevalue - query parameter valuepublic T withoutQueryParam(String key)
key - query parameter namepublic T withQueryParams(List<ApiMethod.ParamEntry<String,String>> queryParams)
queryParams - list of query parameterspublic T addQueryParams(List<ApiMethod.ParamEntry<String,String>> queryParams)
queryParams - list of query parameterspublic List<ApiMethod.ParamEntry<String,String>> getQueryParams()
public String getQueryParamUriString()
public abstract ApiHttpRequest createHttpRequest()
public CompletableFuture<ApiHttpResponse<TResult>> execute()
execute in interface RequestCommand<TResult>public abstract CompletableFuture<ApiHttpResponse<TResult>> execute(ApiHttpClient client)
execute in interface ClientRequestCommand<TResult>public ApiHttpResponse<TResult> executeBlocking()
executeBlocking in interface RequestCommand<TResult>public ApiHttpResponse<TResult> executeBlocking(ApiHttpClient client)
executeBlocking in interface ClientRequestCommand<TResult>public ApiHttpResponse<TResult> executeBlocking(Duration timeout)
executeBlocking in interface RequestCommand<TResult>public abstract ApiHttpResponse<TResult> executeBlocking(ApiHttpClient client, Duration timeout)
executeBlocking in interface ClientRequestCommand<TResult>public CompletableFuture<ApiHttpResponse<byte[]>> send()
public ApiHttpResponse<byte[]> sendBlocking()
public ApiHttpResponse<byte[]> sendBlocking(Duration timeout)
public int reflectionHashCode()