Package io.micronaut.http
Enum Class HttpStatus
- All Implemented Interfaces:
Serializable
,CharSequence
,Comparable<HttpStatus>
,Constable
Represents HTTP status codes. See https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html.
- Since:
- 1.0
- Author:
- Graeme Rocher
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionchar
charAt
(int index) int
getCode()
getDefaultReason
(int code) Get the default reason phrase for the given status code, if it is a known status code.int
length()
subSequence
(int start, int end) static HttpStatus
valueOf
(int code) The status for the given code.static HttpStatus
Returns the enum constant of this class with the specified name.static HttpStatus[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from interface java.lang.CharSequence
chars, codePoints, isEmpty, toString
-
Enum Constant Details
-
CONTINUE
-
SWITCHING_PROTOCOLS
-
PROCESSING
-
EARLY_HINTS
-
OK
-
CREATED
-
ACCEPTED
-
NON_AUTHORITATIVE_INFORMATION
-
NO_CONTENT
-
RESET_CONTENT
-
PARTIAL_CONTENT
-
MULTI_STATUS
-
ALREADY_IMPORTED
-
IM_USED
-
MULTIPLE_CHOICES
-
MOVED_PERMANENTLY
-
FOUND
-
SEE_OTHER
-
NOT_MODIFIED
-
USE_PROXY
-
SWITCH_PROXY
-
TEMPORARY_REDIRECT
-
PERMANENT_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
-
REQUEST_ENTITY_TOO_LARGE
-
REQUEST_URI_TOO_LONG
-
UNSUPPORTED_MEDIA_TYPE
-
REQUESTED_RANGE_NOT_SATISFIABLE
-
EXPECTATION_FAILED
-
I_AM_A_TEAPOT
-
ENHANCE_YOUR_CALM
-
MISDIRECTED_REQUEST
-
UNPROCESSABLE_ENTITY
-
LOCKED
-
FAILED_DEPENDENCY
-
TOO_EARLY
-
UPGRADE_REQUIRED
-
PRECONDITION_REQUIRED
-
TOO_MANY_REQUESTS
-
REQUEST_HEADER_FIELDS_TOO_LARGE
-
NO_RESPONSE
-
BLOCKED_BY_WINDOWS_PARENTAL_CONTROLS
-
UNAVAILABLE_FOR_LEGAL_REASONS
-
REQUEST_HEADER_TOO_LARGE
-
INTERNAL_SERVER_ERROR
-
NOT_IMPLEMENTED
-
BAD_GATEWAY
-
SERVICE_UNAVAILABLE
-
GATEWAY_TIMEOUT
-
HTTP_VERSION_NOT_SUPPORTED
-
VARIANT_ALSO_NEGOTIATES
-
INSUFFICIENT_STORAGE
-
LOOP_DETECTED
-
BANDWIDTH_LIMIT_EXCEEDED
-
NOT_EXTENDED
-
NETWORK_AUTHENTICATION_REQUIRED
-
CONNECTION_TIMED_OUT
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
getReason
- Returns:
- The reason text
-
getCode
public int getCode()- Returns:
- The code
-
valueOf
The status for the given code.- Parameters:
code
- The code- Returns:
- The value
-
getDefaultReason
Get the default reason phrase for the given status code, if it is a known status code.- Parameters:
code
- The status code- Returns:
- The default reason phrase, or
"CUSTOM"
if the code is unknown.
-
length
public int length()- Specified by:
length
in interfaceCharSequence
-
charAt
public char charAt(int index) - Specified by:
charAt
in interfaceCharSequence
-
subSequence
- Specified by:
subSequence
in interfaceCharSequence
-