Class HttpResponse


  • public class HttpResponse
    extends Object
    Http response of the RESTful API of the backend.
    • Constructor Detail

      • HttpResponse

        public HttpResponse​(int _status)
        Creates a response with the given status but without body.
        Parameters:
        _status - a int.
      • HttpResponse

        public HttpResponse​(int _status,
                            String _body)
        Creates a response with the given status and body.
        Parameters:
        _status - a int.
        _body - a String object.
    • Method Detail

      • getStatus

        public int getStatus()

        Getter for the field status.

        Returns:
        a int.
      • isNotFound

        public boolean isNotFound()

        isNotFound.

        Returns:
        a boolean.
      • isOk

        public boolean isOk()

        isOk.

        Returns:
        a boolean.
      • isCreated

        public boolean isCreated()

        isCreated.

        Returns:
        a boolean.
      • isServerError

        public boolean isServerError()

        isServerError.

        Returns:
        a boolean.
      • isServiceUnavailable

        public boolean isServiceUnavailable()

        isServiceUnavailable.

        Returns:
        a boolean.
      • getBody

        public String getBody()

        Getter for the field body.

        Returns:
        a String object.
      • setBody

        public void setBody​(String _body)

        Setter for the field body.

        Parameters:
        _body - a String object.
      • hasBody

        public boolean hasBody()

        hasBody.

        Returns:
        a boolean.