Enum Class HttpOutcome
- All Implemented Interfaces:
Serializable
,Comparable<HttpOutcome>
,Constable
The outcome of an HTTP request.
Used as the "outcome"
KeyValue
for HTTP observations
.
- Since:
- 6.0
- Author:
- Brian Clozel, Andy Wilkinson
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionOutcome of the request was client error.Outcome of the request was informational.Outcome of the request was redirection.Outcome of the request was server error.Outcome of the request was success.Outcome of the request was unknown. -
Method Summary
Modifier and TypeMethodDescriptionio.micrometer.common.KeyValue
Returns theOutcome
as aKeyValue
namedoutcome
.static HttpOutcome
forStatus
(HttpStatusCode status) Return theHttpOutcome
for the given HTTPstatus
code.static HttpOutcome
Returns the enum constant of this class with the specified name.static HttpOutcome[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INFORMATIONAL
Outcome of the request was informational. -
SUCCESS
Outcome of the request was success. -
REDIRECTION
Outcome of the request was redirection. -
CLIENT_ERROR
Outcome of the request was client error. -
SERVER_ERROR
Outcome of the request was server error. -
UNKNOWN
Outcome of the request was unknown.
-
-
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
-
asKeyValue
public io.micrometer.common.KeyValue asKeyValue()Returns theOutcome
as aKeyValue
namedoutcome
.- Returns:
- the
outcome
KeyValue
-
forStatus
Return theHttpOutcome
for the given HTTPstatus
code.- Parameters:
status
- the HTTP status code- Returns:
- the matching HttpOutcome
-