Class APIResponseImpl

  • All Implemented Interfaces:
    APIResponse

    class APIResponseImpl
    extends java.lang.Object
    implements APIResponse
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte[] body()
      Returns the buffer with response body.
      void dispose()
      Disposes the body of this response.
      (package private) java.util.List<java.lang.String> fetchLog()  
      (package private) java.lang.String fetchUid()  
      java.util.Map<java.lang.String,​java.lang.String> headers()
      An object with all the response HTTP headers associated with this response.
      java.util.List<HttpHeader> headersArray()
      An array with all the request HTTP headers associated with this response.
      boolean ok()
      Contains a boolean stating whether the response was successful (status in the range 200-299) or not.
      int status()
      Contains the status code of the response (e.g., 200 for a success).
      java.lang.String statusText()
      Contains the status text of the response (e.g.
      java.lang.String text()
      Returns the text representation of response body.
      java.lang.String url()
      Contains the URL of the response.
      • Methods inherited from class java.lang.Object

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

      • APIResponseImpl

        APIResponseImpl​(APIRequestContextImpl apiRequestContext,
                        com.google.gson.JsonObject response)
    • Method Detail

      • body

        public byte[] body()
        Description copied from interface: APIResponse
        Returns the buffer with response body.
        Specified by:
        body in interface APIResponse
      • dispose

        public void dispose()
        Description copied from interface: APIResponse
        Disposes the body of this response. If not called then the body will stay in memory until the context closes.
        Specified by:
        dispose in interface APIResponse
      • headers

        public java.util.Map<java.lang.String,​java.lang.String> headers()
        Description copied from interface: APIResponse
        An object with all the response HTTP headers associated with this response.
        Specified by:
        headers in interface APIResponse
      • headersArray

        public java.util.List<HttpHeader> headersArray()
        Description copied from interface: APIResponse
        An array with all the request HTTP headers associated with this response. Header names are not lower-cased. Headers with multiple entries, such as Set-Cookie, appear in the array multiple times.
        Specified by:
        headersArray in interface APIResponse
      • ok

        public boolean ok()
        Description copied from interface: APIResponse
        Contains a boolean stating whether the response was successful (status in the range 200-299) or not.
        Specified by:
        ok in interface APIResponse
      • status

        public int status()
        Description copied from interface: APIResponse
        Contains the status code of the response (e.g., 200 for a success).
        Specified by:
        status in interface APIResponse
      • statusText

        public java.lang.String statusText()
        Description copied from interface: APIResponse
        Contains the status text of the response (e.g. usually an "OK" for a success).
        Specified by:
        statusText in interface APIResponse
      • text

        public java.lang.String text()
        Description copied from interface: APIResponse
        Returns the text representation of response body.
        Specified by:
        text in interface APIResponse
      • url

        public java.lang.String url()
        Description copied from interface: APIResponse
        Contains the URL of the response.
        Specified by:
        url in interface APIResponse
      • fetchUid

        java.lang.String fetchUid()
      • fetchLog

        java.util.List<java.lang.String> fetchLog()