- java.lang.Object
-
- io.netty5.handler.codec.http.HttpResponseStatus
-
- All Implemented Interfaces:
Comparable<HttpResponseStatus>
public class HttpResponseStatus extends Object implements Comparable<HttpResponseStatus>
-
-
Field Summary
Fields Modifier and Type Field Description static HttpResponseStatusACCEPTED202 Acceptedstatic HttpResponseStatusBAD_GATEWAY502 Bad Gatewaystatic HttpResponseStatusBAD_REQUEST400 Bad Requeststatic HttpResponseStatusCONFLICT409 Conflictstatic HttpResponseStatusCONTINUE100 Continuestatic HttpResponseStatusCREATED201 Createdstatic HttpResponseStatusEXPECTATION_FAILED417 Expectation Failedstatic HttpResponseStatusFAILED_DEPENDENCY424 Failed Dependency (WebDAV, RFC4918)static HttpResponseStatusFORBIDDEN403 Forbiddenstatic HttpResponseStatusFOUND302 Foundstatic HttpResponseStatusGATEWAY_TIMEOUT504 Gateway Timeoutstatic HttpResponseStatusGONE410 Gonestatic HttpResponseStatusHTTP_VERSION_NOT_SUPPORTED505 HTTP Version Not Supportedstatic HttpResponseStatusINSUFFICIENT_STORAGE507 Insufficient Storage (WebDAV, RFC4918)static HttpResponseStatusINTERNAL_SERVER_ERROR500 Internal Server Errorstatic HttpResponseStatusLENGTH_REQUIRED411 Length Requiredstatic HttpResponseStatusLOCKED423 Locked (WebDAV, RFC4918)static HttpResponseStatusMETHOD_NOT_ALLOWED405 Method Not Allowedstatic HttpResponseStatusMISDIRECTED_REQUEST421 Misdirected Requeststatic HttpResponseStatusMOVED_PERMANENTLY301 Moved Permanentlystatic HttpResponseStatusMULTI_STATUS207 Multi-Status (WebDAV, RFC2518)static HttpResponseStatusMULTIPLE_CHOICES300 Multiple Choicesstatic HttpResponseStatusNETWORK_AUTHENTICATION_REQUIRED511 Network Authentication Required (RFC6585)static HttpResponseStatusNO_CONTENT204 No Contentstatic HttpResponseStatusNON_AUTHORITATIVE_INFORMATION203 Non-Authoritative Information (since HTTP/1.1)static HttpResponseStatusNOT_ACCEPTABLE406 Not Acceptablestatic HttpResponseStatusNOT_EXTENDED510 Not Extended (RFC2774)static HttpResponseStatusNOT_FOUND404 Not Foundstatic HttpResponseStatusNOT_IMPLEMENTED501 Not Implementedstatic HttpResponseStatusNOT_MODIFIED304 Not Modifiedstatic HttpResponseStatusOK200 OKstatic HttpResponseStatusPARTIAL_CONTENT206 Partial Contentstatic HttpResponseStatusPAYMENT_REQUIRED402 Payment Requiredstatic HttpResponseStatusPERMANENT_REDIRECT308 Permanent Redirect (RFC7538)static HttpResponseStatusPRECONDITION_FAILED412 Precondition Failedstatic HttpResponseStatusPRECONDITION_REQUIRED428 Precondition Required (RFC6585)static HttpResponseStatusPROCESSING102 Processing (WebDAV, RFC2518)static HttpResponseStatusPROXY_AUTHENTICATION_REQUIRED407 Proxy Authentication Requiredstatic HttpResponseStatusREQUEST_ENTITY_TOO_LARGE413 Request Entity Too Largestatic HttpResponseStatusREQUEST_HEADER_FIELDS_TOO_LARGE431 Request Header Fields Too Large (RFC6585)static HttpResponseStatusREQUEST_TIMEOUT408 Request Timeoutstatic HttpResponseStatusREQUEST_URI_TOO_LONG414 Request-URI Too Longstatic HttpResponseStatusREQUESTED_RANGE_NOT_SATISFIABLE416 Requested Range Not Satisfiablestatic HttpResponseStatusRESET_CONTENT205 Reset Contentstatic HttpResponseStatusSEE_OTHER303 See Other (since HTTP/1.1)static HttpResponseStatusSERVICE_UNAVAILABLE503 Service Unavailablestatic HttpResponseStatusSWITCHING_PROTOCOLS101 Switching Protocolsstatic HttpResponseStatusTEMPORARY_REDIRECT307 Temporary Redirect (since HTTP/1.1)static HttpResponseStatusTOO_MANY_REQUESTS429 Too Many Requests (RFC6585)static HttpResponseStatusUNAUTHORIZED401 Unauthorizedstatic HttpResponseStatusUNORDERED_COLLECTION425 Unordered Collection (WebDAV, RFC3648)static HttpResponseStatusUNPROCESSABLE_ENTITY422 Unprocessable Entity (WebDAV, RFC4918)static HttpResponseStatusUNSUPPORTED_MEDIA_TYPE415 Unsupported Media Typestatic HttpResponseStatusUPGRADE_REQUIRED426 Upgrade Required (RFC2817)static HttpResponseStatusUSE_PROXY305 Use Proxy (since HTTP/1.1)static HttpResponseStatusVARIANT_ALSO_NEGOTIATES506 Variant Also Negotiates (RFC2295)
-
Constructor Summary
Constructors Constructor Description HttpResponseStatus(int code, String reasonPhrase)Creates a new instance with the specifiedcodeand itsreasonPhrase.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcode()Returns the code of thisHttpResponseStatus.AsciiStringcodeAsText()Returns the status code asAsciiString.HttpStatusClasscodeClass()Returns the class of thisHttpResponseStatusintcompareTo(HttpResponseStatus o)Equality ofHttpResponseStatusonly depends oncode().booleanequals(Object o)Equality ofHttpResponseStatusonly depends oncode().inthashCode()static HttpResponseStatusparseLine(AsciiString line)Parses the specified HTTP status line into aHttpResponseStatus.static HttpResponseStatusparseLine(CharSequence line)Parses the specified HTTP status line into aHttpResponseStatus.static HttpResponseStatusparseLine(String line)Parses the specified HTTP status line into aHttpResponseStatus.StringreasonPhrase()Returns the reason phrase of thisHttpResponseStatus.StringtoString()static HttpResponseStatusvalueOf(int code)Returns theHttpResponseStatusrepresented by the specified code.static HttpResponseStatusvalueOf(int code, String reasonPhrase)
-
-
-
Field Detail
-
CONTINUE
public static final HttpResponseStatus CONTINUE
100 Continue
-
SWITCHING_PROTOCOLS
public static final HttpResponseStatus SWITCHING_PROTOCOLS
101 Switching Protocols
-
PROCESSING
public static final HttpResponseStatus PROCESSING
102 Processing (WebDAV, RFC2518)
-
OK
public static final HttpResponseStatus OK
200 OK
-
CREATED
public static final HttpResponseStatus CREATED
201 Created
-
ACCEPTED
public static final HttpResponseStatus ACCEPTED
202 Accepted
-
NON_AUTHORITATIVE_INFORMATION
public static final HttpResponseStatus NON_AUTHORITATIVE_INFORMATION
203 Non-Authoritative Information (since HTTP/1.1)
-
NO_CONTENT
public static final HttpResponseStatus NO_CONTENT
204 No Content
-
RESET_CONTENT
public static final HttpResponseStatus RESET_CONTENT
205 Reset Content
-
PARTIAL_CONTENT
public static final HttpResponseStatus PARTIAL_CONTENT
206 Partial Content
-
MULTI_STATUS
public static final HttpResponseStatus MULTI_STATUS
207 Multi-Status (WebDAV, RFC2518)
-
MULTIPLE_CHOICES
public static final HttpResponseStatus MULTIPLE_CHOICES
300 Multiple Choices
-
MOVED_PERMANENTLY
public static final HttpResponseStatus MOVED_PERMANENTLY
301 Moved Permanently
-
FOUND
public static final HttpResponseStatus FOUND
302 Found
-
SEE_OTHER
public static final HttpResponseStatus SEE_OTHER
303 See Other (since HTTP/1.1)
-
NOT_MODIFIED
public static final HttpResponseStatus NOT_MODIFIED
304 Not Modified
-
USE_PROXY
public static final HttpResponseStatus USE_PROXY
305 Use Proxy (since HTTP/1.1)
-
TEMPORARY_REDIRECT
public static final HttpResponseStatus TEMPORARY_REDIRECT
307 Temporary Redirect (since HTTP/1.1)
-
PERMANENT_REDIRECT
public static final HttpResponseStatus PERMANENT_REDIRECT
308 Permanent Redirect (RFC7538)
-
BAD_REQUEST
public static final HttpResponseStatus BAD_REQUEST
400 Bad Request
-
UNAUTHORIZED
public static final HttpResponseStatus UNAUTHORIZED
401 Unauthorized
-
PAYMENT_REQUIRED
public static final HttpResponseStatus PAYMENT_REQUIRED
402 Payment Required
-
FORBIDDEN
public static final HttpResponseStatus FORBIDDEN
403 Forbidden
-
NOT_FOUND
public static final HttpResponseStatus NOT_FOUND
404 Not Found
-
METHOD_NOT_ALLOWED
public static final HttpResponseStatus METHOD_NOT_ALLOWED
405 Method Not Allowed
-
NOT_ACCEPTABLE
public static final HttpResponseStatus NOT_ACCEPTABLE
406 Not Acceptable
-
PROXY_AUTHENTICATION_REQUIRED
public static final HttpResponseStatus PROXY_AUTHENTICATION_REQUIRED
407 Proxy Authentication Required
-
REQUEST_TIMEOUT
public static final HttpResponseStatus REQUEST_TIMEOUT
408 Request Timeout
-
CONFLICT
public static final HttpResponseStatus CONFLICT
409 Conflict
-
GONE
public static final HttpResponseStatus GONE
410 Gone
-
LENGTH_REQUIRED
public static final HttpResponseStatus LENGTH_REQUIRED
411 Length Required
-
PRECONDITION_FAILED
public static final HttpResponseStatus PRECONDITION_FAILED
412 Precondition Failed
-
REQUEST_ENTITY_TOO_LARGE
public static final HttpResponseStatus REQUEST_ENTITY_TOO_LARGE
413 Request Entity Too Large
-
REQUEST_URI_TOO_LONG
public static final HttpResponseStatus REQUEST_URI_TOO_LONG
414 Request-URI Too Long
-
UNSUPPORTED_MEDIA_TYPE
public static final HttpResponseStatus UNSUPPORTED_MEDIA_TYPE
415 Unsupported Media Type
-
REQUESTED_RANGE_NOT_SATISFIABLE
public static final HttpResponseStatus REQUESTED_RANGE_NOT_SATISFIABLE
416 Requested Range Not Satisfiable
-
EXPECTATION_FAILED
public static final HttpResponseStatus EXPECTATION_FAILED
417 Expectation Failed
-
MISDIRECTED_REQUEST
public static final HttpResponseStatus MISDIRECTED_REQUEST
421 Misdirected Request- See Also:
- 421 (Misdirected Request) Status Code
-
UNPROCESSABLE_ENTITY
public static final HttpResponseStatus UNPROCESSABLE_ENTITY
422 Unprocessable Entity (WebDAV, RFC4918)
-
LOCKED
public static final HttpResponseStatus LOCKED
423 Locked (WebDAV, RFC4918)
-
FAILED_DEPENDENCY
public static final HttpResponseStatus FAILED_DEPENDENCY
424 Failed Dependency (WebDAV, RFC4918)
-
UNORDERED_COLLECTION
public static final HttpResponseStatus UNORDERED_COLLECTION
425 Unordered Collection (WebDAV, RFC3648)
-
UPGRADE_REQUIRED
public static final HttpResponseStatus UPGRADE_REQUIRED
426 Upgrade Required (RFC2817)
-
PRECONDITION_REQUIRED
public static final HttpResponseStatus PRECONDITION_REQUIRED
428 Precondition Required (RFC6585)
-
TOO_MANY_REQUESTS
public static final HttpResponseStatus TOO_MANY_REQUESTS
429 Too Many Requests (RFC6585)
-
REQUEST_HEADER_FIELDS_TOO_LARGE
public static final HttpResponseStatus REQUEST_HEADER_FIELDS_TOO_LARGE
431 Request Header Fields Too Large (RFC6585)
-
INTERNAL_SERVER_ERROR
public static final HttpResponseStatus INTERNAL_SERVER_ERROR
500 Internal Server Error
-
NOT_IMPLEMENTED
public static final HttpResponseStatus NOT_IMPLEMENTED
501 Not Implemented
-
BAD_GATEWAY
public static final HttpResponseStatus BAD_GATEWAY
502 Bad Gateway
-
SERVICE_UNAVAILABLE
public static final HttpResponseStatus SERVICE_UNAVAILABLE
503 Service Unavailable
-
GATEWAY_TIMEOUT
public static final HttpResponseStatus GATEWAY_TIMEOUT
504 Gateway Timeout
-
HTTP_VERSION_NOT_SUPPORTED
public static final HttpResponseStatus HTTP_VERSION_NOT_SUPPORTED
505 HTTP Version Not Supported
-
VARIANT_ALSO_NEGOTIATES
public static final HttpResponseStatus VARIANT_ALSO_NEGOTIATES
506 Variant Also Negotiates (RFC2295)
-
INSUFFICIENT_STORAGE
public static final HttpResponseStatus INSUFFICIENT_STORAGE
507 Insufficient Storage (WebDAV, RFC4918)
-
NOT_EXTENDED
public static final HttpResponseStatus NOT_EXTENDED
510 Not Extended (RFC2774)
-
NETWORK_AUTHENTICATION_REQUIRED
public static final HttpResponseStatus NETWORK_AUTHENTICATION_REQUIRED
511 Network Authentication Required (RFC6585)
-
-
Constructor Detail
-
HttpResponseStatus
public HttpResponseStatus(int code, String reasonPhrase)Creates a new instance with the specifiedcodeand itsreasonPhrase.
-
-
Method Detail
-
valueOf
public static HttpResponseStatus valueOf(int code)
Returns theHttpResponseStatusrepresented by the specified code. If the specified code is a standard HTTP status code, a cached instance will be returned. Otherwise, a new instance will be returned.
-
valueOf
public static HttpResponseStatus valueOf(int code, String reasonPhrase)
Returns theHttpResponseStatusrepresented by the specifiedcodeandreasonPhrase. If the specified code is a standard HTTP statuscodeandreasonPhrase, a cached instance will be returned. Otherwise, a new instance will be returned.- Parameters:
code- The response code value.reasonPhrase- The response code reason phrase.- Returns:
- the
HttpResponseStatusrepresented by the specifiedcodeandreasonPhrase.
-
parseLine
public static HttpResponseStatus parseLine(CharSequence line)
Parses the specified HTTP status line into aHttpResponseStatus. The expected formats of the line are:statusCode(e.g. 200)statusCodereasonPhrase(e.g. 404 Not Found)
- Throws:
IllegalArgumentException- if the specified status line is malformed
-
parseLine
public static HttpResponseStatus parseLine(String line)
Parses the specified HTTP status line into aHttpResponseStatus. The expected formats of the line are:statusCode(e.g. 200)statusCodereasonPhrase(e.g. 404 Not Found)
- Throws:
IllegalArgumentException- if the specified status line is malformed
-
parseLine
public static HttpResponseStatus parseLine(AsciiString line)
Parses the specified HTTP status line into aHttpResponseStatus. The expected formats of the line are:statusCode(e.g. 200)statusCodereasonPhrase(e.g. 404 Not Found)
- Throws:
IllegalArgumentException- if the specified status line is malformed
-
code
public int code()
Returns the code of thisHttpResponseStatus.
-
codeAsText
public AsciiString codeAsText()
Returns the status code asAsciiString.
-
reasonPhrase
public String reasonPhrase()
Returns the reason phrase of thisHttpResponseStatus.
-
codeClass
public HttpStatusClass codeClass()
Returns the class of thisHttpResponseStatus
-
equals
public boolean equals(Object o)
Equality ofHttpResponseStatusonly depends oncode(). The reason phrase is not considered for equality.
-
compareTo
public int compareTo(HttpResponseStatus o)
Equality ofHttpResponseStatusonly depends oncode(). The reason phrase is not considered for equality.- Specified by:
compareToin interfaceComparable<HttpResponseStatus>
-
-