public enum Status extends Enum<Status>
Status
enumeration is used to specify status codes
and the descriptions of those status codes. This is a convenience
enumeration that allows users to acquire the descriptions of codes
by simply providing the code. Also if the response state is known
the code and description can be provided to the client.
The official HTTP status codes are defined in RFC 2616 section 10. Each set of status codes belongs to a specific family. Each family describes a specific scenario. Although it is possible to use other status codes it is recommended that servers restrict their status code responses to those specified in this enumeration.
StatusLine
Enum Constant and Description |
---|
ACCEPTED
This is used to signify that the request has been accepted.
|
BAD_GATEWAY
This is used to tell the client that the gateway is invalid.
|
BAD_REQUEST
This is used to tell the client they have send an invalid request.
|
CONFLICT
This is used to tell the client that there has been a conflict.
|
CONTINUE
This is used as an intermediate response to a request.
|
CREATED
This is used to signify that a resource was created successfully.
|
EXPECTATION_FAILED
This is used to tell the client that the expectation has failed.
|
FORBIDDEN
This is used to tell the client that the resource is forbidden.
|
FOUND
This is used to represent a resource that has been found.
|
GATEWAY_TIMEOUT
This is used to tell the client there was a gateway timeout.
|
GONE
This is used to tell the client that the resource has gone.
|
INTERNAL_SERVER_ERROR
This is sent when the request has caused an internal server error.
|
LENGTH_REQUIRED
This is used to tell the client that a request length is needed.
|
METHOD_NOT_ALLOWED
This is used to tell the client that the method is not allowed.
|
MOVED_PERMANENTLY
This is used to represent a target resource that has moved.
|
MULTIPLE_CHOICES
This is used to represent a response where there are choices.
|
NO_CONTENT
This represents a response that contains no response content.
|
NOT_ACCEPTABLE
This is used to tell the client the request is not acceptable.
|
NOT_FOUND
This is used to tell the client that the resource is not found.
|
NOT_IMPLEMENTED
This is used to tell the client the resource is not implemented.
|
NOT_MODIFIED
This is used in response to a target that has not been modified.
|
OK
This represents a successful response of a targeted request.
|
PARTIAL_CONTENT
This is used to represent a response that has partial content.
|
PAYMENT_REQUIRED
This is used to tell the client that payment is required.
|
PRECONDITION_FAILED
This is used to tell the client that a precondition has failed.
|
PROXY_AUTHENTICATION_REQUIRED
This is used to tell the client that authentication is required.
|
REQUEST_ENTITY_TOO_LARGE
This is used to tell the client that the request body is too big.
|
REQUEST_TIMEOUT
This is used to tell the client that the request has timed out.
|
REQUEST_URI_TOO_LONG
This is used to tell the client that the request URI is too long.
|
REQUESTED_RANGE_NOT_SATISFIABLE
This is used to tell the client that the range is invalid.
|
RESET_CONTENT
This is used to represent a response that resets the content.
|
SEE_OTHER
This is used to tell the client to see another HTTP resource.
|
SERVICE_UNAVAILABLE
This is used to tell the client the resource is unavailable.
|
SWITCHING_PROTOCOLS
This represents a change in the protocol the client is using.
|
TEMPORARY_REDIRECT
This is used to redirect the client to a resource that has moved.
|
UNAUTHORIZED
This is used to tell the client that authorization is required.
|
UNSUPPORTED_MEDIA_TYPE
This is used to tell the client that the content type is invalid.
|
USE_PROXY
This is used to tell the client that it should use a proxy.
|
VERSION_NOT_SUPPORTED
This is used to tell the client the request version is invalid.
|
Modifier and Type | Field and Description |
---|---|
int |
code
This is the code for the status that this instance represents.
|
String |
description
This is the description of the status this instance represents.
|
Modifier and Type | Method and Description |
---|---|
int |
getCode()
This is used to acquire the code of the status object.
|
String |
getDescription()
This is used to provide the status description.
|
static String |
getDescription(int code)
This is used to provide the status description.
|
static Status |
getStatus(int code)
This is used to provide the status value.
|
static Status |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Status[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Status CONTINUE
public static final Status SWITCHING_PROTOCOLS
public static final Status OK
public static final Status CREATED
public static final Status ACCEPTED
public static final Status NO_CONTENT
public static final Status RESET_CONTENT
public static final Status PARTIAL_CONTENT
public static final Status MULTIPLE_CHOICES
public static final Status MOVED_PERMANENTLY
public static final Status FOUND
public static final Status SEE_OTHER
public static final Status NOT_MODIFIED
public static final Status USE_PROXY
public static final Status TEMPORARY_REDIRECT
public static final Status BAD_REQUEST
public static final Status UNAUTHORIZED
public static final Status PAYMENT_REQUIRED
public static final Status FORBIDDEN
public static final Status NOT_FOUND
public static final Status METHOD_NOT_ALLOWED
public static final Status NOT_ACCEPTABLE
public static final Status PROXY_AUTHENTICATION_REQUIRED
public static final Status REQUEST_TIMEOUT
public static final Status CONFLICT
public static final Status GONE
public static final Status LENGTH_REQUIRED
public static final Status PRECONDITION_FAILED
public static final Status REQUEST_ENTITY_TOO_LARGE
public static final Status REQUEST_URI_TOO_LONG
public static final Status UNSUPPORTED_MEDIA_TYPE
public static final Status REQUESTED_RANGE_NOT_SATISFIABLE
public static final Status EXPECTATION_FAILED
public static final Status INTERNAL_SERVER_ERROR
public static final Status NOT_IMPLEMENTED
public static final Status BAD_GATEWAY
public static final Status SERVICE_UNAVAILABLE
public static final Status GATEWAY_TIMEOUT
public static final Status VERSION_NOT_SUPPORTED
public final String description
public final int code
public static Status[] values()
for (Status c : Status.values()) System.out.println(c);
public static Status valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic int getCode()
public String getDescription()
public static String getDescription(int code)
code
- this is the code to resolve the description forpublic static Status getStatus(int code)
code
- this is the code to resolve the status forCopyright © 2016. All rights reserved.