Package org.dmfs.httpessentials
Interface HttpStatus
- All Known Implementing Classes:
NoneHttpStatus,SimpleHttpStatus,StatusLineHttpStatus
public interface HttpStatus
Interface of an HTTP status. Instances must be immutable. By convention, all instances MUST return the status code when
hashCode() is called.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final HttpStatusHTTP status: 202 Acceptedstatic final HttpStatusHTTP status: 502 Bad Gatewaystatic final HttpStatusHTTP status: 400 Bad Requeststatic final HttpStatusHTTP status: 409 Conflictstatic final HttpStatusHTTP status: 100 Continuestatic final HttpStatusHTTP status: 201 Createdstatic final HttpStatusHTTP status: 417 Expectation Failedstatic final HttpStatusHTTP status: 424 Failed Dependency (WebDAV)static final HttpStatusHTTP status: 403 Forbiddenstatic final HttpStatusHTTP status: 302 Foundstatic final HttpStatusHTTP status: 504 Gateway Timeoutstatic final HttpStatusHTTP status: 410 Gonestatic final HttpStatusHTTP status: 505 HTTP Version Not Supportedstatic final HttpStatusHTTP status: 507 Insufficient Storage (WebDAV)static final HttpStatusHTTP status: 500 Internal Server Errorstatic final HttpStatusHTTP status: 411 Length Requiredstatic final HttpStatusHTTP status: 423 Locked (WebDAV)static final HttpStatusHTTP status: 405 Method Not Allowedstatic final HttpStatusHTTP status: 301 Moved Permanentlystatic final HttpStatusHTTP status: 300 Multiple Choicesstatic final HttpStatusHTTP status: 207 Multistatus (WebDAV)static final HttpStatusHTTP status: 204 No Contentstatic final HttpStatusHTTP status: 203 Non-Authoritative Informationstatic final HttpStatusA dummy HTTP status which can be used to return "no status".static final HttpStatusHTTP status: 406 Not Acceptablestatic final HttpStatusHTTP status: 404 Not Foundstatic final HttpStatusHTTP status: 501 Not Implementedstatic final HttpStatusHTTP status: 304 Not Modifiedstatic final HttpStatusHTTP status: 200 OKstatic final HttpStatusHTTP status: 206 Partial Contentstatic final HttpStatusHTTP status: 413 Payload Too Largestatic final HttpStatusHTTP status: 402 Payment Requiredstatic final HttpStatusHTTP status: 308 Permanent Redirectstatic final HttpStatusHTTP status: 412 Precondition Failedstatic final HttpStatusHTTP status: 102 Processing (WebDAV)static final HttpStatusHTTP status: 407 Proxy Authentication Requiredstatic final HttpStatusDeprecated.static final HttpStatusHTTP status: 408 Request Timeoutstatic final HttpStatusDeprecated.static final HttpStatusHTTP status: 205 Reset Contentstatic final HttpStatusHTTP status: 303 See Otherstatic final HttpStatusHTTP status: 503 Service Unavailablestatic final HttpStatusHTTP status: 101 Switching Protocolsstatic final HttpStatusHTTP status: 307 Temporary Redirectstatic final HttpStatusHTTP status: 401 Unauthorizedstatic final HttpStatusHTTP status: 422 Unprocessable Entity (WebDAV)static final HttpStatusHTTP status: 415 Unsupported Media Typestatic final HttpStatusHTTP status: 426 Upgrade Requiredstatic final HttpStatusHTTP status: 414 URI Too Longstatic final HttpStatusHTTP status: 305 Use Proxystatic final HttpStatusHTTP status: 506 Variant Also Negotiates (experimental) -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()booleanReturns whether this status represents a client error status code.booleanReturns whether this represents an informational status code.booleanReturns whether this status represents a redirection status code.booleanReturns whether this status represents a server error status code.booleanReturns whether this status represents a success status code.reason()Returns the reason phrase of this status code.intReturns the status code.
-
Field Details
-
NONE
A dummy HTTP status which can be used to return "no status". This is thenullobject. -
CONTINUE
HTTP status: 100 Continue -
SWITCHING_PROTOCOLS
HTTP status: 101 Switching Protocols -
PROCESSING
HTTP status: 102 Processing (WebDAV)Note that this has been removed from the WebDAV specification in RFC 4918, see RFC 4918, section 21.4
-
OK
HTTP status: 200 OK -
CREATED
HTTP status: 201 Created -
ACCEPTED
HTTP status: 202 Accepted -
NON_AUTHORITATIVE_INFORMATION
HTTP status: 203 Non-Authoritative Information -
NO_CONTENT
HTTP status: 204 No Content -
RESET_CONTENT
HTTP status: 205 Reset Content -
PARTIAL_CONTENT
HTTP status: 206 Partial Content -
MULTISTATUS
HTTP status: 207 Multistatus (WebDAV) -
MULTIPLE_CHOICES
HTTP status: 300 Multiple Choices -
MOVED_PERMANENTLY
HTTP status: 301 Moved Permanently -
FOUND
HTTP status: 302 Found -
SEE_OTHER
HTTP status: 303 See Other -
NOT_MODIFIED
HTTP status: 304 Not Modified -
USE_PROXY
HTTP status: 305 Use Proxy -
TEMPORARY_REDIRECT
HTTP status: 307 Temporary Redirect -
PERMANENT_REDIRECT
HTTP status: 308 Permanent Redirect -
BAD_REQUEST
HTTP status: 400 Bad Request -
UNAUTHORIZED
HTTP status: 401 Unauthorized -
PAYMENT_REQUIRED
HTTP status: 402 Payment Required -
FORBIDDEN
HTTP status: 403 Forbidden -
NOT_FOUND
HTTP status: 404 Not Found -
METHOD_NOT_ALLOWED
HTTP status: 405 Method Not Allowed -
NOT_ACCEPTABLE
HTTP status: 406 Not Acceptable -
PROXY_AUTHENTICATION_REQUIRED
HTTP status: 407 Proxy Authentication Required -
REQUEST_TIMEOUT
HTTP status: 408 Request Timeout -
CONFLICT
HTTP status: 409 Conflict -
GONE
HTTP status: 410 Gone -
LENGTH_REQUIRED
HTTP status: 411 Length Required -
PRECONDITION_FAILED
HTTP status: 412 Precondition Failed -
PAYLOAD_TOO_LARGE
HTTP status: 413 Payload Too Large -
REQUEST_ENTITY_TOO_LARGE
Deprecated.Old name ofPAYLOAD_TOO_LARGE. -
URI_TOO_LONG
HTTP status: 414 URI Too Long -
REQUEST_URI_TOO_LONG
Deprecated.Old name ofURI_TOO_LONG. -
UNSUPPORTED_MEDIA_TYPE
HTTP status: 415 Unsupported Media Type -
EXPECTATION_FAILED
HTTP status: 417 Expectation Failed -
UNPROCESSABLE_ENTITY
HTTP status: 422 Unprocessable Entity (WebDAV) -
LOCKED
HTTP status: 423 Locked (WebDAV) -
FAILED_DEPENDENCY
HTTP status: 424 Failed Dependency (WebDAV) -
UPGRADE_REQUIRED
HTTP status: 426 Upgrade Required -
INTERNAL_SERVER_ERROR
HTTP status: 500 Internal Server Error -
NOT_IMPLEMENTED
HTTP status: 501 Not Implemented -
BAD_GATEWAY
HTTP status: 502 Bad Gateway -
SERVICE_UNAVAILABLE
HTTP status: 503 Service Unavailable -
GATEWAY_TIMEOUT
HTTP status: 504 Gateway Timeout -
HTTP_VERSION_NOT_SUPPORTED
HTTP status: 505 HTTP Version Not Supported -
VARIANT_ALSO_NEGOTIATES
HTTP status: 506 Variant Also Negotiates (experimental) -
INSUFFICIENT_STORAGE
HTTP status: 507 Insufficient Storage (WebDAV)
-
-
Method Details
-
statusCode
int statusCode()Returns the status code.- Returns:
-
reason
String reason()Returns the reason phrase of this status code.Note: the reason phrase doesn't contain the status code itself.
- Returns:
- The reason phrase or
nullif the status code is unknown.
-
isInformational
boolean isInformational()Returns whether this represents an informational status code.- Returns:
trueif this represents an informational status code,falseotherwise.
-
isSuccess
boolean isSuccess()Returns whether this status represents a success status code.- Returns:
trueif this represents a success status code,falseotherwise.
-
isRedirect
boolean isRedirect()Returns whether this status represents a redirection status code.- Returns:
trueif this represents a redirection status code,falseotherwise.
-
isClientError
boolean isClientError()Returns whether this status represents a client error status code.- Returns:
trueif this represents a client error status code,falseotherwise.
-
isServerError
boolean isServerError()Returns whether this status represents a server error status code.- Returns:
trueif this represents a server error status code,falseotherwise.
-
hashCode
int hashCode() -
equals
-