Enum HttpStatus
- All Implemented Interfaces:
HttpStatusCode, Comparable<HttpStatus>
The common response statuses, so
assertEquals(HttpStatus.OK, response.getStatusCode()) reads as it does in Spring.-
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanbooleanbooleanbooleanbooleanisError()A 4xx or a 5xx.static HttpStatusresolve(int code) The constant forcode, or null when there is none.intvalue()The numeric code.static HttpStatusvalueOf(int code) The constant forcode; IllegalArgumentException when there is none.static HttpStatusReturns the enum constant of this type with the specified name.static HttpStatus[]values()Returns an array containing the constants of this enum type, in the order they are declared.Methods inherited from class Enum
clone, compareTo, equals, getDeclaringClass, getEnumValues, hashCode, name, ordinal, setEnumValues, toString, valueOf
-
Enum Constant Details
-
CONTINUE
-
SWITCHING_PROTOCOLS
-
OK
-
CREATED
-
ACCEPTED
-
NO_CONTENT
-
PARTIAL_CONTENT
-
MOVED_PERMANENTLY
-
FOUND
-
SEE_OTHER
-
NOT_MODIFIED
-
TEMPORARY_REDIRECT
-
PERMANENT_REDIRECT
-
BAD_REQUEST
-
UNAUTHORIZED
-
FORBIDDEN
-
NOT_FOUND
-
METHOD_NOT_ALLOWED
-
NOT_ACCEPTABLE
-
REQUEST_TIMEOUT
-
CONFLICT
-
GONE
-
LENGTH_REQUIRED
-
PRECONDITION_FAILED
-
PAYLOAD_TOO_LARGE
-
UNSUPPORTED_MEDIA_TYPE
-
REQUESTED_RANGE_NOT_SATISFIABLE
-
EXPECTATION_FAILED
-
UNPROCESSABLE_ENTITY
-
TOO_MANY_REQUESTS
-
REQUEST_HEADER_FIELDS_TOO_LARGE
-
INTERNAL_SERVER_ERROR
-
NOT_IMPLEMENTED
-
BAD_GATEWAY
-
SERVICE_UNAVAILABLE
-
GATEWAY_TIMEOUT
-
HTTP_VERSION_NOT_SUPPORTED
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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
-
value
public int value()Description copied from interface:HttpStatusCodeThe numeric code.- Specified by:
valuein interfaceHttpStatusCode
-
is1xxInformational
public boolean is1xxInformational()- Specified by:
is1xxInformationalin interfaceHttpStatusCode
-
is2xxSuccessful
public boolean is2xxSuccessful()- Specified by:
is2xxSuccessfulin interfaceHttpStatusCode
-
is3xxRedirection
public boolean is3xxRedirection()- Specified by:
is3xxRedirectionin interfaceHttpStatusCode
-
is4xxClientError
public boolean is4xxClientError()- Specified by:
is4xxClientErrorin interfaceHttpStatusCode
-
is5xxServerError
public boolean is5xxServerError()- Specified by:
is5xxServerErrorin interfaceHttpStatusCode
-
isError
public boolean isError()Description copied from interface:HttpStatusCodeA 4xx or a 5xx.- Specified by:
isErrorin interfaceHttpStatusCode
-
resolve
The constant forcode, or null when there is none. -
valueOf
The constant forcode; IllegalArgumentException when there is none.
-