Class PromaResponse<T>

    • Method Detail

      • value

        public T value()
        Specified by:
        value in interface IPromaResponse<T>
        Returns:
        Transformed result of the response, usually from the HTTP response body.
      • statusCode

        public int statusCode()
        Specified by:
        statusCode in interface IPromaResponse<T>
        Returns:
        Status code of the HTTP response.
      • empty

        public static <T> IPromaResponse<T> empty​(int statusCode)
        Type Parameters:
        T - Type of the result.
        Parameters:
        statusCode - Status code of the HTTP response.
        Returns:
        A new POJO with the given status code and a null result.
      • of

        public static <T> IPromaResponse<T> of​(int statusCode,
                                               T result)
        Type Parameters:
        T - Type of the result.
        Parameters:
        statusCode - Status code of the HTTP response.
        result - Transformed result of the response, usually from the HTTP response body.
        Returns:
        A new POJO with the given data.