Class SimpleResponse<T>

  • Type Parameters:
    T - The deserialized type of the response content.
    All Implemented Interfaces:
    Response<T>
    Direct Known Subclasses:
    StreamResponse

    public class SimpleResponse<T>
    extends java.lang.Object
    implements Response<T>
    REST response with a strongly-typed content specified.
    • Constructor Summary

      Constructors 
      Constructor Description
      SimpleResponse​(com.azure.android.core.http.HttpRequest request, int statusCode, com.azure.android.core.http.HttpHeaders headers, T value)
      Creates a SimpleResponse.
      SimpleResponse​(Response<?> response, T value)
      Creates a SimpleResponse from a response and a value.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.azure.android.core.http.HttpHeaders getHeaders()
      Gets the headers from the HTTP response.
      com.azure.android.core.http.HttpRequest getRequest()
      Gets the request which resulted in this SimpleResponse.
      int getStatusCode()
      Gets the status code of the HTTP response.
      T getValue()
      Gets the deserialized value of the HTTP response.
      • Methods inherited from class java.lang.Object

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

      • SimpleResponse

        public SimpleResponse​(com.azure.android.core.http.HttpRequest request,
                              int statusCode,
                              com.azure.android.core.http.HttpHeaders headers,
                              T value)
        Creates a SimpleResponse.
        Parameters:
        request - The request which resulted in this response.
        statusCode - The status code of the HTTP response.
        headers - The headers of the HTTP response.
        value - The deserialized value of the HTTP response.
      • SimpleResponse

        public SimpleResponse​(Response<?> response,
                              T value)
        Creates a SimpleResponse from a response and a value.
        Parameters:
        response - The response that needs to be mapped.
        value - The value to put into the new response.
    • Method Detail

      • getRequest

        public com.azure.android.core.http.HttpRequest getRequest()
        Gets the request which resulted in this SimpleResponse.
        Specified by:
        getRequest in interface Response<T>
        Returns:
        The request which resulted in this SimpleResponse.
      • getStatusCode

        public int getStatusCode()
        Gets the status code of the HTTP response.
        Specified by:
        getStatusCode in interface Response<T>
        Returns:
        The status code of the HTTP response.
      • getHeaders

        public com.azure.android.core.http.HttpHeaders getHeaders()
        Gets the headers from the HTTP response.
        Specified by:
        getHeaders in interface Response<T>
        Returns:
        The HTTP response headers.
      • getValue

        public T getValue()
        Gets the deserialized value of the HTTP response.
        Specified by:
        getValue in interface Response<T>
        Returns:
        The deserialized value of the HTTP response.