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 newTags
instance by merging this collection and the specified tags.Return a newTags
instance by merging this collection and the specified tags.Return a newTags
instance by merging this collection and the specified key/value pairs.Return a newTags
instance by merging this collection and the specified key/value pair.static Tags
Return a newTags
instance by concatenating the specified collections of tags.static Tags
Return a newTags
instance by concatenating the specified tags and key/value pairs.static Tags
empty()
Return aTags
instance that contains no elements.boolean
int
hashCode()
iterator()
static Tags
Return a newTags
instance containing tags constructed from the specified tags.static Tags
Return a newTags
instance containing tags constructed from the specified source tags.static Tags
Return a newTags
instance containing tags constructed from the specified key/value pairs.static Tags
Return a newTags
instance containing tags constructed from the specified key/value pair.stream()
Return a stream of the contained tags.toString()
-
Method Details
-
and
Return a newTags
instance 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
Tags
instance
-
and
Return a newTags
instance by merging this collection and the specified key/value pairs.- Parameters:
keyValues
- the key/value pairs to add, elements mustn't be null- Returns:
- a new
Tags
instance
-
and
Return a newTags
instance by merging this collection and the specified tags.- Parameters:
tags
- the tags to add, elements mustn't be null- Returns:
- a new
Tags
instance
-
and
Return a newTags
instance by merging this collection and the specified tags.- Parameters:
tags
- the tags to add, elements mustn't be null- Returns:
- a new
Tags
instance
-
iterator
-
spliterator
- Specified by:
spliterator
in interfaceIterable<Tag>
-
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<? extends Tag> otherTags) Return a newTags
instance by concatenating the specified collections of tags.- Parameters:
tags
- the first set of tags, elements mustn't be nullotherTags
- the second set of tags, elements mustn't be null- Returns:
- the merged tags
-
concat
Return a newTags
instance by concatenating the specified tags and key/value pairs.- Parameters:
tags
- the first set of tags, elements mustn't be nullkeyValues
- the additional key/value pairs to add, elements mustn't be null- Returns:
- the merged tags
-
of
Return a newTags
instance containing tags constructed from the specified source tags.- Parameters:
tags
- the tags to add, elements mustn't be null- Returns:
- a new
Tags
instance
-
of
Return a newTags
instance containing tags constructed from the specified key/value pair.- Parameters:
key
- the tag key to addvalue
- the tag value to add- Returns:
- a new
Tags
instance
-
of
Return a newTags
instance containing tags constructed from the specified key/value pairs.- Parameters:
keyValues
- the key/value pairs to add, elements mustn't be null- Returns:
- a new
Tags
instance
-
of
Return a newTags
instance containing tags constructed from the specified tags.- Parameters:
tags
- the tags to add, elements mustn't be null- Returns:
- a new
Tags
instance
-
empty
Return aTags
instance that contains no elements.- Returns:
- an empty
Tags
instance
-
toString
-