Package software.amazon.awssdk.http
Enum HttpStatusFamily
- java.lang.Object
-
- java.lang.Enum<HttpStatusFamily>
-
- software.amazon.awssdk.http.HttpStatusFamily
-
- All Implemented Interfaces:
Serializable
,Comparable<HttpStatusFamily>
public enum HttpStatusFamily extends Enum<HttpStatusFamily>
The set of HTTP status families defined by the standard. A code can be converted to its family withof(int)
.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CLIENT_ERROR
4xx response family.INFORMATIONAL
1xx response family.OTHER
The family for any status code outside of the range 100-599.REDIRECTION
3xx response family.SERVER_ERROR
5xx response family.SUCCESSFUL
2xx response family.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isOneOf(HttpStatusFamily... families)
Determine whether this HTTP status family is in the list of provided families.static HttpStatusFamily
of(int httpStatusCode)
Retrieve the HTTP status family for the given HTTP status code.static HttpStatusFamily
valueOf(String name)
Returns the enum constant of this type with the specified name.static HttpStatusFamily[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INFORMATIONAL
public static final HttpStatusFamily INFORMATIONAL
1xx response family.
-
SUCCESSFUL
public static final HttpStatusFamily SUCCESSFUL
2xx response family.
-
REDIRECTION
public static final HttpStatusFamily REDIRECTION
3xx response family.
-
CLIENT_ERROR
public static final HttpStatusFamily CLIENT_ERROR
4xx response family.
-
SERVER_ERROR
public static final HttpStatusFamily SERVER_ERROR
5xx response family.
-
OTHER
public static final HttpStatusFamily OTHER
The family for any status code outside of the range 100-599.
-
-
Method Detail
-
values
public static HttpStatusFamily[] 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 (HttpStatusFamily c : HttpStatusFamily.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static HttpStatusFamily valueOf(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:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
of
public static HttpStatusFamily of(int httpStatusCode)
Retrieve the HTTP status family for the given HTTP status code.
-
isOneOf
public boolean isOneOf(HttpStatusFamily... families)
Determine whether this HTTP status family is in the list of provided families.- Parameters:
families
- The list of families to check against this family.- Returns:
- True if any of the families in the list match this one.
-
-