Package de.sonallux.spotify.api.http
Class ApiCall<T>
- java.lang.Object
-
- de.sonallux.spotify.api.http.ApiCall<T>
-
- Direct Known Subclasses:
AuthorizedApiCall
public class ApiCall<T> extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classApiCall.Factory
-
Constructor Summary
Constructors Constructor Description ApiCall()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel()Texecute()Response<T>executeCall()protected okhttp3.CallgetRawCall()Returns the raw call, initializing it if necessary.booleanisCanceled()booleanisExecuted()protected Response<T>parseResponse(okhttp3.Response rawResponse)
-
-
-
Method Detail
-
getRawCall
protected okhttp3.Call getRawCall() throws IOExceptionReturns the raw call, initializing it if necessary. Throws if initializing the raw call throws, or has thrown in previous attempts to create it.- Throws:
IOException
-
isExecuted
public boolean isExecuted()
-
executeCall
public Response<T> executeCall() throws IOException
- Throws:
IOException
-
execute
public T execute() throws SpotifyApiException
- Throws:
SpotifyApiException
-
parseResponse
protected Response<T> parseResponse(okhttp3.Response rawResponse) throws IOException
- Throws:
IOException
-
cancel
public void cancel()
-
isCanceled
public boolean isCanceled()
-
-