Package ratpack.core.http
Interface Status
-
public interface Status
A status line of a HTTP response.
-
-
Field Summary
Fields Modifier and Type Field Description static Status
ACCEPTED
The 202 status code.static Status
ALREADY_REPORTED
The 208 status code.static Status
BAD_GATEWAY
The 502 status code.static Status
BAD_REQUEST
The 400 status code.static Status
CONFLICT
The 409 status code.static Status
CONTINUE
The 100 status code.static Status
CREATED
The 201 status code.static Status
EARLY_HINTS
The 103 status code.static Status
EXPECTATION_FAILED
The 417 status code.static Status
FAILED_DEPENDENCY
The 424 status code.static Status
FORBIDDEN
The 403 status code.static Status
FOUND
The 302 status code.static Status
GATEWAY_TIMEOUT
The 504 status code.static Status
GONE
The 410 status code.static Status
HEADER_FIELDS_TOO_LARGE
The 431 status code.static Status
HTTP_VER_NOT_SUPPORTED
The 505 status code.static Status
IM_A_TEAPOT
The 418 status code.static Status
IM_USED
The 226 status code.static Status
INSUFFICIENT_STORAGE
The 507 status code.static Status
INTERNAL_SERVER_ERROR
The 500 status code.static Status
LENGTH_REQUIRED
The 411 status code.static Status
LOCKED
The 423 status code.static Status
LOOP_DETECTED
The 508 status code.static Status
METHOD_NOT_ALLOWED
The 405 status code.static Status
MISDIRECTED_REQUEST
The 421 status code.static Status
MOVED_PERMANENTLY
The 301 status code.static Status
MULTI_STATUS
The 207 status code.static Status
MULTIPLE_CHOICES
The 300 status code.static Status
NETWORK_AUTH_REQUIRED
The 511 status code.static Status
NO_CONTENT
The 204 status code.static Status
NON_AUTHORITATIVE_INFO
The 203 status code.static Status
NOT_ACCEPTABLE
The 406 status code.static Status
NOT_EXTENDED
The 510 status code.static Status
NOT_FOUND
The 404 status code.static Status
NOT_IMPLEMENTED
The 501 status code.static Status
NOT_MODIFIED
The 304 status code.static Status
OK
The 200 status code.static Status
PARTIAL_CONTENT
The 206 status code.static Status
PAYLOAD_TOO_LARGE
The 413 status code.static Status
PAYMENT_REQUIRED
The 402 status code.static Status
PERMANENT_REDIRECT
The 308 status code.static Status
PRECONDITION_FAILED
The 412 status code.static Status
PRECONDITION_REQUIRED
The 428 status code.static Status
PROCESSING
The 102 status code.static Status
PROXY_AUTH_REQUIRED
The 407 status code.static Status
RANGE_NOT_SATISFIABLE
The 416 status code.static Status
REQUEST_TIMEOUT
The 408 status code.static Status
RESET_CONTENT
The 205 status code.static Status
SEE_OTHER
The 303 status code.static Status
SERVICE_UNAVAILABLE
The 503 status code.static Status
SWITCHING_PROTOCOLS
The 101 status code.static Status
TEMPORARY_REDIRECT
The 307 status code.static Status
TOO_MANY_REQUESTS
The 429 status code.static Status
UNAUTHORIZED
The 401 status code.static Status
UNAVAILBLE_FOR_LEGAL_REASONS
The 451 status code.static Status
UNPROCESSABLE_ENTITY
The 422 status code.static Status
UNSUPPORTED_MEDIA_TYPE
The 415 status code.static Status
UPGRADE_REQUIRED
The 426 status code.static Status
URI_TOO_LONG
The 414 status code.static Status
USE_PROXY
The 505 status code.static Status
VARIANT_ALSO_NEGOTIATES
The 506 status code.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description int
getCode()
The status code.String
getMessage()
The message of the status.io.netty.handler.codec.http.HttpResponseStatus
getNettyStatus()
The status as Netty's type.default boolean
is1xx()
IfgetCode()
is >= 100 and < 200.default boolean
is2xx()
IfgetCode()
is >= 200 and < 300.default boolean
is3xx()
IfgetCode()
is >= 300 and < 400.default boolean
is4xx()
IfgetCode()
is >= 400 and < 500.default boolean
is5xx()
IfgetCode()
is >= 500 and < 600.static Status
of(int code)
Creates a new status object.static Status
of(int code, String message)
Creates a new status object.
-
-
-
Field Detail
-
CONTINUE
static final Status CONTINUE
The 100 status code.- Since:
- 1.6
-
SWITCHING_PROTOCOLS
static final Status SWITCHING_PROTOCOLS
The 101 status code.- Since:
- 1.6
-
PROCESSING
static final Status PROCESSING
The 102 status code.- Since:
- 1.6
-
EARLY_HINTS
static final Status EARLY_HINTS
The 103 status code.- Since:
- 1.6
-
OK
static final Status OK
The 200 status code.- Since:
- 1.4
-
CREATED
static final Status CREATED
The 201 status code.- Since:
- 1.6
-
ACCEPTED
static final Status ACCEPTED
The 202 status code.- Since:
- 1.6
-
NON_AUTHORITATIVE_INFO
static final Status NON_AUTHORITATIVE_INFO
The 203 status code.- Since:
- 1.6
-
NO_CONTENT
static final Status NO_CONTENT
The 204 status code.- Since:
- 1.6
-
RESET_CONTENT
static final Status RESET_CONTENT
The 205 status code.- Since:
- 1.6
-
PARTIAL_CONTENT
static final Status PARTIAL_CONTENT
The 206 status code.- Since:
- 1.6
-
MULTI_STATUS
static final Status MULTI_STATUS
The 207 status code.- Since:
- 1.6
-
ALREADY_REPORTED
static final Status ALREADY_REPORTED
The 208 status code.- Since:
- 1.6
-
IM_USED
static final Status IM_USED
The 226 status code.- Since:
- 1.6
-
MULTIPLE_CHOICES
static final Status MULTIPLE_CHOICES
The 300 status code.- Since:
- 1.6
-
MOVED_PERMANENTLY
static final Status MOVED_PERMANENTLY
The 301 status code.- Since:
- 1.6
-
FOUND
static final Status FOUND
The 302 status code.- Since:
- 1.6
-
SEE_OTHER
static final Status SEE_OTHER
The 303 status code.- Since:
- 1.6
-
NOT_MODIFIED
static final Status NOT_MODIFIED
The 304 status code.- Since:
- 1.4
-
USE_PROXY
static final Status USE_PROXY
The 505 status code.- Since:
- 1.6
-
TEMPORARY_REDIRECT
static final Status TEMPORARY_REDIRECT
The 307 status code.- Since:
- 1.6
-
PERMANENT_REDIRECT
static final Status PERMANENT_REDIRECT
The 308 status code.- Since:
- 1.6
-
BAD_REQUEST
static final Status BAD_REQUEST
The 400 status code.- Since:
- 1.6
-
UNAUTHORIZED
static final Status UNAUTHORIZED
The 401 status code.- Since:
- 1.6
-
PAYMENT_REQUIRED
static final Status PAYMENT_REQUIRED
The 402 status code.- Since:
- 1.6
-
FORBIDDEN
static final Status FORBIDDEN
The 403 status code.- Since:
- 1.6
-
NOT_FOUND
static final Status NOT_FOUND
The 404 status code.- Since:
- 1.6
-
METHOD_NOT_ALLOWED
static final Status METHOD_NOT_ALLOWED
The 405 status code.- Since:
- 1.6
-
NOT_ACCEPTABLE
static final Status NOT_ACCEPTABLE
The 406 status code.- Since:
- 1.6
-
PROXY_AUTH_REQUIRED
static final Status PROXY_AUTH_REQUIRED
The 407 status code.- Since:
- 1.6
-
REQUEST_TIMEOUT
static final Status REQUEST_TIMEOUT
The 408 status code.- Since:
- 1.6
-
CONFLICT
static final Status CONFLICT
The 409 status code.- Since:
- 1.6
-
GONE
static final Status GONE
The 410 status code.- Since:
- 1.6
-
LENGTH_REQUIRED
static final Status LENGTH_REQUIRED
The 411 status code.- Since:
- 1.6
-
PRECONDITION_FAILED
static final Status PRECONDITION_FAILED
The 412 status code.- Since:
- 1.6
-
PAYLOAD_TOO_LARGE
static final Status PAYLOAD_TOO_LARGE
The 413 status code.- Since:
- 1.6
-
URI_TOO_LONG
static final Status URI_TOO_LONG
The 414 status code.- Since:
- 1.6
-
UNSUPPORTED_MEDIA_TYPE
static final Status UNSUPPORTED_MEDIA_TYPE
The 415 status code.- Since:
- 1.6
-
RANGE_NOT_SATISFIABLE
static final Status RANGE_NOT_SATISFIABLE
The 416 status code.- Since:
- 1.6
-
EXPECTATION_FAILED
static final Status EXPECTATION_FAILED
The 417 status code.- Since:
- 1.6
-
IM_A_TEAPOT
static final Status IM_A_TEAPOT
The 418 status code.- Since:
- 1.6
-
MISDIRECTED_REQUEST
static final Status MISDIRECTED_REQUEST
The 421 status code.- Since:
- 1.6
-
UNPROCESSABLE_ENTITY
static final Status UNPROCESSABLE_ENTITY
The 422 status code.- Since:
- 1.6
-
LOCKED
static final Status LOCKED
The 423 status code.- Since:
- 1.6
-
FAILED_DEPENDENCY
static final Status FAILED_DEPENDENCY
The 424 status code.- Since:
- 1.6
-
UPGRADE_REQUIRED
static final Status UPGRADE_REQUIRED
The 426 status code.- Since:
- 1.6
-
PRECONDITION_REQUIRED
static final Status PRECONDITION_REQUIRED
The 428 status code.- Since:
- 1.6
-
TOO_MANY_REQUESTS
static final Status TOO_MANY_REQUESTS
The 429 status code.- Since:
- 1.6
-
HEADER_FIELDS_TOO_LARGE
static final Status HEADER_FIELDS_TOO_LARGE
The 431 status code.- Since:
- 1.6
-
UNAVAILBLE_FOR_LEGAL_REASONS
static final Status UNAVAILBLE_FOR_LEGAL_REASONS
The 451 status code.- Since:
- 1.6
-
INTERNAL_SERVER_ERROR
static final Status INTERNAL_SERVER_ERROR
The 500 status code.- Since:
- 1.6
-
NOT_IMPLEMENTED
static final Status NOT_IMPLEMENTED
The 501 status code.- Since:
- 1.6
-
BAD_GATEWAY
static final Status BAD_GATEWAY
The 502 status code.- Since:
- 1.6
-
SERVICE_UNAVAILABLE
static final Status SERVICE_UNAVAILABLE
The 503 status code.- Since:
- 1.6
-
GATEWAY_TIMEOUT
static final Status GATEWAY_TIMEOUT
The 504 status code.- Since:
- 1.6
-
HTTP_VER_NOT_SUPPORTED
static final Status HTTP_VER_NOT_SUPPORTED
The 505 status code.- Since:
- 1.6
-
VARIANT_ALSO_NEGOTIATES
static final Status VARIANT_ALSO_NEGOTIATES
The 506 status code.- Since:
- 1.6
-
INSUFFICIENT_STORAGE
static final Status INSUFFICIENT_STORAGE
The 507 status code.- Since:
- 1.6
-
LOOP_DETECTED
static final Status LOOP_DETECTED
The 508 status code.- Since:
- 1.6
-
NOT_EXTENDED
static final Status NOT_EXTENDED
The 510 status code.- Since:
- 1.6
-
NETWORK_AUTH_REQUIRED
static final Status NETWORK_AUTH_REQUIRED
The 511 status code.- Since:
- 1.6
-
-
Method Detail
-
of
static Status of(int code, String message)
Creates a new status object.- Parameters:
code
- the status codemessage
- the status message- Returns:
- a new status object
-
of
static Status of(int code)
Creates a new status object.- Parameters:
code
- the status code- Returns:
- a new status object
-
getCode
int getCode()
The status code.- Returns:
- The status code
-
getMessage
String getMessage()
The message of the status.- Returns:
- The message of the status
-
is1xx
default boolean is1xx()
IfgetCode()
is >= 100 and < 200.- Returns:
true
ifgetCode()
is >= 100 and < 200, elsefalse
- Since:
- 1.3
-
is2xx
default boolean is2xx()
IfgetCode()
is >= 200 and < 300.- Returns:
true
ifgetCode()
is >= 200 and < 300, elsefalse
- Since:
- 1.3
-
is3xx
default boolean is3xx()
IfgetCode()
is >= 300 and < 400.- Returns:
true
ifgetCode()
is >= 300 and < 400, elsefalse
- Since:
- 1.3
-
is4xx
default boolean is4xx()
IfgetCode()
is >= 400 and < 500.- Returns:
true
ifgetCode()
is >= 400 and < 500, elsefalse
- Since:
- 1.3
-
is5xx
default boolean is5xx()
IfgetCode()
is >= 500 and < 600.- Returns:
true
ifgetCode()
is >= 500 and < 600, elsefalse
- Since:
- 1.3
-
getNettyStatus
io.netty.handler.codec.http.HttpResponseStatus getNettyStatus()
The status as Netty's type.Used internally.
- Returns:
- the status as Netty's type
-
-