Enum Class HttpStatus.Code

java.lang.Object
java.lang.Enum<HttpStatus.Code>
org.eclipse.jetty.http.HttpStatus.Code
All Implemented Interfaces:
Serializable, Comparable<HttpStatus.Code>, Constable
Enclosing class:
HttpStatus

public static enum HttpStatus.Code extends Enum<HttpStatus.Code>
  • Enum Constant Details

  • Method Details

    • values

      public static HttpStatus.Code[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static HttpStatus.Code valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getCode

      public int getCode()
    • getMessage

      public String getMessage()
    • equals

      public boolean equals(int code)
    • toString

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

      public boolean isInformational()
      Tests whether the status code is of the Informational message category as defined in RFC 9110.
      Returns:
      true if within range of codes that belongs to Informational codes.
    • isSuccess

      public boolean isSuccess()
      Tests whether the status code is of the Successful message category as defined in RFC 9110.
      Returns:
      true if within range of codes that belongs to Successful codes.
    • isRedirection

      public boolean isRedirection()
      Tests whether the status code is of the Redirection message category as defined in RFC 9110.
      Returns:
      true if within range of codes that belongs to Redirection codes.
    • isClientError

      public boolean isClientError()
      Tests whether the status code is of the Client Error message category as defined in RFC 9110.
      Returns:
      true if within range of codes that belongs to Client Error codes.
    • isServerError

      public boolean isServerError()
      Tests whether the status code is of the Server Error message category as defined in RFC 9110.
      Returns:
      true if within range of codes that belongs to Server Error codes.