程序包 com.volcengine
接口 ApiCallback<T>
-
- 类型参数:
T- The return type
public interface ApiCallback<T>Callback for asynchronous API call.
-
-
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 voidonDownloadProgress(long bytesRead, long contentLength, boolean done)This is called when the API downlond processing.voidonFailure(ApiException e, int statusCode, Map<String,List<String>> responseHeaders)This is called when the API call fails.voidonSuccess(T result, int statusCode, Map<String,List<String>> responseHeaders)This is called when the API call succeeded.voidonUploadProgress(long bytesWritten, long contentLength, boolean done)This is called when the API upload processing.
-
-
-
方法详细资料
-
onFailure
void onFailure(ApiException e, int statusCode, Map<String,List<String>> responseHeaders)
This is called when the API call fails.- 参数:
e- The exception causing the failurestatusCode- Status code of the response if available, otherwise it would be 0responseHeaders- Headers of the response if available, otherwise it would be null
-
onSuccess
void onSuccess(T result, int statusCode, Map<String,List<String>> responseHeaders)
This is called when the API call succeeded.- 参数:
result- The result deserialized from responsestatusCode- Status code of the responseresponseHeaders- Headers of the response
-
onUploadProgress
void onUploadProgress(long bytesWritten, long contentLength, boolean done)This is called when the API upload processing.- 参数:
bytesWritten- bytes WrittencontentLength- content length of request bodydone- write end
-
onDownloadProgress
void onDownloadProgress(long bytesRead, long contentLength, boolean done)This is called when the API downlond processing.- 参数:
bytesRead- bytes ReadcontentLength- content lenngth of the responsedone- Read end
-
-