Package io.helidon.common.http
Enum Http.Status
- java.lang.Object
-
- java.lang.Enum<Http.Status>
-
- io.helidon.common.http.Http.Status
-
- All Implemented Interfaces:
Http.ResponseStatus
,Serializable
,Comparable<Http.Status>
- Enclosing class:
- Http
public static enum Http.Status extends Enum<Http.Status> implements Http.ResponseStatus
Commonly used status codes defined by HTTP, see HTTP/1.1 documentation for the complete list. Additional status codes can be added by applications by creating an implementation ofHttp.ResponseStatus
.Copied from JAX-RS.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.helidon.common.http.Http.ResponseStatus
Http.ResponseStatus.Family
-
-
Enum Constant Summary
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
code()
Get the associated status code.Http.ResponseStatus.Family
family()
Get the class of status code.static Optional<Http.Status>
find(int statusCode)
Convert a numerical status code into the correspondingStatus
enum value.String
reasonPhrase()
Get the reason phrase.String
toString()
Get the response status as string.static Http.Status
valueOf(String name)
Returns the enum constant of this type with the specified name.static Http.Status[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
OK_200
public static final Http.Status OK_200
200 OK, see HTTP/1.1 documentation.
-
CREATED_201
public static final Http.Status CREATED_201
201 Created, see HTTP/1.1 documentation.
-
ACCEPTED_202
public static final Http.Status ACCEPTED_202
202 Accepted, see HTTP/1.1 documentation .
-
NO_CONTENT_204
public static final Http.Status NO_CONTENT_204
204 No Content, see HTTP/1.1 documentation.
-
RESET_CONTENT_205
public static final Http.Status RESET_CONTENT_205
205 Reset Content, see HTTP/1.1 documentation.- Since:
- 2.0
-
PARTIAL_CONTENT_206
public static final Http.Status PARTIAL_CONTENT_206
206 Reset Content, see HTTP/1.1 documentation.- Since:
- 2.0
-
MOVED_PERMANENTLY_301
public static final Http.Status MOVED_PERMANENTLY_301
301 Moved Permanently, see HTTP/1.1 documentation.
-
FOUND_302
public static final Http.Status FOUND_302
302 Found, see HTTP/1.1 documentation.- Since:
- 2.0
-
SEE_OTHER_303
public static final Http.Status SEE_OTHER_303
303 See Other, see HTTP/1.1 documentation.
-
NOT_MODIFIED_304
public static final Http.Status NOT_MODIFIED_304
304 Not Modified, see HTTP/1.1 documentation.
-
USE_PROXY_305
public static final Http.Status USE_PROXY_305
305 Use Proxy, see HTTP/1.1 documentation.- Since:
- 2.0
-
TEMPORARY_REDIRECT_307
public static final Http.Status TEMPORARY_REDIRECT_307
307 Temporary Redirect, see HTTP/1.1 documentation.
-
BAD_REQUEST_400
public static final Http.Status BAD_REQUEST_400
400 Bad Request, see HTTP/1.1 documentation.
-
UNAUTHORIZED_401
public static final Http.Status UNAUTHORIZED_401
401 Unauthorized, see HTTP/1.1 documentation.
-
PAYMENT_REQUIRED_402
public static final Http.Status PAYMENT_REQUIRED_402
402 Payment Required, see HTTP/1.1 documentation.- Since:
- 2.0
-
FORBIDDEN_403
public static final Http.Status FORBIDDEN_403
403 Forbidden, see HTTP/1.1 documentation.
-
NOT_FOUND_404
public static final Http.Status NOT_FOUND_404
404 Not Found, see HTTP/1.1 documentation.
-
METHOD_NOT_ALLOWED_405
public static final Http.Status METHOD_NOT_ALLOWED_405
405 Method Not Allowed, see HTTP/1.1 documentation.- Since:
- 2.0
-
NOT_ACCEPTABLE_406
public static final Http.Status NOT_ACCEPTABLE_406
406 Not Acceptable, see HTTP/1.1 documentation.
-
PROXY_AUTHENTICATION_REQUIRED_407
public static final Http.Status PROXY_AUTHENTICATION_REQUIRED_407
407 Proxy Authentication Required, see HTTP/1.1 documentation.- Since:
- 2.0
-
REQUEST_TIMEOUT_408
public static final Http.Status REQUEST_TIMEOUT_408
408 Request Timeout, see HTTP/1.1 documentation.- Since:
- 2.0
-
CONFLICT_409
public static final Http.Status CONFLICT_409
409 Conflict, see HTTP/1.1 documentation.
-
GONE_410
public static final Http.Status GONE_410
410 Gone, see HTTP/1.1 documentation.
-
LENGTH_REQUIRED_411
public static final Http.Status LENGTH_REQUIRED_411
411 Length Required, see HTTP/1.1 documentation.- Since:
- 2.0
-
PRECONDITION_FAILED_412
public static final Http.Status PRECONDITION_FAILED_412
412 Precondition Failed, see HTTP/1.1 documentation.
-
REQUEST_ENTITY_TOO_LARGE_413
public static final Http.Status REQUEST_ENTITY_TOO_LARGE_413
413 Request Entity Too Large, see HTTP/1.1 documentation.- Since:
- 2.0
-
REQUEST_URI_TOO_LONG_414
public static final Http.Status REQUEST_URI_TOO_LONG_414
414 Request-URI Too Long, see HTTP/1.1 documentation.- Since:
- 2.0
-
UNSUPPORTED_MEDIA_TYPE_415
public static final Http.Status UNSUPPORTED_MEDIA_TYPE_415
415 Unsupported Media Type, see HTTP/1.1 documentation.
-
REQUESTED_RANGE_NOT_SATISFIABLE_416
public static final Http.Status REQUESTED_RANGE_NOT_SATISFIABLE_416
416 Requested Range Not Satisfiable, see HTTP/1.1 documentation.- Since:
- 2.0
-
EXPECTATION_FAILED_417
public static final Http.Status EXPECTATION_FAILED_417
417 Expectation Failed, see HTTP/1.1 documentation.- Since:
- 2.0
-
I_AM_A_TEAPOT
public static final Http.Status I_AM_A_TEAPOT
418 I'm a teapot, see Hyper Text Coffee Pot Control Protocol (HTCPCP/1.0).
-
INTERNAL_SERVER_ERROR_500
public static final Http.Status INTERNAL_SERVER_ERROR_500
500 Internal Server Error, see HTTP/1.1 documentation.
-
NOT_IMPLEMENTED_501
public static final Http.Status NOT_IMPLEMENTED_501
501 Not Implemented, see HTTP/1.1 documentation.- Since:
- 2.0
-
BAD_GATEWAY_502
public static final Http.Status BAD_GATEWAY_502
502 Bad Gateway, see HTTP/1.1 documentation.- Since:
- 2.0
-
SERVICE_UNAVAILABLE_503
public static final Http.Status SERVICE_UNAVAILABLE_503
503 Service Unavailable, see HTTP/1.1 documentation.
-
GATEWAY_TIMEOUT_504
public static final Http.Status GATEWAY_TIMEOUT_504
504 Gateway Timeout, see HTTP/1.1 documentation.- Since:
- 2.0
-
HTTP_VERSION_NOT_SUPPORTED
public static final Http.Status HTTP_VERSION_NOT_SUPPORTED
505 HTTP Version Not Supported, see HTTP/1.1 documentation.- Since:
- 2.0
-
-
Method Detail
-
values
public static Http.Status[] 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 (Http.Status c : Http.Status.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Http.Status valueOf(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:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
find
public static Optional<Http.Status> find(int statusCode)
Convert a numerical status code into the correspondingStatus
enum value.As opposed to
Http.ResponseStatus.create(int)
, this method returnsno value
for an unknown status code not represented by a value in this enumeration of standard HTTP response status codes.- Parameters:
statusCode
- the numerical status code.- Returns:
- optionally the matching Status if a matching
Status
value is defined.
-
family
public Http.ResponseStatus.Family family()
Get the class of status code.- Specified by:
family
in interfaceHttp.ResponseStatus
- Returns:
- the class of status code.
-
code
public int code()
Get the associated status code.- Specified by:
code
in interfaceHttp.ResponseStatus
- Returns:
- the status code.
-
reasonPhrase
public String reasonPhrase()
Get the reason phrase.- Specified by:
reasonPhrase
in interfaceHttp.ResponseStatus
- Returns:
- the reason phrase.
-
toString
public String toString()
Get the response status as string.- Overrides:
toString
in classEnum<Http.Status>
- Returns:
- the response status string in the form of a partial HTTP response status line,
i.e.
"Status-Code SP Reason-Phrase"
.
-
-