Class Annotation

java.lang.Object
io.opencensus.trace.Annotation
Direct Known Subclasses:
AutoValue_Annotation

@Immutable public abstract class Annotation extends Object
A text annotation with a set of attributes.
Since:
0.5
  • Field Details

  • Constructor Details

    • Annotation

      Annotation()
  • Method Details

    • fromDescription

      public static Annotation fromDescription(String description)
      Returns a new Annotation with the given description.
      Parameters:
      description - the text description of the Annotation.
      Returns:
      a new Annotation with the given description.
      Throws:
      NullPointerException - if description is null.
      Since:
      0.5
    • fromDescriptionAndAttributes

      public static Annotation fromDescriptionAndAttributes(String description, Map<String,AttributeValue> attributes)
      Returns a new Annotation with the given description and set of attributes.
      Parameters:
      description - the text description of the Annotation.
      attributes - the attributes of the Annotation.
      Returns:
      a new Annotation with the given description and set of attributes.
      Throws:
      NullPointerException - if description or attributes are null.
      Since:
      0.5
    • getDescription

      public abstract String getDescription()
      Return the description of the Annotation.
      Returns:
      the description of the Annotation.
      Since:
      0.5
    • getAttributes

      public abstract Map<String,AttributeValue> getAttributes()
      Return the attributes of the Annotation.
      Returns:
      the attributes of the Annotation.
      Since:
      0.5