public final class SimpleHttpStatus extends java.lang.Object implements HttpStatus
HttpStatus.ACCEPTED, BAD_GATEWAY, BAD_REQUEST, CONFLICT, CONTINUE, CREATED, EXPECTATION_FAILED, FAILED_DEPENDENCY, FORBIDDEN, FOUND, GATEWAY_TIMEOUT, GONE, HTTP_VERSION_NOT_SUPPORTED, INSUFFICIENT_STORAGE, INTERNAL_SERVER_ERROR, LENGTH_REQUIRED, LOCKED, METHOD_NOT_ALLOWED, MOVED_PERMANENTLY, MULTIPLE_CHOICES, MULTISTATUS, NO_CONTENT, NON_AUTHORITATIVE_INFORMATION, NONE, NOT_ACCEPTABLE, NOT_FOUND, NOT_IMPLEMENTED, NOT_MODIFIED, OK, PARTIAL_CONTENT, PAYLOAD_TOO_LARGE, PAYMENT_REQUIRED, PERMANENT_REDIRECT, PRECONDITION_FAILED, PROCESSING, PROXY_AUTHENTICATION_REQUIRED, REQUEST_ENTITY_TOO_LARGE, REQUEST_TIMEOUT, REQUEST_URI_TOO_LONG, RESET_CONTENT, SEE_OTHER, SERVICE_UNAVAILABLE, SWITCHING_PROTOCOLS, TEMPORARY_REDIRECT, UNAUTHORIZED, UNPROCESSABLE_ENTITY, UNSUPPORTED_MEDIA_TYPE, UPGRADE_REQUIRED, URI_TOO_LONG, USE_PROXY, VARIANT_ALSO_NEGOTIATES| Constructor and Description |
|---|
SimpleHttpStatus(int statusCode,
java.lang.String reasonPhrase)
Initialize an HttpStatus object.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
java.lang.String |
httpStatusLine(int httpVersionMajor,
int httpVersionMinor)
Returns a status line in the form:
HTTP/VersionMajor.VersionMinor SP Status-Code SP Reason-Phrase
|
boolean |
isClientError()
Returns whether this status represents a client error status code.
|
boolean |
isInformational()
Returns whether this represents an informational status code.
|
boolean |
isRedirect()
Returns whether this status represents a redirection status code.
|
boolean |
isServerError()
Returns whether this status represents a server error status code.
|
boolean |
isSuccess()
Returns whether this status represents a success status code.
|
java.lang.String |
reason()
Returns the reason phrase of this status code.
|
int |
statusCode()
Returns the status code.
|
public SimpleHttpStatus(int statusCode,
java.lang.String reasonPhrase)
statusCode - The status code.reasonPhrase - The reason phrase of this status.public int statusCode()
HttpStatusstatusCode in interface HttpStatuspublic java.lang.String reason()
HttpStatusNote: the reason phrase doesn't contain the status code itself.
reason in interface HttpStatusnull if the status code is unknown.public java.lang.String httpStatusLine(int httpVersionMajor,
int httpVersionMinor)
HttpStatusHTTP/VersionMajor.VersionMinor SP Status-Code SP Reason-Phrase
httpStatusLine in interface HttpStatushttpVersionMajor - The major version number, usually 1httpVersionMinor - The minor version number, usually 1public boolean isInformational()
HttpStatusisInformational in interface HttpStatustrue if this represents an informational status code, false otherwise.public boolean isSuccess()
HttpStatusisSuccess in interface HttpStatustrue if this represents a success status code, false otherwise.public boolean isRedirect()
HttpStatusisRedirect in interface HttpStatustrue if this represents a redirection status code, false otherwise.public boolean isClientError()
HttpStatusisClientError in interface HttpStatustrue if this represents a client error status code, false otherwise.public boolean isServerError()
HttpStatusisServerError in interface HttpStatustrue if this represents a server error status code, false otherwise.public int hashCode()
hashCode in interface HttpStatushashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in interface HttpStatusequals in class java.lang.Object