Package io.opencensus.tags
Class TagContext
- java.lang.Object
-
- io.opencensus.tags.TagContext
-
- Direct Known Subclasses:
ContextUtils.EmptyTagContext
,NoopTags.NoopTagContext
,TagMapImpl
@Immutable public abstract class TagContext extends java.lang.Object
A map fromTagKey
toTagValue
that can be used to label anything that is associated with a specific operation.For example,
TagContext
s can be used to label stats, log messages, or debugging information.- Since:
- 0.8
-
-
Constructor Summary
Constructors Constructor Description TagContext()
-
Method Summary
All Methods Instance Methods Abstract 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 abstract java.util.Iterator<Tag>
getIterator()
Returns an iterator over the tags in thisTagContext
.int
hashCode()
java.lang.String
toString()
-
-
-
Method Detail
-
getIterator
protected abstract java.util.Iterator<Tag> getIterator()
Returns an iterator over the tags in thisTagContext
.- Returns:
- an iterator over the tags in this
TagContext
. - Since:
- 0.8
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(@Nullable java.lang.Object other)
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 classjava.lang.Object
-
hashCode
public final int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-