Package io.opencensus.implcore.tags
Class TagMapImpl
- java.lang.Object
-
- io.opencensus.tags.TagContext
-
- io.opencensus.implcore.tags.TagMapImpl
-
@Immutable public final class TagMapImpl extends TagContext
Implementation ofTagContext
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
TagMapImpl.TagIterator
-
Field Summary
Fields Modifier and Type Field Description static TagMapImpl
EMPTY
EmptyTagMapImpl
with no tags.private java.util.Map<TagKey,TagValueWithMetadata>
tags
-
Constructor Summary
Constructors Constructor Description TagMapImpl(java.util.Map<? extends TagKey,? extends TagValueWithMetadata> tags)
Creates a newTagMapImpl
with the given tags.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object other)
Returns true iff the other object is an instance ofTagContext
and contains the same key-value pairs.protected java.util.Iterator<Tag>
getIterator()
Returns an iterator over the tags in thisTagContext
.java.util.Map<TagKey,TagValueWithMetadata>
getTags()
Returns the tags of thisTagMapImpl
.-
Methods inherited from class io.opencensus.tags.TagContext
hashCode, toString
-
-
-
-
Field Detail
-
EMPTY
public static final TagMapImpl EMPTY
EmptyTagMapImpl
with no tags.
-
tags
private final java.util.Map<TagKey,TagValueWithMetadata> tags
-
-
Constructor Detail
-
TagMapImpl
public TagMapImpl(java.util.Map<? extends TagKey,? extends TagValueWithMetadata> tags)
Creates a newTagMapImpl
with the given tags.- Parameters:
tags
- the initial tags for thisTagMapImpl
.
-
-
Method Detail
-
getTags
public java.util.Map<TagKey,TagValueWithMetadata> getTags()
Returns the tags of thisTagMapImpl
.- Returns:
- the tags.
-
getIterator
protected java.util.Iterator<Tag> getIterator()
Description copied from class:TagContext
Returns an iterator over the tags in thisTagContext
.- Specified by:
getIterator
in classTagContext
- Returns:
- an iterator over the tags in this
TagContext
.
-
equals
public boolean equals(@Nullable java.lang.Object other)
Description copied from class:TagContext
Returns true iff the other object is an instance ofTagContext
and contains the same key-value pairs. Implementations are free to override this method to provide better performance.- Overrides:
equals
in classTagContext
-
-