ResponseBody - VK API response type.public abstract class VkMethod<ResponseBody> extends Object
| Constructor and Description |
|---|
VkMethod() |
VkMethod(String accessToken) |
| Modifier and Type | Method and Description |
|---|---|
VkMethod<ResponseBody> |
addParam(String key,
Object value)
Adds URL parameter to HTTP request.
|
protected String |
csv(List<?> values)
Converts list of objects to comma separated values.
|
ResponseBody |
execute()
Executes request to VK API.
|
CompletableFuture<ResponseBody> |
executeAsync()
Executes request to VK API asynchronously.
|
protected String |
getAccessToken()
Gets
accessToken. |
protected com.google.gson.Gson |
getGson()
Gets
gson object. |
protected RequestBody |
getRequestBody()
Gets HTTP request body.
|
protected abstract Class<ResponseBody> |
getResponseClass()
Gets a class of VK API response.
|
abstract String |
getUri()
Gets request URI.
|
protected String |
property(String key)
Gets a property from
VK_PROPERTIES. |
String |
toString() |
public VkMethod(String accessToken)
public VkMethod()
public CompletableFuture<ResponseBody> executeAsync()
public ResponseBody execute() throws VkApiException
VkApiException - if errors occur.protected abstract Class<ResponseBody> getResponseClass()
public abstract String getUri()
protected RequestBody getRequestBody()
public VkMethod<ResponseBody> addParam(String key, Object value)
key - URL parameter key.value - URL parameter value.protected String csv(List<?> values)
values - list of objects.protected String property(String key)
VK_PROPERTIES.key - property key.protected String getAccessToken()
accessToken.accessToken.Copyright © 2022. All rights reserved.