public enum HttpStatusCode extends Enum<HttpStatusCode>
Enumerable for the most common HTTP status codes returned by the API.
Enum Constant and Description |
---|
FORBIDDEN |
NOT_FOUND |
OK |
TOO_MANY_REQUESTS |
Modifier and Type | Method and Description |
---|---|
String |
asText()
Get the HTTP status code as a text string.
|
int |
getCode()
Get the HTTP status code.
|
String |
getDescription()
Get the description.
|
static HttpStatusCode |
valueOf(int code)
Returns a
HttpStatusCode which corresponds to the input status
code. |
static HttpStatusCode |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static HttpStatusCode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final HttpStatusCode OK
public static final HttpStatusCode FORBIDDEN
public static final HttpStatusCode NOT_FOUND
public static final HttpStatusCode TOO_MANY_REQUESTS
public static HttpStatusCode[] values()
for (HttpStatusCode c : HttpStatusCode.values()) System.out.println(c);
public static HttpStatusCode valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic int getCode()
Get the HTTP status code.
public String getDescription()
Get the description.
public String asText()
Get the HTTP status code as a text string.
public static HttpStatusCode valueOf(int code)
Returns a HttpStatusCode
which corresponds to the input status
code.
code
- the status codeHttpStatusCode
Copyright © 2017. All rights reserved.