Package io.micrometer.common
Interface KeyValue
- All Superinterfaces:
Comparable<KeyValue>
Key/value pair representing a dimension of a meter used to classify and drill into
measurements.
- Since:
- 1.10.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Use this if you want to indicate that the value is missing. -
Method Summary
-
Field Details
-
NONE_VALUE
Use this if you want to indicate that the value is missing.- See Also:
-
-
Method Details
-
getKey
String getKey() -
getValue
String getValue() -
of
Creates aKeyValue
for the given key and value.- Parameters:
key
- key of the KeyValuevalue
- value for key- Returns:
- KeyValue
-
of
- Parameters:
keyName
- name of the key of the KeyValuevalue
- value for key- Returns:
- KeyValue
-
of
static <E> KeyValue of(E element, Function<E, String> keyExtractor, Function<E, String> valueExtractor) Creates aKeyValue
for the givenelement
by extracting a key and value from it.- Parameters:
element
- the source elementkeyExtractor
- function to extract the key from the elementvalueExtractor
- function to extract the value from the element- Returns:
- KeyValue
-
of
- Parameters:
key
- key of the KeyValuevalue
- value for keyvalidator
- thePredicate
used for validating the value- Returns:
- KeyValue
-
of
Creates aKeyValue
for the givenKeyName
and value and additionally validates it with thePredicate
.- Parameters:
keyName
- name of the key of the KeyValuevalue
- value for keyvalidator
- thePredicate
used for validating the value- Returns:
- KeyValue
-
compareTo
- Specified by:
compareTo
in interfaceComparable<KeyValue>
-