Package io.prometheus.metrics.config
Enum EscapingScheme
- All Implemented Interfaces:
Serializable
,Comparable<EscapingScheme>
,Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionNO_ESCAPING indicates that a name will not be escaped.DOTS_ESCAPING is similar to UNDERSCORE_ESCAPING, except that dots are converted to `_dot_` and pre-existing underscores are converted to `__`.UNDERSCORE_ESCAPING replaces all legacy-invalid characters with underscores.VALUE_ENCODING_ESCAPING prepends the name with `U__` and replaces all invalid characters with the Unicode value, surrounded by underscores. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final EscapingScheme
Default escaping scheme for names when not specified. -
Method Summary
Modifier and TypeMethodDescriptionstatic EscapingScheme
fromAcceptHeader
(String acceptHeader) fromAcceptHeader returns an EscapingScheme depending on the Accept header.final String
getValue()
static EscapingScheme
Returns the enum constant of this type with the specified name.static EscapingScheme[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.Methods inherited from class Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
ALLOW_UTF8
NO_ESCAPING indicates that a name will not be escaped. -
UNDERSCORE_ESCAPING
UNDERSCORE_ESCAPING replaces all legacy-invalid characters with underscores. -
DOTS_ESCAPING
DOTS_ESCAPING is similar to UNDERSCORE_ESCAPING, except that dots are converted to `_dot_` and pre-existing underscores are converted to `__`. -
VALUE_ENCODING_ESCAPING
VALUE_ENCODING_ESCAPING prepends the name with `U__` and replaces all invalid characters with the Unicode value, surrounded by underscores. Single underscores are replaced with double underscores.
-
-
Field Details
-
DEFAULT
Default escaping scheme for names when not specified.
-
-
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
-
getValue
-
fromAcceptHeader
fromAcceptHeader returns an EscapingScheme depending on the Accept header. Iff the header contains an escaping=allow-utf-8 term, it will select NO_ESCAPING. If a valid "escaping" term exists, that will be used. Otherwise, the global default will be returned. -
toHeaderFormat
-