Package io.micrometer.core.instrument
Class Tags
- java.lang.Object
-
- io.micrometer.core.instrument.Tags
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Tagsand(Tag... tags)Return a newTagsinstance by merging this collection and the specified tags.Tagsand(java.lang.Iterable<? extends Tag> tags)Return a newTagsinstance by merging this collection and the specified tags.Tagsand(java.lang.String... keyValues)Return a newTagsinstance by merging this collection and the specified key/value pairs.Tagsand(java.lang.String key, java.lang.String value)Return a newTagsinstance by merging this collection and the specified key/value pair.static Tagsconcat(java.lang.Iterable<? extends Tag> tags, java.lang.Iterable<Tag> otherTags)Return a newTagsinstance by concatenating the specified collections of tags.static Tagsconcat(java.lang.Iterable<? extends Tag> tags, java.lang.String... keyValues)Return a newTagsinstance by concatenating the specified tags and key/value pairs.static Tagsempty()Return aTagsinstance that contains no elements.booleanequals(java.lang.Object obj)inthashCode()java.util.Iterator<Tag>iterator()static Tagsof(Tag... tags)Return a newTagsinstance containing tags constructed from the specified tags.static Tagsof(java.lang.Iterable<? extends Tag> tags)Return a newTagsinstance containing tags constructed from the specified source tags.static Tagsof(java.lang.String... keyValues)Return a newTagsinstance containing tags constructed from the specified key/value pairs.static Tagsof(java.lang.String key, java.lang.String value)Return a newTagsinstance containing tags constructed from the specified key/value pair.java.util.stream.Stream<Tag>stream()Return a stream of the contained tags.java.lang.StringtoString()
-
-
-
Method Detail
-
and
public Tags and(java.lang.String key, java.lang.String value)
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
public Tags and(@Nullable java.lang.String... keyValues)
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
public Tags and(@Nullable Tag... tags)
Return a newTagsinstance by merging this collection and the specified tags.- Parameters:
tags- the tags to add- Returns:
- a new
Tagsinstance
-
and
public Tags and(@Nullable java.lang.Iterable<? extends Tag> tags)
Return a newTagsinstance by merging this collection and the specified tags.- Parameters:
tags- the tags to add- Returns:
- a new
Tagsinstance
-
iterator
public java.util.Iterator<Tag> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<Tag>
-
stream
public java.util.stream.Stream<Tag> stream()
Return a stream of the contained tags.- Returns:
- a tags stream
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(@Nullable java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
concat
public static Tags concat(@Nullable java.lang.Iterable<? extends Tag> tags, @Nullable java.lang.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
public static Tags concat(@Nullable java.lang.Iterable<? extends Tag> tags, @Nullable java.lang.String... keyValues)
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
public static Tags of(@Nullable java.lang.Iterable<? extends Tag> tags)
Return a newTagsinstance containing tags constructed from the specified source tags.- Parameters:
tags- the tags to add- Returns:
- a new
Tagsinstance
-
of
public static Tags of(java.lang.String key, java.lang.String value)
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
public static Tags of(@Nullable java.lang.String... keyValues)
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
public static Tags of(@Nullable Tag... tags)
Return a newTagsinstance containing tags constructed from the specified tags.- Parameters:
tags- the tags to add- Returns:
- a new
Tagsinstance
-
empty
public static Tags empty()
Return aTagsinstance that contains no elements.- Returns:
- an empty
Tagsinstance
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-