public interface Status
| Modifier and Type | Field and Description |
|---|---|
static Status |
NOT_MODIFIED
The 304 status code.
|
static Status |
OK
The 200 status code.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getCode()
The status code.
|
String |
getMessage()
The message of the status.
|
HttpResponseStatus |
getNettyStatus()
The status as Netty's type.
|
default boolean |
is1xx()
If
getCode() is >= 100 and < 200. |
default boolean |
is2xx()
If
getCode() is >= 200 and < 300. |
default boolean |
is3xx()
If
getCode() is >= 300 and < 400. |
default boolean |
is4xx()
If
getCode() is >= 400 and < 500. |
default boolean |
is5xx()
If
getCode() 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.
|
static final Status OK
static final Status NOT_MODIFIED
static Status of(int code, String message)
code - the status codemessage - the status messagestatic Status of(int code)
code - the status codeint getCode()
String getMessage()
default boolean is1xx()
getCode() is >= 100 and < 200.true if getCode() is >= 100 and < 200, else falsedefault boolean is2xx()
getCode() is >= 200 and < 300.true if getCode() is >= 200 and < 300, else falsedefault boolean is3xx()
getCode() is >= 300 and < 400.true if getCode() is >= 300 and < 400, else falsedefault boolean is4xx()
getCode() is >= 400 and < 500.true if getCode() is >= 400 and < 500, else falsedefault boolean is5xx()
getCode() is >= 500 and < 600.true if getCode() is >= 500 and < 600, else falseHttpResponseStatus getNettyStatus()
Used internally.