public enum Metric extends Enum<Metric>
toHTTPStatus()
returns the HTTP status code equivalent of each if isHTTPStatusCode(Metric)
is
true for it.Enum Constant and Description |
---|
AVERAGE |
BAD_REQUEST |
COUNT |
CREATED |
ERROR |
LATENCY |
NO_CONTENT |
NOT_FOUND |
OK |
TOO_MANY_REQUESTS |
UNAVAILABLE |
UNPROCESSABLE_ENTITY |
Modifier and Type | Method and Description |
---|---|
static boolean |
isHTTPStatusCode(Metric metric)
Returns if the given metric corresponds to a HTTP status.
|
org.springframework.http.HttpStatus |
toHTTPStatus()
The
HttpStatus equivalent of this enum, if one exists. |
String |
toString() |
static Metric |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Metric[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Metric OK
public static final Metric CREATED
public static final Metric NO_CONTENT
public static final Metric BAD_REQUEST
public static final Metric NOT_FOUND
public static final Metric UNPROCESSABLE_ENTITY
public static final Metric TOO_MANY_REQUESTS
public static final Metric ERROR
public static final Metric UNAVAILABLE
public static final Metric COUNT
public static final Metric AVERAGE
public static final Metric LATENCY
public static Metric[] values()
for (Metric c : Metric.values()) System.out.println(c);
public static Metric 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 org.springframework.http.HttpStatus toHTTPStatus()
HttpStatus
equivalent of this enum, if one exists.public static boolean isHTTPStatusCode(Metric metric)
metric
- The metric to check. Must be non-null.Copyright © 2021 Pivotal Software, Inc.. All rights reserved.