Package org.openapitools.client
Interface ApiCallback<T>
- Type Parameters:
T
- The return type
public interface ApiCallback<T>
Callback for asynchronous API call.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
onDownloadProgress
(long bytesRead, long contentLength, boolean done) This is called when the API download processing.void
This is called when the API call fails.void
This is called when the API call succeeded.void
onUploadProgress
(long bytesWritten, long contentLength, boolean done) This is called when the API upload processing.
-
Method Details
-
onFailure
This is called when the API call fails.- Parameters:
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
This is called when the API call succeeded.- Parameters:
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.- Parameters:
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 download processing.- Parameters:
bytesRead
- bytes ReadcontentLength
- content length of the responsedone
- Read end
-