Package dk.mada.jaxrs.model.api
Enum Class StatusCode
- All Implemented Interfaces:
Serializable
,Comparable<StatusCode>
,Constable
HTTP status codes.
The HttpURLConnection constants in enumeration-form. And then some from
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status and
https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAccepted.Already Reported.Bad Gateway.Method Not Allowed.Bad Request.Request Time-Out.Conflict.Continue.Created.Special code to hold the state for the OpenApi default entry.Early hints.Request Entity Too Large.Expectation Failed.Failed dependency.Forbidden.Gateway Timeout.Gone.I'm a teapot.IM Used.Insufficient Storage.Internal Server Error.Length Required.Locked.Loop Detected.Misdirected Request.Moved Permanently.Temporary Redirect.Multiple Choices.Multi-Status.Network Authentication Required.No Content.Not Acceptable.Non-Authoritative Information.Not Extended.Not Found.Not Implemented.Not Modified.OK.Partial Content.Payment Required.Permanent Redirect.Precondition Failed.Precondition Required.Processing.Proxy Authentication Required.Range Not Satisfiable.Request-URI Too Large.Request Header Fields Too Large.Reset Content.See Other.Switching Protocols.Temporary Redirect.Too early.Too Many Requests.Unauthorized.Service Unavailable.Unavailable For Legal Reasons.Unprocessable Entity.Unsupported Media Type.Unused, reserved.Upgrade Required.Use Proxy.Variant Also Negotiates.HTTP Version Not Supported. -
Method Summary
Modifier and TypeMethodDescriptionReturns the code in the same form as expected by OpenApi.int
code()
Returns the status code value.static StatusCode
Convert OpenApi wire status code a model StatusCode.static StatusCode
Returns the enum constant of this class with the specified name.static StatusCode[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
HTTP_DEFAULT
Special code to hold the state for the OpenApi default entry.- See Also:
-
HTTP_CONTINUE
Continue. -
HTTP_SWITCHING_PROTOCOLS
Switching Protocols. -
HTTP_PROCESSING
Processing. -
HTTP_EARLY_HINTS
Early hints. -
HTTP_OK
OK. -
HTTP_CREATED
Created. -
HTTP_ACCEPTED
Accepted. -
HTTP_NOT_AUTHORITATIVE
Non-Authoritative Information. -
HTTP_NO_CONTENT
No Content. -
HTTP_RESET
Reset Content. -
HTTP_PARTIAL
Partial Content. -
HTTP_MULTI_STATUS
Multi-Status. -
HTTP_ALREADY_REPORTED
Already Reported. -
HTTP_IM_USED
IM Used. -
HTTP_MULT_CHOICE
Multiple Choices. -
HTTP_MOVED_PERM
Moved Permanently. -
HTTP_MOVED_TEMP
Temporary Redirect. -
HTTP_SEE_OTHER
See Other. -
HTTP_NOT_MODIFIED
Not Modified. -
HTTP_USE_PROXY
Use Proxy. -
HTTP_UNUSED
Unused, reserved. -
HTTP_TEMPORARY_REDIRECT
Temporary Redirect. -
HTTP_PERMANENT_REDIRECT
Permanent Redirect. -
HTTP_BAD_REQUEST
Bad Request. -
HTTP_UNAUTHORIZED
Unauthorized. -
HTTP_PAYMENT_REQUIRED
Payment Required. -
HTTP_FORBIDDEN
Forbidden. -
HTTP_NOT_FOUND
Not Found. -
HTTP_BAD_METHOD
Method Not Allowed. -
HTTP_NOT_ACCEPTABLE
Not Acceptable. -
HTTP_PROXY_AUTH
Proxy Authentication Required. -
HTTP_CLIENT_TIMEOUT
Request Time-Out. -
HTTP_CONFLICT
Conflict. -
HTTP_GONE
Gone. -
HTTP_LENGTH_REQUIRED
Length Required. -
HTTP_PRECON_FAILED
Precondition Failed. -
HTTP_ENTITY_TOO_LARGE
Request Entity Too Large. -
HTTP_REQ_TOO_LONG
Request-URI Too Large. -
HTTP_UNSUPPORTED_TYPE
Unsupported Media Type. -
HTTP_RANGE_NOT_SATISFIABLE
Range Not Satisfiable. -
HTTP_EXPECTATION_FAILED
Expectation Failed. -
HTTP_IM_A_TEAPOT
I'm a teapot. -
HTTP_MISDIRECTED_REQUEST
Misdirected Request. -
HTTP_UNPROCESSABLE_ENTITY
Unprocessable Entity. -
HTTP_LOCKED
Locked. -
HTTP_FAILED_DEPENDENCY
Failed dependency. -
HTTP_TOO_EARLY
Too early. -
HTTP_UPGRADE_REQUIRED
Upgrade Required. -
HTTP_PRECONDITION_REQUIRED
Precondition Required. -
HTTP_TOO_MANY_REQUESTS
Too Many Requests. -
HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE
Request Header Fields Too Large. -
HTTP_UNAVAILABLE_FOR_LEGAL_REASONS
Unavailable For Legal Reasons. -
HTTP_INTERNAL_ERROR
Internal Server Error. -
HTTP_NOT_IMPLEMENTED
Not Implemented. -
HTTP_BAD_GATEWAY
Bad Gateway. -
HTTP_UNAVAILABLE
Service Unavailable. -
HTTP_GATEWAY_TIMEOUT
Gateway Timeout. -
HTTP_VERSION
HTTP Version Not Supported. -
HTTP_VARIANT_ALSO_NEGOTIATES
Variant Also Negotiates. -
HTTP_INSUFFICIENT_STORAGE
Insufficient Storage. -
HTTP_LOOP_DETECTED
Loop Detected. -
HTTP_NOT_EXTENDED
Not Extended. -
HTTP_NETWORK_AUTHENTICATION_REQUIRED
Network Authentication Required.
-
-
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
-
code
public int code()Returns the status code value.- Returns:
- the status code value
-
asOpenApiStatus
Returns the code in the same form as expected by OpenApi. This means that HTTP_DEFAULT is returned as "default", others as their status code in string form.- Returns:
- the OpenApi status code
-
of
Convert OpenApi wire status code a model StatusCode. Note the special handling of "default".- Parameters:
code
- the OpenApi wire-form of a status code- Returns:
- the matching status code
-