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_4XXINFORMATIONAL_1XXREDIRECTION_3XXSERVER_ERROR_5XXSUCCESSFUL_2XXUNKNOWNUnknown.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(int statusCode)Determine ifcodefalls into thisHttpResponseStatus.StatusClass.booleancontains(HttpResponseStatus status)Determine ifstatuscode falls into thisHttpResponseStatus.StatusClass.static HttpResponseStatus.StatusClassfromStatusCode(int statusCode)Determines theHttpResponseStatus.StatusClassfrom thestatusCode.static HttpResponseStatus.StatusClassvalueOf(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 ifcodefalls into thisHttpResponseStatus.StatusClass.- Parameters:
statusCode- the status code to test- Returns:
trueif and only if the specified HTTP status code falls into this class
-
contains
public boolean contains(HttpResponseStatus status)
Determine ifstatuscode falls into thisHttpResponseStatus.StatusClass.- Parameters:
status- the status to test- Returns:
trueif and only if the specified HTTP status code falls into this class
-
fromStatusCode
public static HttpResponseStatus.StatusClass fromStatusCode(int statusCode)
Determines theHttpResponseStatus.StatusClassfrom thestatusCode.- Parameters:
statusCode- the status code to use for determining theHttpResponseStatus.StatusClass- Returns:
- one of the
HttpResponseStatus.StatusClassenum values - Throws:
java.lang.IllegalArgumentException- ifstatusCodeis not a 3-digit integer
-
-