Created
June 26, 2022 14:32
-
-
Save 0xZhangKe/2e66be9a759ac08e13a2f63d8ac2e8dc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ResponseCall<S, E : ErrorResponse.ErrorEntryWithMessage>( | |
| private val delegate: Call<S>, | |
| private val responseInstance: Response<S, E>, | |
| private val errorConverter: Converter<ResponseBody, E> | |
| ) : Call<Response<S, E>> { | |
| override fun enqueue(callback: Callback<Response<S, E>>) { | |
| TODO("Not yet implemented") | |
| } | |
| override fun isExecuted(): Boolean = delegate.isExecuted | |
| override fun clone(): Call<Response<S, E>> { | |
| return ResponseCall(delegate.clone(), responseInstance, errorConverter) | |
| } | |
| override fun cancel() { | |
| delegate.cancel() | |
| } | |
| override fun isCanceled(): Boolean = delegate.isCanceled | |
| override fun execute(): retrofit2.Response<Response<S, E>> { | |
| throw UnsupportedOperationException("ResponseCall not support execute") | |
| } | |
| override fun request(): Request = delegate.request() | |
| override fun timeout(): Timeout = delegate.timeout() | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment