public abstract class AbstractRequest<T> extends Object
Constructor and Description |
---|
AbstractRequest(SberApiClient client) |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
build() |
T |
execute()
Выполнить запрос
|
SberApiClient |
getClient() |
protected abstract String |
getEndpoint() |
protected abstract org.apache.http.client.methods.HttpRequestBase |
getMethod() |
List<org.apache.http.NameValuePair> |
getParams() |
protected abstract Class<T> |
getResponseType() |
protected void |
postCheck(T response) |
protected abstract void |
preExecute() |
protected void |
setHeader(String name,
String value) |
protected void |
setParam(String name,
String value) |
public AbstractRequest(SberApiClient client)
public SberApiClient getClient()
public List<org.apache.http.NameValuePair> getParams()
protected abstract org.apache.http.client.methods.HttpRequestBase getMethod()
protected abstract String getEndpoint()
protected abstract void preExecute() throws ApiException
ApiException
protected void postCheck(T response) throws ApiException
ApiException
protected abstract void build()
public T execute() throws ApiException, IOException
ApiException
- в случае возвращения ошибки от apiIOException
Copyright © 2020. All rights reserved.