Enum HttpStatus.Code

    • Method Detail

      • values

        public static HttpStatus.Code[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (HttpStatus.Code c : HttpStatus.Code.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static HttpStatus.Code valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getCode

        public int getCode()
      • getMessage

        public java.lang.String getMessage()
      • equals

        public boolean equals​(int code)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Enum<HttpStatus.Code>
      • isInformational

        public boolean isInformational()
        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.
        Returns:
        true if within range of codes that belongs to Informational messages.
      • isSuccess

        public boolean isSuccess()
        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.
        Returns:
        true if within range of codes that belongs to Success messages.
      • isRedirection

        public boolean isRedirection()
        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.
        Returns:
        true if within range of codes that belongs to Redirection messages.
      • isClientError

        public boolean isClientError()
        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.
        Returns:
        true if within range of codes that belongs to Client Error messages.
      • isServerError

        public boolean isServerError()
        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.
        Returns:
        true if within range of codes that belongs to Server Error messages.