Enum Class HttpOutcome

java.lang.Object
java.lang.Enum<HttpOutcome>
org.springframework.http.observation.HttpOutcome
All Implemented Interfaces:
Serializable, Comparable<HttpOutcome>, Constable

public enum HttpOutcome extends Enum<HttpOutcome>
The outcome of an HTTP request.

Used as the "outcome" KeyValue for HTTP observations.

Since:
6.0
Author:
Brian Clozel, Andy Wilkinson
  • Enum Constant Details

    • INFORMATIONAL

      public static final HttpOutcome INFORMATIONAL
      Outcome of the request was informational.
    • SUCCESS

      public static final HttpOutcome SUCCESS
      Outcome of the request was success.
    • REDIRECTION

      public static final HttpOutcome REDIRECTION
      Outcome of the request was redirection.
    • CLIENT_ERROR

      public static final HttpOutcome CLIENT_ERROR
      Outcome of the request was client error.
    • SERVER_ERROR

      public static final HttpOutcome SERVER_ERROR
      Outcome of the request was server error.
    • UNKNOWN

      public static final HttpOutcome UNKNOWN
      Outcome of the request was unknown.
  • Method Details

    • values

      public static HttpOutcome[] 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

      public static HttpOutcome valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • asKeyValue

      public io.micrometer.common.KeyValue asKeyValue()
      Returns the Outcome as a KeyValue named outcome.
      Returns:
      the outcome KeyValue
    • forStatus

      public static HttpOutcome forStatus(HttpStatusCode status)
      Return the HttpOutcome for the given HTTP status code.
      Parameters:
      status - the HTTP status code
      Returns:
      the matching HttpOutcome