Package com.inmobi.media.network.okhttp
Interface NetworkResponse
-
- All Implemented Interfaces:
public interface NetworkResponseInterface representing a response from the IM network operation.
-
-
Method Summary
Modifier and Type Method Description abstract IntegergetStatusCode()Retrieves the status code of the HTTP response. abstract StringgetError()Retrieves the error associated with the response, if any. abstract ByteStringgetByteString()Retrieves the response as a ByteString. abstract <T extends Any> TgetResponse(Class<T> responseModelClass)Retrieves the response parsed into the specified type asynchronously. abstract <T extends Any> TgetResponse(Class<T> responseModelClass, Function1<String, String> modifyResponse)Retrieves the response parsed into the specified type asynchronously. abstract NetworkMetaDatagetMetadata()Retrieves the metadata associated with the network response. abstract StringgetUrl()Retrieves the url associated with the network request. -
-
Method Detail
-
getStatusCode
abstract Integer getStatusCode()
Retrieves the status code of the HTTP response.
- Returns:
The status code.
-
getError
abstract String getError()
Retrieves the error associated with the response, if any.
- Returns:
The error message, or null if no error occurred.
-
getByteString
abstract ByteString getByteString()
Retrieves the response as a ByteString.
- Returns:
The string representation of the response.
-
getResponse
abstract <T extends Any> T getResponse(Class<T> responseModelClass)
Retrieves the response parsed into the specified type asynchronously.
- Parameters:
responseModelClass- The class of the response model to parse into.- Returns:
A Deferred result containing the parsed response, or null if parsing fails.
-
getResponse
abstract <T extends Any> T getResponse(Class<T> responseModelClass, Function1<String, String> modifyResponse)
Retrieves the response parsed into the specified type asynchronously.
- Parameters:
responseModelClass- The class of the response model to parse into.modifyResponse- allows the caller to modify the response to fit the model class.- Returns:
A Deferred result containing the parsed response, or null if parsing fails.
-
getMetadata
abstract NetworkMetaData getMetadata()
Retrieves the metadata associated with the network response.
- Returns:
The metadata of the network response.
-
-
-
-