Package org.hisp.dhis.response
Enum Class HttpStatus
- All Implemented Interfaces:
Serializable,Comparable<HttpStatus>,Constable
Enumeration of HTTP status codes.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnumeration of HTTP status series.Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionReturns the reason phrase of this status code.booleanWhether this status code is in the HTTP series Informational.booleanWhether this status code is in the HTTP series Successful.booleanWhether this status code is in the HTTP series Redirection.booleanWhether this status code is in the HTTP series Client error.booleanWhether this status code is in the HTTP series Server error.booleanisError()Whether this status code is in the HTTP series Client error.static HttpStatusresolve(int statusCode) Resolve the given status code to anHttpStatus, if possible.series()Returns the HTTP status series of this status code.toString()Return a string representation of this status code.intvalue()Returns the integer value of this status code.static HttpStatusvalueOf(int statusCode) Return the enum constant of this type with the specified numeric value.static HttpStatusReturns the enum constant of this class with the specified name.static HttpStatus[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
CONTINUE
-
SWITCHING_PROTOCOLS
-
PROCESSING
-
CHECKPOINT
-
OK
-
CREATED
-
ACCEPTED
-
NON_AUTHORITATIVE_INFORMATION
-
NO_CONTENT
-
RESET_CONTENT
-
PARTIAL_CONTENT
-
MULTI_STATUS
-
ALREADY_REPORTED
-
IM_USED
-
MULTIPLE_CHOICES
-
MOVED_PERMANENTLY
-
FOUND
-
SEE_OTHER
-
NOT_MODIFIED
-
TEMPORARY_REDIRECT
-
PERMANENT_REDIRECT
-
BAD_REQUEST
-
UNAUTHORIZED
-
PAYMENT_REQUIRED
-
FORBIDDEN
-
NOT_FOUND
-
METHOD_NOT_ALLOWED
-
NOT_ACCEPTABLE
-
PROXY_AUTHENTICATION_REQUIRED
-
REQUEST_TIMEOUT
-
CONFLICT
-
GONE
-
LENGTH_REQUIRED
-
PRECONDITION_FAILED
-
PAYLOAD_TOO_LARGE
-
URI_TOO_LONG
-
UNSUPPORTED_MEDIA_TYPE
-
REQUESTED_RANGE_NOT_SATISFIABLE
-
EXPECTATION_FAILED
-
UNPROCESSABLE_ENTITY
-
LOCKED
-
FAILED_DEPENDENCY
-
UPGRADE_REQUIRED
-
TOO_MANY_REQUESTS
-
REQUEST_HEADER_FIELDS_TOO_LARGE
-
UNAVAILABLE_FOR_LEGAL_REASONS
-
INTERNAL_SERVER_ERROR
-
NOT_IMPLEMENTED
-
BAD_GATEWAY
-
SERVICE_UNAVAILABLE
-
GATEWAY_TIMEOUT
-
HTTP_VERSION_NOT_SUPPORTED
-
VARIANT_ALSO_NEGOTIATES
-
INSUFFICIENT_STORAGE
-
LOOP_DETECTED
-
BANDWIDTH_LIMIT_EXCEEDED
-
NOT_EXTENDED
-
NETWORK_AUTHENTICATION_REQUIRED
-
UNKNOWN_REASON_0
-
UNKNOWN_REASON_1
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-
value
public int value()Returns the integer value of this status code.- Returns:
- the integer value of this status code.
-
getReasonPhrase
Returns the reason phrase of this status code.- Returns:
- the reason phrase of this status code.
-
series
Returns the HTTP status series of this status code.- Returns:
- the HTTP status series of this status code.
-
is1xxInformational
public boolean is1xxInformational()Whether this status code is in the HTTP series Informational.- Returns:
- true or false.
-
is2xxSuccessful
public boolean is2xxSuccessful()Whether this status code is in the HTTP series Successful.- Returns:
- true or false.
-
is3xxRedirection
public boolean is3xxRedirection()Whether this status code is in the HTTP series Redirection.- Returns:
- true or false.
-
is4xxClientError
public boolean is4xxClientError()Whether this status code is in the HTTP series Client error.- Returns:
- true or false.
-
is5xxServerError
public boolean is5xxServerError()Whether this status code is in the HTTP series Server error.- Returns:
- true or false.
-
isError
public boolean isError()Whether this status code is in the HTTP series Client error.- Returns:
- true or false.
-
toString
Return a string representation of this status code.- Overrides:
toStringin classEnum<HttpStatus>- Returns:
- a string representation of this status code.
-
valueOf
Return the enum constant of this type with the specified numeric value.- Parameters:
statusCode- the numeric value of the enum to be returned- Returns:
- the enum constant with the specified numeric value
- Throws:
IllegalArgumentException- if this enum has no constant for the specified numeric value
-
resolve
Resolve the given status code to anHttpStatus, if possible.- Parameters:
statusCode- the HTTP status code (potentially non-standard)- Returns:
- the corresponding
HttpStatus, ornullif not found
-