Package org.zalando.problem
Enum Status
- java.lang.Object
-
- java.lang.Enum<Status>
-
- org.zalando.problem.Status
-
- All Implemented Interfaces:
Serializable,Comparable<Status>,StatusType
@API(status=MAINTAINED) public enum Status extends Enum<Status> implements StatusType
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 of StatusType.
-
-
Enum Constant Summary
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetReasonPhrase()Get the reason phrase.intgetStatusCode()Get the associated status code.StringtoString()Get the Status String representation.static StatusvalueOf(int code)Creates a Status instance from the given code.static StatusvalueOf(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.
-
-
-
Enum Constant Detail
-
CONTINUE
public static final Status CONTINUE
-
SWITCHING_PROTOCOLS
public static final Status SWITCHING_PROTOCOLS
-
CHECKPOINT
public static final Status CHECKPOINT
-
OK
public static final Status OK
200 OK, see HTTP/1.1 documentation.
-
CREATED
public static final Status CREATED
201 Created, see HTTP/1.1 documentation.
-
ACCEPTED
public static final Status ACCEPTED
202 Accepted, see HTTP/1.1 documentation.
-
NON_AUTHORITATIVE_INFORMATION
public static final Status NON_AUTHORITATIVE_INFORMATION
-
NO_CONTENT
public static final Status NO_CONTENT
204 No Content, see HTTP/1.1 documentation.
-
RESET_CONTENT
public static final Status RESET_CONTENT
205 Reset Content, see HTTP/1.1 documentation.
-
PARTIAL_CONTENT
public static final Status PARTIAL_CONTENT
206 Reset Content, see HTTP/1.1 documentation.
-
ALREADY_REPORTED
public static final Status ALREADY_REPORTED
- See Also:
- WebDAV Binding Extensions
-
IM_USED
public static final Status IM_USED
- See Also:
- Delta encoding in HTTP
-
MULTIPLE_CHOICES
public static final Status MULTIPLE_CHOICES
-
MOVED_PERMANENTLY
public static final Status MOVED_PERMANENTLY
301 Moved Permanently, see HTTP/1.1 documentation.
-
FOUND
public static final Status FOUND
302 Found, see HTTP/1.1 documentation.
-
SEE_OTHER
public static final Status SEE_OTHER
303 See Other, see HTTP/1.1 documentation.
-
NOT_MODIFIED
public static final Status NOT_MODIFIED
304 Not Modified, see HTTP/1.1 documentation.
-
USE_PROXY
public static final Status USE_PROXY
305 Use Proxy, see HTTP/1.1 documentation.
-
TEMPORARY_REDIRECT
public static final Status TEMPORARY_REDIRECT
307 Temporary Redirect, see HTTP/1.1 documentation.
-
BAD_REQUEST
public static final Status BAD_REQUEST
400 Bad Request, see HTTP/1.1 documentation.
-
UNAUTHORIZED
public static final Status UNAUTHORIZED
401 Unauthorized, see HTTP/1.1 documentation.
-
PAYMENT_REQUIRED
public static final Status PAYMENT_REQUIRED
402 Payment Required, see HTTP/1.1 documentation.
-
FORBIDDEN
public static final Status FORBIDDEN
403 Forbidden, see HTTP/1.1 documentation.
-
NOT_FOUND
public static final Status NOT_FOUND
404 Not Found, see HTTP/1.1 documentation.
-
METHOD_NOT_ALLOWED
public static final Status METHOD_NOT_ALLOWED
405 Method Not Allowed, see HTTP/1.1 documentation.
-
NOT_ACCEPTABLE
public static final Status NOT_ACCEPTABLE
406 Not Acceptable, see HTTP/1.1 documentation.
-
PROXY_AUTHENTICATION_REQUIRED
public static final Status PROXY_AUTHENTICATION_REQUIRED
407 Proxy Authentication Required, see HTTP/1.1 documentation.
-
REQUEST_TIMEOUT
public static final Status REQUEST_TIMEOUT
408 Request Timeout, see HTTP/1.1 documentation.
-
CONFLICT
public static final Status CONFLICT
409 Conflict, see HTTP/1.1 documentation.
-
GONE
public static final Status GONE
410 Gone, see HTTP/1.1 documentation.
-
LENGTH_REQUIRED
public static final Status LENGTH_REQUIRED
411 Length Required, see HTTP/1.1 documentation.
-
PRECONDITION_FAILED
public static final Status PRECONDITION_FAILED
412 Precondition Failed, see HTTP/1.1 documentation.
-
REQUEST_ENTITY_TOO_LARGE
public static final Status REQUEST_ENTITY_TOO_LARGE
413 Request Entity Too Large, see HTTP/1.1 documentation.
-
REQUEST_URI_TOO_LONG
public static final Status REQUEST_URI_TOO_LONG
414 Request-URI Too Long, see HTTP/1.1 documentation.
-
UNSUPPORTED_MEDIA_TYPE
public static final Status UNSUPPORTED_MEDIA_TYPE
415 Unsupported Media Type, see HTTP/1.1 documentation.
-
REQUESTED_RANGE_NOT_SATISFIABLE
public static final Status REQUESTED_RANGE_NOT_SATISFIABLE
416 Requested Range Not Satisfiable, see HTTP/1.1 documentation.
-
EXPECTATION_FAILED
public static final Status EXPECTATION_FAILED
417 Expectation Failed, see HTTP/1.1 documentation.
-
I_AM_A_TEAPOT
public static final Status I_AM_A_TEAPOT
- See Also:
- HTCPCP/1.0
-
UPGRADE_REQUIRED
public static final Status UPGRADE_REQUIRED
- See Also:
- Upgrading to TLS Within HTTP/1.1
-
PRECONDITION_REQUIRED
public static final Status PRECONDITION_REQUIRED
- See Also:
- Additional HTTP Status Codes
-
TOO_MANY_REQUESTS
public static final Status TOO_MANY_REQUESTS
- See Also:
- Additional HTTP Status Codes
-
REQUEST_HEADER_FIELDS_TOO_LARGE
public static final Status REQUEST_HEADER_FIELDS_TOO_LARGE
- See Also:
- Additional HTTP Status Codes
-
UNAVAILABLE_FOR_LEGAL_REASONS
public static final Status UNAVAILABLE_FOR_LEGAL_REASONS
- See Also:
- Unavailable For Legal Reasons
-
INTERNAL_SERVER_ERROR
public static final Status INTERNAL_SERVER_ERROR
500 Internal Server Error, see HTTP/1.1 documentation.
-
NOT_IMPLEMENTED
public static final Status NOT_IMPLEMENTED
501 Not Implemented, see HTTP/1.1 documentation.
-
BAD_GATEWAY
public static final Status BAD_GATEWAY
502 Bad Gateway, see HTTP/1.1 documentation.
-
SERVICE_UNAVAILABLE
public static final Status SERVICE_UNAVAILABLE
503 Service Unavailable, see HTTP/1.1 documentation.
-
GATEWAY_TIMEOUT
public static final Status GATEWAY_TIMEOUT
504 Gateway Timeout, see HTTP/1.1 documentation.
-
HTTP_VERSION_NOT_SUPPORTED
public static final Status HTTP_VERSION_NOT_SUPPORTED
505 HTTP Version Not Supported, see HTTP/1.1 documentation.
-
VARIANT_ALSO_NEGOTIATES
public static final Status VARIANT_ALSO_NEGOTIATES
- See Also:
- Transparent Content Negotiation
-
LOOP_DETECTED
public static final Status LOOP_DETECTED
- See Also:
- WebDAV Binding Extensions
-
BANDWIDTH_LIMIT_EXCEEDED
public static final Status BANDWIDTH_LIMIT_EXCEEDED
509 Bandwidth Limit Exceeded
-
NOT_EXTENDED
public static final Status NOT_EXTENDED
- See Also:
- HTTP Extension Framework
-
NETWORK_AUTHENTICATION_REQUIRED
public static final Status NETWORK_AUTHENTICATION_REQUIRED
- See Also:
- Additional HTTP Status Codes
-
-
Method Detail
-
values
public static 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 (Status c : 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 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
-
getStatusCode
public int getStatusCode()
Get the associated status code.- Specified by:
getStatusCodein interfaceStatusType- Returns:
- the status code.
-
getReasonPhrase
@Nonnull public String getReasonPhrase()
Get the reason phrase.- Specified by:
getReasonPhrasein interfaceStatusType- Returns:
- the reason phrase.
-
toString
public String toString()
Get the Status String representation.
-
valueOf
public static Status valueOf(int code)
Creates a Status instance from the given code.- Parameters:
code- the HTTP code as a number- Returns:
- the correct enum value for this status code.
- Throws:
IllegalArgumentException- if the given code does not correspond to a known HTTP status.
-
-