Package io.servicetalk.http.api
Enum HttpResponseStatus.StatusClass
- java.lang.Object
-
- java.lang.Enum<HttpResponseStatus.StatusClass>
-
- io.servicetalk.http.api.HttpResponseStatus.StatusClass
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<HttpResponseStatus.StatusClass>
- Enclosing class:
- HttpResponseStatus
public static enum HttpResponseStatus.StatusClass extends java.lang.Enum<HttpResponseStatus.StatusClass>
The class of response status codes.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CLIENT_ERROR_4XX
INFORMATIONAL_1XX
REDIRECTION_3XX
SERVER_ERROR_5XX
SUCCESSFUL_2XX
UNKNOWN
Unknown.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(int statusCode)
Determine ifcode
falls into thisHttpResponseStatus.StatusClass
.boolean
contains(HttpResponseStatus status)
Determine ifstatus
code falls into thisHttpResponseStatus.StatusClass
.static HttpResponseStatus.StatusClass
fromStatusCode(int statusCode)
Determines theHttpResponseStatus.StatusClass
from thestatusCode
.static HttpResponseStatus.StatusClass
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static HttpResponseStatus.StatusClass[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INFORMATIONAL_1XX
public static final HttpResponseStatus.StatusClass INFORMATIONAL_1XX
-
SUCCESSFUL_2XX
public static final HttpResponseStatus.StatusClass SUCCESSFUL_2XX
-
REDIRECTION_3XX
public static final HttpResponseStatus.StatusClass REDIRECTION_3XX
-
CLIENT_ERROR_4XX
public static final HttpResponseStatus.StatusClass CLIENT_ERROR_4XX
-
SERVER_ERROR_5XX
public static final HttpResponseStatus.StatusClass SERVER_ERROR_5XX
-
UNKNOWN
public static final HttpResponseStatus.StatusClass UNKNOWN
Unknown. 3-digit status codes outside of the defined range of response status codes.
-
-
Method Detail
-
values
public static HttpResponseStatus.StatusClass[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (HttpResponseStatus.StatusClass c : HttpResponseStatus.StatusClass.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static HttpResponseStatus.StatusClass valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- 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
public boolean contains(HttpResponseStatus status)
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
public static HttpResponseStatus.StatusClass fromStatusCode(int statusCode)
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:
java.lang.IllegalArgumentException
- ifstatusCode
is not a 3-digit integer
-
-