Interface NetworkResponse

  • All Implemented Interfaces:

    
    public interface NetworkResponse
    
                        

    Interface representing a response from the IM network operation.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Integer getStatusCode() Retrieves the status code of the HTTP response.
      abstract String getError() Retrieves the error associated with the response, if any.
      abstract ByteString getByteString() Retrieves the response as a ByteString.
      abstract <T extends Any> T getResponse(Class<T> responseModelClass) Retrieves the response parsed into the specified type asynchronously.
      abstract <T extends Any> T getResponse(Class<T> responseModelClass, Function1<String, String> modifyResponse) Retrieves the response parsed into the specified type asynchronously.
      abstract NetworkMetaData getMetadata() Retrieves the metadata associated with the network response.
      abstract String getUrl() Retrieves the url associated with the network request.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • 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.

      • getUrl

         abstract String getUrl()

        Retrieves the url associated with the network request.

        Returns:

        The url of the request.