Class ApiResponse<T>

  • Type Parameters:
    T - The type of data that is deserialized from response body

    public class ApiResponse<T>
    extends java.lang.Object
    API response returned by API call.
    • Constructor Summary

      Constructors 
      Constructor Description
      ApiResponse​(int statusCode, java.util.Map<java.lang.String,​java.util.List<java.lang.String>> headers)  
      ApiResponse​(int statusCode, java.util.Map<java.lang.String,​java.util.List<java.lang.String>> headers, T data)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T getData()
      Get the data
      java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getHeaders()
      Get the headers
      int getStatusCode()
      Get the status code
      • Methods inherited from class java.lang.Object

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

      • ApiResponse

        public ApiResponse​(int statusCode,
                           java.util.Map<java.lang.String,​java.util.List<java.lang.String>> headers)
        Parameters:
        statusCode - The status code of HTTP response
        headers - The headers of HTTP response
      • ApiResponse

        public ApiResponse​(int statusCode,
                           java.util.Map<java.lang.String,​java.util.List<java.lang.String>> headers,
                           T data)
        Parameters:
        statusCode - The status code of HTTP response
        headers - The headers of HTTP response
        data - The object deserialized from response bod
    • Method Detail

      • getStatusCode

        public int getStatusCode()
        Get the status code
        Returns:
        status code
      • getHeaders

        public java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getHeaders()
        Get the headers
        Returns:
        map of headers
      • getData

        public T getData()
        Get the data
        Returns:
        data