Class TagContext

  • Direct Known Subclasses:
    ContextUtils.EmptyTagContext, NoopTags.NoopTagContext, TagMapImpl

    @Immutable
    public abstract class TagContext
    extends java.lang.Object
    A map from TagKey to TagValue that can be used to label anything that is associated with a specific operation.

    For example, TagContexts 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 of TagContext and contains the same key-value pairs.
      protected abstract java.util.Iterator<Tag> getIterator()
      Returns an iterator over the tags in this TagContext.
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • TagContext

        public TagContext()
    • Method Detail

      • getIterator

        protected abstract java.util.Iterator<Tag> getIterator()
        Returns an iterator over the tags in this TagContext.
        Returns:
        an iterator over the tags in this TagContext.
        Since:
        0.8
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(@Nullable
                              java.lang.Object other)
        Returns true iff the other object is an instance of TagContext and contains the same key-value pairs. Implementations are free to override this method to provide better performance.
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class java.lang.Object