Class HttpStatus

    • Constructor Detail

      • HttpStatus

        public HttpStatus()
    • Method Detail

      • getCode

        public static HttpStatus.Code getCode​(int code)
        Get the HttpStatusCode for a specific code
        Parameters:
        code - the code to lookup.
        Returns:
        the HttpStatus if found, or null if not found.
      • getMessage

        public static java.lang.String getMessage​(int code)
        Get the status message for a specific code.
        Parameters:
        code - the code to look up
        Returns:
        the specific message, or the code number itself if code does not match known list.
      • hasNoBody

        public static boolean hasNoBody​(int status)
      • isInformational

        public static boolean isInformational​(int code)
        Simple test against an code to determine if it falls into the Informational message category as defined in the RFC 1945 - HTTP/1.0, and RFC 7231 - HTTP/1.1.
        Parameters:
        code - the code to test.
        Returns:
        true if within range of codes that belongs to Informational messages.
      • isSuccess

        public static boolean isSuccess​(int code)
        Simple test against an code to determine if it falls into the Success message category as defined in the RFC 1945 - HTTP/1.0, and RFC 7231 - HTTP/1.1.
        Parameters:
        code - the code to test.
        Returns:
        true if within range of codes that belongs to Success messages.
      • isRedirection

        public static boolean isRedirection​(int code)
        Simple test against an code to determine if it falls into the Redirection message category as defined in the RFC 1945 - HTTP/1.0, and RFC 7231 - HTTP/1.1.
        Parameters:
        code - the code to test.
        Returns:
        true if within range of codes that belongs to Redirection messages.
      • isClientError

        public static boolean isClientError​(int code)
        Simple test against an code to determine if it falls into the Client Error message category as defined in the RFC 1945 - HTTP/1.0, and RFC 7231 - HTTP/1.1.
        Parameters:
        code - the code to test.
        Returns:
        true if within range of codes that belongs to Client Error messages.
      • isServerError

        public static boolean isServerError​(int code)
        Simple test against an code to determine if it falls into the Server Error message category as defined in the RFC 1945 - HTTP/1.0, and RFC 7231 - HTTP/1.1.
        Parameters:
        code - the code to test.
        Returns:
        true if within range of codes that belongs to Server Error messages.