Package javax.ws.rs.core
Enum Response.Status
- All Implemented Interfaces:
Serializable,Comparable<Response.Status>,java.lang.constant.Constable,Response.StatusType
- Enclosing class:
Response
Commonly used status codes defined by HTTP, see
documentation}
for the complete list. Additional status codes can be added by applications
by creating an implementation of
invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10">HTTP/1.1
Response.StatusType.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumAn enumeration representing the class of status code.Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription202 Accepted, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.3">HTTP/1.1400 Bad Request, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1">HTTP/1.1409 Conflict, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.10">HTTP/1.1201 Created, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.2">HTTP/1.1403 Forbidden, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4">HTTP/1.1410 Gone, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.11">HTTP/1.1500 Internal Server Error, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.1">HTTP/1.1301 Moved Permanently, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.2">HTTP/1.1204 No Content, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.5">HTTP/1.1406 Not Acceptable, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.7">HTTP/1.1404 Not Found, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">HTTP/1.1304 Not Modified, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.5">HTTP/1.1200 OK, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1">HTTP/1.1412 Precondition Failed, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.13">HTTP/1.1303 See Other, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.4">HTTP/1.1503 Service Unavailable, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.4">HTTP/1.1307 Temporary Redirect, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.8">HTTP/1.1401 Unauthorized, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2">HTTP/1.1415 Unsupported Media Type, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.16">HTTP/1.1 -
Method Summary
Modifier and TypeMethodDescriptionstatic Response.StatusfromStatusCode(int statusCode) Convert a numerical status code into the corresponding StatusGet the class of status codeGet the reason phraseintGet the associated status codetoString()Get the reason phrasestatic Response.StatusReturns the enum constant of this type with the specified name.static Response.Status[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
OK
200 OK, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1">HTTP/1.1 -
CREATED
201 Created, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.2">HTTP/1.1 -
ACCEPTED
202 Accepted, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.3">HTTP/1.1 -
NO_CONTENT
204 No Content, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.5">HTTP/1.1 -
MOVED_PERMANENTLY
301 Moved Permanently, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.2">HTTP/1.1 -
SEE_OTHER
303 See Other, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.4">HTTP/1.1 -
NOT_MODIFIED
304 Not Modified, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.5">HTTP/1.1 -
TEMPORARY_REDIRECT
307 Temporary Redirect, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.8">HTTP/1.1 -
BAD_REQUEST
400 Bad Request, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1">HTTP/1.1 -
UNAUTHORIZED
401 Unauthorized, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2">HTTP/1.1 -
FORBIDDEN
403 Forbidden, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4">HTTP/1.1 -
NOT_FOUND
404 Not Found, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">HTTP/1.1 -
NOT_ACCEPTABLE
406 Not Acceptable, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.7">HTTP/1.1 -
CONFLICT
409 Conflict, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.10">HTTP/1.1 -
GONE
410 Gone, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.11">HTTP/1.1 -
PRECONDITION_FAILED
412 Precondition Failed, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.13">HTTP/1.1 -
UNSUPPORTED_MEDIA_TYPE
415 Unsupported Media Type, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.16">HTTP/1.1 -
INTERNAL_SERVER_ERROR
500 Internal Server Error, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.1">HTTP/1.1 -
SERVICE_UNAVAILABLE
503 Service Unavailable, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.4">HTTP/1.1
-
-
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
-
getFamily
Get the class of status code- Specified by:
getFamilyin interfaceResponse.StatusType- Returns:
- the class of status code
-
getStatusCode
public int getStatusCode()Get the associated status code- Specified by:
getStatusCodein interfaceResponse.StatusType- Returns:
- the status code
-
getReasonPhrase
Get the reason phrase- Specified by:
getReasonPhrasein interfaceResponse.StatusType- Returns:
- the reason phrase
-
toString
Get the reason phrase- Overrides:
toStringin classEnum<Response.Status>- Returns:
- the reason phrase
-
fromStatusCode
Convert a numerical status code into the corresponding Status- Parameters:
statusCode- the numerical status code- Returns:
- the matching Status or null is no matching Status is defined
-