Package io.micrometer.core.instrument
Class Tags
java.lang.Object
io.micrometer.core.instrument.Tags
An immutable collection of
Tags that are guaranteed to be sorted and deduplicated by tag key.-
Method Summary
Modifier and TypeMethodDescriptionReturn a newTagsinstance by merging this collection and the specified tags.Return a newTagsinstance by merging this collection and the specified tags.Return a newTagsinstance by merging this collection and the specified key/value pairs.Return a newTagsinstance by merging this collection and the specified key/value pair.static TagsReturn a newTagsinstance by concatenating the specified collections of tags.static TagsReturn a newTagsinstance by concatenating the specified tags and key/value pairs.static Tagsempty()Return aTagsinstance that contains no elements.booleaninthashCode()iterator()static TagsReturn a newTagsinstance containing tags constructed from the specified tags.static TagsReturn a newTagsinstance containing tags constructed from the specified source tags.static TagsReturn a newTagsinstance containing tags constructed from the specified key/value pairs.static TagsReturn a newTagsinstance containing tags constructed from the specified key/value pair.stream()Return a stream of the contained tags.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
and
Return a newTagsinstance by merging this collection and the specified key/value pair.- Parameters:
key- the tag key to addvalue- the tag value to add- Returns:
- a new
Tagsinstance
-
and
Return a newTagsinstance by merging this collection and the specified key/value pairs.- Parameters:
keyValues- the key/value pairs to add- Returns:
- a new
Tagsinstance
-
and
Return a newTagsinstance by merging this collection and the specified tags.- Parameters:
tags- the tags to add- Returns:
- a new
Tagsinstance
-
and
Return a newTagsinstance by merging this collection and the specified tags.- Parameters:
tags- the tags to add- Returns:
- a new
Tagsinstance
-
iterator
-
stream
Return a stream of the contained tags.- Returns:
- a tags stream
-
hashCode
public int hashCode() -
equals
-
concat
public static Tags concat(@Nullable Iterable<? extends Tag> tags, @Nullable Iterable<Tag> otherTags)Return a newTagsinstance by concatenating the specified collections of tags.- Parameters:
tags- the first set of tagsotherTags- the second set of tags- Returns:
- the merged tags
-
concat
Return a newTagsinstance by concatenating the specified tags and key/value pairs.- Parameters:
tags- the first set of tagskeyValues- the additional key/value pairs to add- Returns:
- the merged tags
-
of
Return a newTagsinstance containing tags constructed from the specified source tags.- Parameters:
tags- the tags to add- Returns:
- a new
Tagsinstance
-
of
Return a newTagsinstance containing tags constructed from the specified key/value pair.- Parameters:
key- the tag key to addvalue- the tag value to add- Returns:
- a new
Tagsinstance
-
of
Return a newTagsinstance containing tags constructed from the specified key/value pairs.- Parameters:
keyValues- the key/value pairs to add- Returns:
- a new
Tagsinstance
-
of
Return a newTagsinstance containing tags constructed from the specified tags.- Parameters:
tags- the tags to add- Returns:
- a new
Tagsinstance
-
empty
Return aTagsinstance that contains no elements.- Returns:
- an empty
Tagsinstance
-
toString
-