Package io.servicetalk.http.api
Enum Class HttpResponseStatus.StatusClass
java.lang.Object
java.lang.Enum<HttpResponseStatus.StatusClass>
io.servicetalk.http.api.HttpResponseStatus.StatusClass
- All Implemented Interfaces:
Serializable
,Comparable<HttpResponseStatus.StatusClass>
,Constable
- Enclosing class:
- HttpResponseStatus
The class of response status codes.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionUnknown. -
Method Summary
Modifier and TypeMethodDescriptionboolean
contains
(int statusCode) Determine ifcode
falls into thisHttpResponseStatus.StatusClass
.boolean
contains
(HttpResponseStatus status) Determine ifstatus
code falls into thisHttpResponseStatus.StatusClass
.fromStatusCode
(int statusCode) Determines theHttpResponseStatus.StatusClass
from thestatusCode
.Returns the enum constant of this class with the specified name.static HttpResponseStatus.StatusClass[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INFORMATIONAL_1XX
-
SUCCESSFUL_2XX
-
REDIRECTION_3XX
-
CLIENT_ERROR_4XX
-
SERVER_ERROR_5XX
-
UNKNOWN
Unknown. 3-digit status codes outside of the defined range of response status codes.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
contains
public boolean contains(int statusCode) Determine ifcode
falls into thisHttpResponseStatus.StatusClass
.- Parameters:
statusCode
- the status code to test- Returns:
true
if and only if the specified HTTP status code falls into this class
-
contains
Determine ifstatus
code falls into thisHttpResponseStatus.StatusClass
.- Parameters:
status
- the status to test- Returns:
true
if and only if the specified HTTP status code falls into this class
-
fromStatusCode
Determines theHttpResponseStatus.StatusClass
from thestatusCode
.- Parameters:
statusCode
- the status code to use for determining theHttpResponseStatus.StatusClass
- Returns:
- one of the
HttpResponseStatus.StatusClass
enum values - Throws:
IllegalArgumentException
- ifstatusCode
is not a 3-digit integer
-