Class KeyValues
java.lang.Object
io.micrometer.common.KeyValues
-
Method Summary
Modifier and TypeMethodDescriptionReturn a newKeyValuesinstance by merging this collection and the specified key values.Return a newKeyValuesinstance by merging this collection and the specified key values.<E> KeyValuesand(@Nullable Iterable<E> elements, Function<E, String> keyExtractor, Function<E, String> valueExtractor) Return a newKeyValuesinstance by merging this collection and the key values extracted from the given elements.Return a newKeyValuesinstance by merging this collection and the specified key/value pairs.Return a newKeyValuesinstance by merging this collection and the specified key/value pair.static KeyValuesconcat(@Nullable Iterable<? extends KeyValue> keyValues, @Nullable Iterable<? extends KeyValue> otherKeyValues) Return a newKeyValuesinstance by concatenating the specified collections of key values.static KeyValuesReturn a newKeyValuesinstance by concatenating the specified key values and key/value pairs.static KeyValuesempty()Return aKeyValuesinstance that contains no elements.booleaninthashCode()iterator()static KeyValuesReturn a newKeyValuesinstance containing key values constructed from the specified key values.static KeyValuesReturn a newKeyValuesinstance containing key values constructed from the specified source key values.static <E> KeyValuesof(@Nullable Iterable<E> elements, Function<E, String> keyExtractor, Function<E, String> valueExtractor) Return a newKeyValuesinstance containing key values extracted from the given elements.static KeyValuesReturn a newKeyValuesinstance containing key values constructed from the specified key/value pairs.static KeyValuesReturn a newKeyValuesinstance containing key value constructed from the specified key/value pair.stream()Return a stream of the contained key values.toString()
-
Method Details
-
and
-
and
-
and
-
and
public <E> KeyValues and(@Nullable Iterable<E> elements, Function<E, String> keyExtractor, Function<E, String> valueExtractor) Return a newKeyValuesinstance by merging this collection and the key values extracted from the given elements.- Parameters:
elements- the source elementskeyExtractor- function to extract the key from the elementvalueExtractor- function to extract the value from the element- Returns:
- a new
KeyValuesinstance
-
and
-
iterator
-
spliterator
- Specified by:
spliteratorin interfaceIterable<KeyValue>
-
stream
-
hashCode
-
equals
-
concat
public static KeyValues concat(@Nullable Iterable<? extends KeyValue> keyValues, @Nullable Iterable<? extends KeyValue> otherKeyValues) Return a newKeyValuesinstance by concatenating the specified collections of key values.- Parameters:
keyValues- the first set of key values, elements mustn't be nullotherKeyValues- the second set of key values, elements mustn't be null- Returns:
- the merged key values
-
concat
public static KeyValues concat(@Nullable Iterable<? extends KeyValue> keyValues, String @Nullable ... otherKeyValues) Return a newKeyValuesinstance by concatenating the specified key values and key/value pairs.- Parameters:
keyValues- the first set of key values, elements mustn't be nullotherKeyValues- the additional key/value pairs to add, elements mustn't be null- Returns:
- the merged key values
-
of
public static <E> KeyValues of(@Nullable Iterable<E> elements, Function<E, String> keyExtractor, Function<E, String> valueExtractor) Return a newKeyValuesinstance containing key values extracted from the given elements.- Parameters:
elements- the source elementskeyExtractor- function to extract the key from the elementvalueExtractor- function to extract the value from the element- Returns:
- a new
KeyValuesinstance
-
of
-
of
-
of
-
of
-
empty
Return aKeyValuesinstance that contains no elements.- Returns:
- an empty
KeyValuesinstance
-
toString
-