Class NetworkResponseImpl

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

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

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

      • NetworkResponseImpl

        NetworkResponseImpl(String resolvedUrl, Integer responseStatusCode, ByteString bodyBytes, NetworkMetaData responseMetaData)
    • Method Detail

      • getStatusCode

         Integer getStatusCode()

        Retrieves the status code of the HTTP response.

        Returns:

        The status code.

      • getError

         String getError()

        Retrieves the error associated with the response, if any.

        Returns:

        The error message, or null if no error occurred.

      • getByteString

         ByteString getByteString()

        Retrieves the response as a ByteString.

        Returns:

        The string representation of the response.

      • getMetadata

         NetworkMetaData getMetadata()

        Retrieves the metadata associated with the network response.

        Returns:

        The metadata of the network response.

      • getUrl

         String getUrl()

        Retrieves the url associated with the network request.

        Returns:

        The url of the request.

      • getResponse

         <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

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