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
FieldsModifier and TypeFieldDescriptionstatic final StringUse 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 aKeyValuefor 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 aKeyValuefor the givenelementby 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- thePredicateused for validating the value- Returns:
- KeyValue
-
of
Creates aKeyValuefor the givenKeyNameand value and additionally validates it with thePredicate.- Parameters:
keyName- name of the key of the KeyValuevalue- value for keyvalidator- thePredicateused for validating the value- Returns:
- KeyValue
-
compareTo
- Specified by:
compareToin interfaceComparable<KeyValue>
-