Enum HttpStatusCode
- All Implemented Interfaces:
Serializable
,Comparable<HttpStatusCode>
,java.lang.constant.Constable
HTTP status codes as defined in RFC 7231, section 6,
and additional status codes as defined in RFC 6585
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionstatic HttpStatusCode
fromStatusCode
(int statusCode) Converts a numerical status code into the corresponding status enum object.getInfo()
Gets the status code info.int
Gets the associated status code.toString()
The status code info is the readable form of the status code.static HttpStatusCode
Returns the enum constant of this type with the specified name.static HttpStatusCode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
CONTINUE
-
SWITCHING_PROTOCOLS
-
OK
-
CREATED
-
ACCEPTED
-
NO_CONTENT
-
RESET_CONTENT
-
PARTIAL_CONTENT
-
MOVED_PERMANENTLY
-
FOUND
-
SEE_OTHER
-
NOT_MODIFIED
-
USE_PROXY
-
TEMPORARY_REDIRECT
-
BAD_REQUEST
-
UNAUTHORIZED
-
PAYMENT_REQUIRED
-
FORBIDDEN
-
NOT_FOUND
-
METHOD_NOT_ALLOWED
-
NOT_ACCEPTABLE
-
PROXY_AUTHENTICATION_REQUIRED
-
REQUEST_TIMEOUT
-
CONFLICT
-
GONE
-
LENGTH_REQUIRED
-
PRECONDITION_FAILED
-
PAYLOAD_TOO_LARGE
-
URI_TOO_LONG
-
UNSUPPORTED_MEDIA_TYPE
-
RANGE_NOT_SATISFIABLE
-
EXPECTATION_FAILED
-
PRECONDITION_REQUIRED
-
INTERNAL_SERVER_ERROR
-
NOT_IMPLEMENTED
-
BAD_GATEWAY
-
SERVICE_UNAVAILABLE
-
GATEWAY_TIMEOUT
-
HTTP_VERSION_NOT_SUPPORTED
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
fromStatusCode
Converts a numerical status code into the corresponding status enum object.- Parameters:
statusCode
- the numerical status code- Returns:
- the matching status enum object or null if no matching enum is defined
-
getStatusCode
public int getStatusCode()Gets the associated status code.- Returns:
- the status code.
-
getInfo
Gets the status code info.- Returns:
- the status code info
-
toString
The status code info is the readable form of the status code.- Overrides:
toString
in classEnum<HttpStatusCode>
-